Continental Innovates with Rancher and Kubernetes
This section shows an example of how to configure the vSphere cloud provider.
The vSphere cloud provider must be enabled to allow dynamic provisioning of volumes.
For more details on deploying a Kubernetes cluster on vSphere, refer to the official cloud provider documentation.
Note: This documentation reflects the new vSphere Cloud Provider configuration schema introduced in Kubernetes v1.9 which differs from previous versions.
Given the following:
eu-west-1
vc.example.com
provisioner
secret
ds-1
vm/kubernetes
The corresponding configuration for the provider would then be as follows:
rancher_kubernetes_engine_config: (...) cloud_provider: name: vsphere vsphereCloudProvider: virtual_center: vc.example.com: user: provisioner password: secret port: 443 datacenters: /eu-west-1 workspace: server: vc.example.com folder: myvmfolder default-datastore: /eu-west-1/datastore/ds-1 datacenter: /eu-west-1 resourcepool-path: /eu-west-1/host/hn1/resources/myresourcepool
The vSphere configuration options are divided into 5 groups:
The main purpose of global options is to be able to define a common set of configuration parameters that will be inherited by all vCenters defined under the virtual_center directive unless explicitly defined there.
virtual_center
Accordingly, the global directive accepts the same configuration options that are available under the virtual_center directive. Additionally it accepts a single parameter that can only be specified here:
global
Example:
(...) global: insecure-flag: true
This configuration directive specifies the vCenters that are managing the nodes in the cluster. You must define at least one vCenter/ESXi server. If the nodes span multiple vCenters then all must be defined.
Each vCenter is defined by adding a new entry under the virtual_center directive with the vCenter IP or FQDN as the name. All required parameters must be provided for each vCenter unless they are already defined under the global directive.
The following additional options (introduced in Kubernetes v1.11) are not yet supported in RKE.
(...) virtual_center: 172.158.111.1: {} # This vCenter inherits all it's properties from global options 172.158.110.2: # All required options are set explicitly user: vc-user password: othersecret datacenters: eu-west-2
This configuration group specifies how storage for volumes is created in vSphere. The following configuration options are available:
/<dataCenter>/host/<hostOrClusterName>/Resources/<poolName>
Resources/<poolName>
Resources
(...) workspace: server: 172.158.111.1 # matches IP of vCenter defined in the virtual_center block datacenter: eu-west-1 folder: vm/kubernetes default-datastore: ds-1
The following configuration options are available under the disk directive:
The following configuration options are available under the network directive: