vsphere pvc (in-tree)

To use Vmware datastores as storage for your Kubernetes/Rancher Cluster you absolutely MUST provision the cluster with a cloud provider. This does not work if you already have the cluster in place, not sure why. Maybe there are other ways but this worked for me :)

  1. Prepare the cloud provider yaml

  2. Replace the IP address of Virtual Center with IP or FQDN

  3. Replace Username and password (duuh)

  4. My datacenter is called “QNet” so replace it this name where appropriate, folder should be where your K8 Nodes reside

  cloud_provider:
      name: vsphere
      vsphereCloudProvider:
        disk:
          scsicontrollertype: pvscsi
        global:
          insecure-flag: true
          soap-roundtrip-count: 0
        virtual_center:
          <IP TO vCENTER>:
            datacenters: /QNet
            port: '443'
            soap-roundtrip-count: 0
            user: 'MyServiceAccount@domain.local'
            password: 'MyPassWord'
        workspace:
          datacenter: '/QNet'
          default-datastore: '/QNet/datastore/datastore_01'
          folder: '/QNet/vm/K8'
          resourcepool-path: '/QNet/resources'
          server: 10.130.140.26
  1. Create a new cluster in Rancher and tick “Custom cloud provider” and the click edit as yaml in the upper right corner

  2. Provision the cluster

  3. Once you have created the storage class you can test it by going to your default project/namespace and click volumes

  4. Done

Last updated