vSphere Cloud Provider

  • By Canonical Kubernetes
Channel Revision Published Runs on
latest/stable 47 21 Apr 2023
Ubuntu 22.04 Ubuntu 20.04
latest/candidate 37 16 Mar 2023
Ubuntu 22.04 Ubuntu 20.04
latest/beta 47 17 Apr 2023
Ubuntu 22.04 Ubuntu 20.04
latest/edge 48 21 Apr 2023
Ubuntu 22.04 Ubuntu 20.04
1.28/edge 48 21 Apr 2023
Ubuntu 22.04 Ubuntu 20.04
1.27/stable 47 21 Apr 2023
Ubuntu 22.04 Ubuntu 20.04
1.27/candidate 45 09 Apr 2023
Ubuntu 22.04 Ubuntu 20.04
1.27/beta 47 17 Apr 2023
Ubuntu 22.04 Ubuntu 20.04
1.27/edge 46 17 Apr 2023
Ubuntu 22.04 Ubuntu 20.04
1.26/stable 37 20 Mar 2023
Ubuntu 22.04 Ubuntu 20.04
1.26/candidate 37 16 Mar 2023
Ubuntu 22.04 Ubuntu 20.04
1.26/beta 24 09 Apr 2023
Ubuntu 22.04 Ubuntu 20.04
1.26/edge 24 16 Nov 2022
Ubuntu 22.04 Ubuntu 20.04
1.25/stable 23 30 Sep 2022
Ubuntu 22.04 Ubuntu 20.04
1.25/candidate 23 28 Sep 2022
Ubuntu 22.04 Ubuntu 20.04
1.25/beta 25 01 Dec 2022
Ubuntu 22.04 Ubuntu 20.04
1.25/edge 15 27 Aug 2022
Ubuntu 22.04 Ubuntu 20.04
juju deploy vsphere-cloud-provider
Show information

Platform:

Ubuntu
22.04 20.04

This charm encapsulates the out-of-tree Kubernetes vSphere Cloud Provider, including both the Cloud Provider Interface (CPI) and the Container Storage Interface (CSI) components along with related lifecycle operations.

This charm is built using the charmcraft ops framework.

Deployment

This charm is not functional when deployed by itself. It requires an existing Kubernetes cluster as well as the vsphere-integrator charm installed and trusted in a Juju vSphere environment. By default, the vsphere-integrator charm will enable vsphere capabilities using the in-tree cloud provider. However, it is recommended to use the out-of-tree provider for more control of CPI/CSI configuration and maintenance.

Deployment requires the vsphere-integrator and a few relations:

  • Existing Deployment
juju deploy vsphere-cloud-provider

# removes in-tree provider
juju remove-relation vsphere-integrator:clients kubernetes-control-plane
juju remove-relation vsphere-integrator:clients kubernetes-worker

# configures out-of-tree provider
juju relate vsphere-cloud-provider:certificates            easyrsa
juju relate vsphere-cloud-provider:kube-control            kubernetes-control-plane
juju relate vsphere-cloud-provider:external-cloud-provider kubernetes-control-plane
juju relate vsphere-cloud-provider                         vsphere-integrator:clients

##  wait for the vsphere controller daemonset to be running
kubectl get ds -n kube-system
  • New Deployment
juju deploy charmed-kubernetes
juju deploy vsphere-integrator --trust
juju deploy vsphere-cloud-provider

juju relate vsphere-cloud-provider:certificates            easyrsa
juju relate vsphere-cloud-provider:kube-control            kubernetes-control-plane
juju relate vsphere-cloud-provider:external-cloud-provider kubernetes-control-plane
juju relate vsphere-cloud-provider                         vsphere-integrator

##  wait for the vsphere controller daemonset to be running
kubectl get ds -n kube-system

This will deploy the most recent vsphere cloud-provider and vsphere csi-driver supported by the charm. See all supported versions with:

juju run-action vsphere-cloud-provider/leader --wait list-versions

Resources Created

Deployment of this charm provides a storage class that can be used to create PVs or PVCs on your vsphere cluster.

For a list of all kubernetes resources installed by this charm, run the following:

juju run-action vsphere-cloud-provider/leader --wait list-resources

Examples

Creating a pod with a PersistentDisk-backed volume

This script creates a busybox pod with a persistent volume claim backed by vSphere’s PersistentDisk.

#!/bin/bash

# create a persistent volume claim using the charm's storage class
kubectl create -f - <<EOY
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: testclaim
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 100Mi
  storageClassName: csi-vsphere-default
EOY

# create the busybox pod with a volume using that PVC:
kubectl create -f - <<EOY
apiVersion: v1
kind: Pod
metadata:
  name: busybox
  namespace: default
spec:
  containers:
    - image: busybox
      command:
        - sleep
        - "3600"
      imagePullPolicy: IfNotPresent
      name: busybox
      volumeMounts:
        - mountPath: "/pv"
          name: testvolume
  restartPolicy: Always
  volumes:
    - name: testvolume
      persistentVolumeClaim:
        claimName: testclaim
EOY

Help us improve this documentation

Most of this documentation can be collaboratively discussed and changed on the respective topic in the doc category of the Charmhub forum. See the documentation guidelines if you’d like to contribute.

Last updated 2 months ago. Help improve this document in the forum.