Your submission was sent successfully! Close

Charmed Kubernetes on vSphere

Charmed Kubernetes will install and run on vSphere virtual servers. With the addition of the vsphere-integrator, your cluster will also be able to directly use native vSphere features such as storage.


These instructions for deploying Charmed Kubernetes with the vSphere integrator assume that Juju has been configured appropriately for your vSphere server. For reference, the configuration options may be found in the Juju documentation.

vSphere integrator

The vsphere-integrator charm simplifies working with Charmed Kubernetes on vSphere servers. Using the credentials provided to Juju, it acts as a proxy between Charmed Kubernetes and the underlying cloud, granting permissions to dynamically create, for example, storage.


If you install Charmed Kubernetes using the Juju bundle, you can add the vsphere-integrator at the same time by using the following overlay file (download it here):

description: Charmed Kubernetes overlay to add native vSphere support.
      gui-x: "600"
      gui-y: "300"
    charm: vsphere-integrator
    num_units: 1
    trust: true
  - ['vsphere-integrator', 'kubernetes-control-plane']
  - ['vsphere-integrator', 'kubernetes-worker']

To use this overlay with the Charmed Kubernetes bundle, it is specified during deploy like this:

juju deploy charmed-kubernetes --overlay vsphere-overlay.yaml --trust

... and remember to fetch the configuration file!

juju scp kubernetes-control-plane/0:config ~/.kube/config
Resource usage:

By relating to this charm, other charms can directly allocate resources, such as managed disks and load balancers, which could lead to cloud charges and count against quotas. Because these resources are not managed by Juju, they will not be automatically deleted when the models or applications are destroyed, nor will they show up in Juju's status or GUI. It is therefore up to the operator to manually delete these resources when they are no longer needed.


The vSphere integrator supports multiple configuration options which can be used to describe the vSphere environment.

The only required option is datastore, as it is not included in the Juju credential that this charm relies on. By default, this is set to datastore1. This can be changed with:

juju config vsphere-integrator datastore='mydatastore'

You may also configure a folder and resource pool path for this charm. Details about these options can be found in the vmware documentation:

juju config vsphere-integrator folder='juju-kubernetes' respool_path='foo'

The credentials used to interact with vSphere are obtained from Juju (via '--trust' during deployment). These may be overriden by specifying credentials directly in the charm configuration:

juju config vsphere-integrator \
  vsphere_ip='a.b.c.d' \
  user='joe' \
  password='passw0rd' \

If any configuration option is set, they must all be set.

When all of the credential config options are empty, this charm will fall back to the credential data it received via juju trust.


The vSphere integrator can make use of vSphere-backed storage for Kubernetes. The steps below create a busybox pod with a persistent volume claim backed by vSphere's PersistentDisk as an example.

1. Create a storage class using the provisioner:

kubectl create -f - <<EOY
kind: StorageClass
  name: mystorage
  diskformat: zeroedthick

2. Create a persistent volume claim (PVC) using that storage class:

kubectl create -f - <<EOY
kind: PersistentVolumeClaim
apiVersion: v1
  name: testclaim
    - ReadWriteOnce
      storage: 100Mi
  storageClassName: mystorage

3. Create a busybox pod with a volume using that PVC:

kubectl create -f - <<EOY
apiVersion: v1
kind: Pod
  name: busybox
  namespace: default
    - image: busybox
        - sleep
        - "3600"
      imagePullPolicy: IfNotPresent
      name: busybox
        - mountPath: "/pv"
          name: testvolume
  restartPolicy: Always
    - name: testvolume
        claimName: testclaim

For more configuration options and details of the permissions which the integrator uses, please see the vSphere integrator charm page.

We appreciate your feedback on the documentation. You can edit this page or file a bug here.