mirror of
https://github.com/rancher/rancher-docs.git
synced 2026-09-25 04:28:15 +00:00
Overhauled vSphere cluster doc
This commit is contained in:
+104
-31
@@ -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).
|
||||
|
||||

|
||||

|
||||
|
||||
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.
|
||||
|
||||

|
||||
|
||||
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**.
|
||||
|
||||

|
||||
|
||||

|
||||

|
||||
|
||||
**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`).
|
||||
|
||||

|
||||
|
||||
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.
|
||||
|
||||

|
||||
|
||||
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**.
|
||||

|
||||
|
||||
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.
|
||||
|
||||
<br/>
|
||||
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 </br> Browse </br> DeleteFile </br> FileManagement </br>UpdateVirtualMachineFiles </br> UpdateVirtualMachineMetadata |
|
||||
| Folder | Create </br> Delete |
|
||||
| Network | AssignNetwork |
|
||||
| Resource | AssignVMToPool |
|
||||
| System ? | Anonymous </br> Read </br> View |
|
||||
| Virtual Machine | Config (All) </br> GuestOperations (All) </br> Interact (All) </br> Inventory (All) </br> Provisioning (All) |
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
<p>Add one or more <strong>Node Pools</strong> to your cluster.<br/><br/>A <strong>Node Pool</strong> 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.</p>
|
||||
<p>Add one or more <strong>node pools</strong> to your cluster.<br/><br/>A <strong>node pool</strong> 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.</p>
|
||||
|
||||
<blockquote>
|
||||
<p><strong>Notes:</strong></p>
|
||||
<ul>
|
||||
<li>After you create a Node Template, it will be saved and you will be able to re-use it in additional Node Pools.</li>
|
||||
<li>Each Node Role (i.e. <code>etcd</code>, <code>Control Plane</code>, and <code>Worker</code>) must be fulfilled. Although it is possible to apply multiple Node Roles to a Node Pool, this is not recommended.</li>
|
||||
<li>The recommended setup is to have a Node Pool with the <code>etcd</code> Node Role and a count of three, a Node Pool with the <code>Control Plane</code> Node Role and a count of at least two, and a Node Pool with the <code>Worker</code> Node Role and a count of at least two. Regarding the <code>etcd</code> Node Role, refer to the <a href="https://coreos.com/etcd/docs/latest/v2/admin_guide.html#optimal-cluster-size" target="_blank">etcd Admin Guide</a>.</li>
|
||||
<li>Each node role (i.e. <code>etcd</code>, <code>Control Plane</code>, and <code>Worker</code>) should be assigned to a distinct node pool. Although it is possible to assign multiple node roles to a node pool, this should not be done for production clusters. </li>
|
||||
<li>The recommended setup is to have a node pool with the <code>etcd</code> node role and a count of three, a node pool with the <code>Control Plane</code> node role and a count of at least two, and a node pool with the <code>Worker</code> node role and a count of at least two. Regarding the <code>etcd</code> node role, refer to the <a href="https://coreos.com/etcd/docs/latest/v2/admin_guide.html#optimal-cluster-size" target="_blank">etcd Admin Guide</a>.</li>
|
||||
</ul>
|
||||
</blockquote>
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 113 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 150 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 164 KiB |
Reference in New Issue
Block a user