You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
5.6 KiB

  1. # vSphere cloud provider
  2. Kubespray can be deployed with vSphere as Cloud provider. This feature supports
  3. - Volumes
  4. - Persistent Volumes
  5. - Storage Classes and provisioning of volumes.
  6. - vSphere Storage Policy Based Management for Containers orchestrated by Kubernetes.
  7. ## Prerequisites
  8. You need at first to configure you vSphere environement by following the [official documentation](https://kubernetes.io/docs/getting-started-guides/vsphere/#vsphere-cloud-provider).
  9. After this step you should have:
  10. - UUID activated for each VM where Kubernetes will be deployed
  11. - A vSphere account with required privileges
  12. ## Kubespray configuration
  13. Fist you must define the cloud provider in `inventory/sample/group_vars/all.yml` and set it to `vsphere`.
  14. ```yml
  15. cloud_provider: vsphere
  16. ```
  17. Then, in the same file, you need to declare your vCenter credential following the description bellow.
  18. | Variable | Required | Type | Choices | Default | Comment |
  19. |------------------------------|----------|---------|----------------------------|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
  20. | vsphere_vcenter_ip | TRUE | string | | | IP/URL of the vCenter |
  21. | vsphere_vcenter_port | TRUE | integer | | | Port of the vCenter API. Commonly 443 |
  22. | vsphere_insecure | TRUE | integer | 1, 0 | | set to 1 if the host above uses a self-signed cert |
  23. | vsphere_user | TRUE | string | | | User name for vCenter with required privileges |
  24. | vsphere_password | TRUE | string | | | Password for vCenter |
  25. | vsphere_datacenter | TRUE | string | | | Datacenter name to use |
  26. | vsphere_datastore | TRUE | string | | | Datastore name to use |
  27. | vsphere_working_dir | TRUE | string | | | Working directory from the view "VMs and template" in the vCenter where VM are placed |
  28. | vsphere_scsi_controller_type | TRUE | string | buslogic, pvscsi, parallel | pvscsi | SCSI controller name. Commonly "pvscsi". |
  29. | vsphere_vm_uuid | FALSE | string | | | VM Instance UUID of virtual machine that host K8s master. Can be retrieved from instanceUuid property in VmConfigInfo, or as vc.uuid in VMX file or in `/sys/class/dmi/id/product_serial` (Optional, only used for Kubernetes <= 1.9.2) |
  30. | vsphere_public_network | FALSE | string | | Blank | Name of the network the VMs are joined to |
  31. | vsphere_resource_pool | FALSE | string | | Blank | Name of the Resource pool where the VMs are located (Optional, only used for Kubernetes >= 1.9.2) |
  32. Example configuration
  33. ```yml
  34. vsphere_vcenter_ip: "myvcenter.domain.com"
  35. vsphere_vcenter_port: 443
  36. vsphere_insecure: 1
  37. vsphere_user: "k8s@vsphere.local"
  38. vsphere_password: "K8s_admin"
  39. vsphere_datacenter: "DATACENTER_name"
  40. vsphere_datastore: "DATASTORE_name"
  41. vsphere_working_dir: "Docker_hosts"
  42. vsphere_scsi_controller_type: "pvscsi"
  43. vsphere_resource_pool: "K8s-Pool"
  44. ```
  45. ## Deployment
  46. Once the configuration is set, you can execute the playbook again to apply the new configuration
  47. ```
  48. cd kubespray
  49. ansible-playbook -i inventory/sample/hosts.ini -b -v cluster.yml
  50. ```
  51. You'll find some usefull examples [here](https://github.com/kubernetes/kubernetes/tree/master/examples/volumes/vsphere) to test your configuration.