diff --git a/content/rancher/v2.x/en/cluster-provisioning/rke-clusters/node-pools/vsphere/_index.md b/content/rancher/v2.x/en/cluster-provisioning/rke-clusters/node-pools/vsphere/_index.md index 627685e3f30..27670985a57 100644 --- a/content/rancher/v2.x/en/cluster-provisioning/rke-clusters/node-pools/vsphere/_index.md +++ b/content/rancher/v2.x/en/cluster-provisioning/rke-clusters/node-pools/vsphere/_index.md @@ -7,68 +7,141 @@ aliases: --- Use {{< product >}} to create a Kubernetes cluster in vSphere. -### Prerequisites +## Introduction -Before setting up a cluster in vSphere, you must ensure that you have a user in vSphere with sufficient permissions to create a Rancher cluster. +When creating a vSphere cluster Rancher first provisions the specified amount of virtual machines by communicating with the vCenter API. Then it installs Kubernetes on top of them. A vSphere cluster may consist of multiple groups of VMs with distinct properties, such as the amount of memory or the number of vCPUs. This allows for fine-grained controll over the sizing of nodes for the data, control and worker plane respectively. + +## Prerequisites + +> *Note:* +> +> If you are planning to make use of vSphere volumes for persistent storage in the cluster, there are [additional requirements]({{< baseurl >}}/rke/v0.1.x/en/config-options/cloud-providers/vsphere/) that must be met. + +Before processing to create a cluster you must ensure that you have a vSphere user with sufficient permissions. Let's walk through the steps of creating the user in the vSphere console: 1. From the **vSphere** console, go to the **Administration** page. 2. Go to the **Roles** tab. -3. Create a new *Role*. Give it a name and select the **Datastore**, **Network**, **Resource**, and **Virtual machine** *privileges*. +3. Create a new *role*. Give it a name and select the *privileges* listed in the [permissions table](#annex-vsphere-permissions). ![image]({{< baseurl >}}/img/rancher/rancherroles1.png) - ![image]({{< baseurl >}}/img/rancher/rancherroles2.png) 4. Go to the **Users and Groups** tab. -5. Create a new *User*. Fill out the form and then click **ok**. Make sure to note the username and password as you will need it when creating a cluster in Rancher. +5. Create a new *user*. Fill out the form and then click **OK**. Make sure to note the username and password as you will need it when configuring node templates in Rancher. ![image]({{< baseurl >}}/img/rancher/rancheruser.png) 6. Go to the **Global Permissions** tab. -7. Create a new *Global Permission*. Add the *User* you created earlier and assign it the Role you created earlier. Click **ok**. +7. Create a new *Global Permission*. Add the *user* you created earlier and assign it the Role you created earlier. Click **OK**. ![image]({{< baseurl >}}/img/rancher/globalpermissionuser.png) + ![image]({{< baseurl >}}/img/rancher/globalpermissionrole.png) - ![image]({{< baseurl >}}/img/rancher/globalpermissionfinal.png) -**Result:** Now you have a user that is able to successfully create and manager Rancher clusters in vSphere. +## Creating vSphere Clusters -### Creating vSphere Clusters +### Create a vSphere Node Template -To create the cluster. +In order to create a cluster you will need to create at least one vSphere [node template]({{< baseurl >}}/rancher/v2.x/en/cluster-provisioning/rke-clusters/node-pools/#node-templates) first that specifies how VMs are created in vSphere. + +> **Note:** +> +> Once you create a node template, it will be saved and you will be able to re-use it whenever you create additional vSphere clusters. + +1. Log in with an admin account to the Rancher UI. +2. In the right-hand account menu, select **Node Templates**. +3. Click **Add Template** and then click on the **vSphere** icon. +4. Under **[Account Access](#account-access)** enter the vCenter FQDN or IP address and the credentials for the vSphere user account (see [Prerequisites](#prerequisites)). +5. Under **[Instance Options](#instance-options)**, configure the number of vCPUs, memory and disk size for the VMs created by this template. +6. Optionally, enter the URL pointing to a [RancherOS]({{< baseurl >}}/os/v1.x/en/) cloud-config file in the **[Cloud Init](#instance-options)** field. +7. Ensure that the **[OS ISO URL](#instance-options)** contains the URL of a VMware ISO release for RancherOS (`rancheros-vmware.iso`). + + ![image]({{< baseurl >}}/img/rancher/vsphere-node-template-1.png) + +8. Optionally, provide a set of **[Configuration Parameters](#instance-options)** for the VMs. +9. Under **Scheduling** enter the name/path of the **Data Center** to instantiate the VMs in, the name of the **VM Network** to attach to and the name/path of the **Datastore** in which to store the disks. + + ![image]({{< baseurl >}}/img/rancher/vsphere-node-template-2.png) + +10. Optionally, assign labels to the VMs that can be used as a base for scheduling rules in the cluster. +11. Optionally, customize the configuration of the Docker daemon on the VMs that will be created. + +10. Assign a descriptive **Name** for this template and click **Create**. + +___ + +### Create a cluster 1. From the **Clusters** page, click **Add Cluster**. - 2. Choose **vSphere**. - 3. Enter a **Cluster Name**. - 4. {{< step_create-cluster_member-roles >}} - 5. {{< step_create-cluster_cluster-options >}} - 6. {{< step_create-cluster_node-pools >}} - 1. Click **Add Node Template**. + ![image]({{< baseurl >}}/img/rancher/vsphere-cluster-create-1.png) - 2. Use the **vSphere Options** to authenticate with vSphere and provision your cluster. +7. Review your configuration, then click **Create**. - - **Account Access** holds the host name for your vCenter host and your credentials for authentication. - - - **Instance Options** are used to provision your cluster's VMs. - - - **Scheduling** is used to choose the hypervisor your virtual machines will be scheduled to. - - 3. {{< step_rancher-template >}} - - 4. Click **Create**. - - 5. **Optional:** Add additional node pools. - -
-7. Review your options to confirm they're correct. Then click **Create**. +> **Note:** +> +> If you have a cluster with DRS enabled, it's recommended that you setup [VM-VM Affinity Rules](https://docs.vmware.com/en/VMware-vSphere/6.5/com.vmware.vsphere.resmgmt.doc/GUID-7297C302-378F-4AF2-9BD6-6EDB1E0A850A.html) to run VMs within the node pools assigned the etcd and control-plane roles on seperate ESXi hosts. This ensures that the failure of a single physical machine does not affect the availability of those planes. {{< result_create-cluster >}} + +## Annex - Node Template Configuration Reference + +Below tables describe the configuration options available in the vSphere node template. + +### Account Access + +| Parameter | Required | Description | +|:------------------------:|:--------:|:------------------------------------------------------------:| +| vCenter or ESXi Server | * | IP or FQDN of the vCenter or ESXi server used for managing VMs. | +| Port | * | Port to use to connect to the server. Defaults to 443. | +| Username | * | vCenter/ESXi user to authenticate with the server. | +| Password | * | User's password. | + +___ + +### Instance Options + +| Parameter | Required | Description | +|:------------------------:|:--------:|:------------------------------------------------------------:| +| CPUs | * | Number of vCPUS to assign to VMs. | +| Memory | * | Amount of memory to assign to VMs. | +| Disk. | * | Size of the disk (in MB) to attach to the VM | +| Cloud Init | | URL of a [RancherOS cloud-config]({{< baseurl >}}/os/v1.x/en/installation/configuration/) file to provision VMs with. This allows further customization of the RancherOS operating system, such as network configuration, DNS servers or system daemons.| +| OS ISO URL | * | URL of a RancherOS vSphere ISO file to boot the VMs from. You can find URLs for specfic versions [here](https://github.com/rancher/os). | +| Configuration Parameters | | Additional configuration parameters for the VMs. These correspond to the [Advanced Settings](https://kb.vmware.com/s/article/1016098) in the vSphere console. Example use cases include providing RancherOS [guestinfo]({{< baseurl >}}/os/v1.x/en/installation/running-rancheros/cloud/vmware-esxi/#vmware-guestinfo) parameters or enabling disk UUIDs for the VMs (`disk.EnableUUID=TRUE`). | + +___ + +### Scheduling Options + +| Parameter | Required | Description | +|:------------------------:|:--------:|:------------------------------------------------------------:| +| Data Center | * | Name/path of the datacenter to create VMs in. | +| Pool | | Name/path of the resource pool to schedule the VMs in. If not specified, the default resource pool is used. | +| Host | | Name/path of the host system to schedule VMs in. If specified, the host system's pool will be used and the *Pool* parameter will be ignored. | +| Network | * | Name of the VM network to attach VMs to. | +| Data Store | * | Datastore to store the VM disks. | +| Folder | | Folder to create the VMs in. | + +___ + +## Annex - vSphere permissions + +The following table lists the permissions required for the vSphere user account configured in the node templates: + +| Privilege Group | Operations | +|:----------------------|:-----------------------------------------------------------------------| +| Datastore | AllocateSpace
Browse
DeleteFile
FileManagement
UpdateVirtualMachineFiles
UpdateVirtualMachineMetadata | +| Folder | Create
Delete | +| Network | AssignNetwork | +| Resource | AssignVMToPool | +| System ? | Anonymous
Read
View | +| Virtual Machine | Config (All)
GuestOperations (All)
Interact (All)
Inventory (All)
Provisioning (All) | diff --git a/layouts/shortcodes/step_create-cluster_node-pools.html b/layouts/shortcodes/step_create-cluster_node-pools.html index 984765e6f5d..158eaf7f1f3 100644 --- a/layouts/shortcodes/step_create-cluster_node-pools.html +++ b/layouts/shortcodes/step_create-cluster_node-pools.html @@ -1,10 +1,9 @@ -

Add one or more Node Pools to your cluster.

A Node Pool is a collection of nodes based on a Node Template. A Node Template defines the configuration of a Node, like what Operating System image, number of CPUs and amount of RAM. Each Node Pool can have one or more Nodes Roles associated with it.

+

Add one or more node pools to your cluster.

A node pool is a collection of nodes based on a node template. A node Template defines the configuration of a node, like what Operating System to use, number of CPUs and amount of memory. Each node pool must have one or more nodes roles assigned.

Notes:

diff --git a/src/img/rancher/vsphere-cluster-create-1.png b/src/img/rancher/vsphere-cluster-create-1.png new file mode 100644 index 00000000000..35faaf08b30 Binary files /dev/null and b/src/img/rancher/vsphere-cluster-create-1.png differ diff --git a/src/img/rancher/vsphere-node-template-1.png b/src/img/rancher/vsphere-node-template-1.png new file mode 100644 index 00000000000..c8e7213a56a Binary files /dev/null and b/src/img/rancher/vsphere-node-template-1.png differ diff --git a/src/img/rancher/vsphere-node-template-2.png b/src/img/rancher/vsphere-node-template-2.png new file mode 100644 index 00000000000..34da41240d2 Binary files /dev/null and b/src/img/rancher/vsphere-node-template-2.png differ