ncs-nutanix-csi-storage

by Nutanix

Helm chartv3.2.0-prodApp 3.2.0-prodVerified publisher

Nutanix Container Storage Interface (CSI) Driver

About this chart

Nutanix CSI Storage Driver Helm chart

Introduction

The Container Storage Interface (CSI) Volume Driver for Kubernetes leverages Nutanix Volumes and Nutanix Files to provide scalable and persistent storage for stateful applications.

When Files is used for persistent storage, applications on multiple pods can access the same storage, and also have the benefit of multi-pod read and write access.

Important notice

Starting with version 2.5 of this chart we separate the Snapshot components to a second independent Chart. If you plan to update an existing Nutanix CSI Chart version < v2.5.x with this Chart, you need to check below recommendation.

  • Once you upgrade to version 2.5+, the snapshot-controler will be removed, but previously installed Snapshot CRD stay in place. You will then need to install the nutanix-csi-snapshot Helm Chart following the Important notice procedure.
  • If you create Storageclass automatically with a previous Nutanix CSI Chart version < v2.5.x, take care to remove Storageclass before Helm upgrade.

If you previously installed Nutanix CSI Storage Driver with yaml file please follow the Upgrading from yaml based deployment section below.

If this is your first deployment and your Kubernetes Distribution does not bundle the snapshot components, you need to install first the Nutanix CSI Snapshot Controller Helm chart.

Please note that starting with v2.2.0, Nutanix CSI driver has changed format of driver name from com.nutanix.csi to csi.nutanix.com. All deployment yamls uses this new driver name format. However, if you initially installed CSI driver in version < v2.2.0 then you should need to continue to use old driver name com.nutanix.csi by setting legacy parameter to true. If not existing PVC/PV will not work with the new driver name.

Nutanix CSI driver documentation

https://portal.nutanix.com/page/documents/details?targetId=CSI-Volume-Driver-v3_0:CSI-Volume-Driver-v3_0

Features list

  • Nutanix CSI Driver v3.2.0
  • Nutanix Volumes support
  • Nutanix Files support
  • Volume clone
  • Volume snapshot and Restore
  • IP Address Whitelisting
  • LVM Volume supporting multi vdisks volume group
  • NFS Dynamic share provisioning
  • PV resize support for Volumes and Dynamic Files mode
  • iSCSI Auto CHAP Authentication
  • OS independence
  • Volume metrics and CSI operations metrics support
  • Squash type support for Dynamic File mode

Prerequisites

  • Kubernetes 1.20 or later
  • Kubernetes worker nodes must have the iSCSI package installed (Nutanix Volumes mode) and/or NFS tools (Nutanix Files mode)
  • This chart have been validated on RHEL/CentOS/Rocky 8/9 and Ubuntu 18.04/20.04/21.04/21.10/22.05, but the new architecture enables easy portability to other distributions.

Installing the Chart

To install the chart with the name nutanix-csi:

wget https://github.com/nutanix/helm-releases/releases/download/nutanix-csi-storage-3.2.0/nutanix-csi-storage-3.2.0.tgz

After downloading the chart you can directly set the values and install:

helm install nutanix-csi nutanix-csi-storage-3.2.0.tgz --set <key>=<value> -n <namespace of your choice>

Or you can unzip, set values and then install:

tar -xvf nutanix-csi-storage-3.2.0.tgz

helm install nutanix-csi nutanix-csi-storage-3.2.0 -n <namespace of your choice>

Upgrade

To upgrade the chart with the name nutanix-csi:

wget https://github.com/nutanix/helm-releases/releases/download/nutanix-csi-storage-3.2.0/nutanix-csi-storage-3.2.0.tgz

After downloading the chart you can directly set the values and upgrade:

helm upgrade nutanix-csi nutanix-csi-storage-3.2.0.tgz --set <key>=<value> -n <namespace of your choice>

Or you can unzip, set values and then upgrade:

tar -xvf nutanix-csi-storage-3.2.0.tgz

helm upgrade nutanix-csi nutanix-csi-storage -n <namespace of your choice>

Upgrading from yaml based deployment

Starting with CSI driver v2.5.0, yaml based deployment is discontinued. So to upgrade from yaml based deployment, you need to patch your existing CSI deployment with helm annotations. Please follow the following procedure.

HELM_CHART_NAME="nutanix-csi"
HELM_CHART_NAMESPACE="ntnx-system"
DRIVER_NAME="csi.nutanix.com"

kubectl delete sts csi-provisioner-ntnx-plugin -n ${HELM_CHART_NAMESPACE}
kubectl patch ds csi-node-ntnx-plugin -n ${HELM_CHART_NAMESPACE} -p '{"metadata": {"annotations":{"meta.helm.sh/release-name":"'"${HELM_CHART_NAME}"'","meta.helm.sh/release-namespace":"'"${HELM_CHART_NAMESPACE}"'"}, "labels":{"app.kubernetes.io/managed-by":"Helm"}}}'

kubectl patch csidriver ${DRIVER_NAME} -p '{"metadata": {"annotations":{"meta.helm.sh/release-name":"'"${HELM_CHART_NAME}"'","meta.helm.sh/release-namespace":"'"${HELM_CHART_NAMESPACE}"'"}, "labels":{"app.kubernetes.io/managed-by":"Helm"}}}'

kubectl patch sa csi-provisioner -n ${HELM_CHART_NAMESPACE} -p '{"metadata": {"annotations":{"meta.helm.sh/release-name":"'"${HELM_CHART_NAME}"'","meta.helm.sh/release-namespace":"'"${HELM_CHART_NAMESPACE}"'"}, "labels":{"app.kubernetes.io/managed-by":"Helm"}}}'
kubectl patch sa csi-node-ntnx-plugin -n ${HELM_CHART_NAMESPACE} -p '{"metadata": {"annotations":{"meta.helm.sh/release-name":"'"${HELM_CHART_NAME}"'","meta.helm.sh/release-namespace":"'"${HELM_CHART_NAMESPACE}"'"}, "labels":{"app.kubernetes.io/managed-by":"Helm"}}}'

kubectl patch clusterrole external-provisioner-runner -n ${HELM_CHART_NAMESPACE} -p '{"metadata": {"annotations":{"meta.helm.sh/release-name":"'"${HELM_CHART_NAME}"'","meta.helm.sh/release-namespace":"'"${HELM_CHART_NAMESPACE}"'"}, "labels":{"app.kubernetes.io/managed-by":"Helm"}}}'
kubectl patch clusterrole csi-node-runner -n ${HELM_CHART_NAMESPACE} -p '{"metadata": {"annotations":{"meta.helm.sh/release-name":"'"${HELM_CHART_NAME}"'","meta.helm.sh/release-namespace":"'"${HELM_CHART_NAMESPACE}"'"}, "labels":{"app.kubernetes.io/managed-by":"Helm"}}}'

kubectl patch clusterrolebinding csi-provisioner-role -n ${HELM_CHART_NAMESPACE} -p '{"metadata": {"annotations":{"meta.helm.sh/release-name":"'"${HELM_CHART_NAME}"'","meta.helm.sh/release-namespace":"'"${HELM_CHART_NAMESPACE}"'"}, "labels":{"app.kubernetes.io/managed-by":"Helm"}}}'
kubectl patch clusterrolebinding csi-node-role -n ${HELM_CHART_NAMESPACE} -p '{"metadata": {"annotations":{"meta.helm.sh/release-name":"'"${HELM_CHART_NAME}"'","meta.helm.sh/release-namespace":"'"${HELM_CHART_NAMESPACE}"'"}, "labels":{"app.kubernetes.io/managed-by":"Helm"}}}'

kubectl patch service csi-provisioner-ntnx-plugin -n ${HELM_CHART_NAMESPACE} -p '{"metadata": {"annotations":{"meta.helm.sh/release-name":"'"${HELM_CHART_NAME}"'","meta.helm.sh/release-namespace":"'"${HELM_CHART_NAMESPACE}"'"}, "labels":{"app.kubernetes.io/managed-by":"Helm"}}}'

kubectl patch service csi-metrics-service -n ${HELM_CHART_NAMESPACE} -p '{"metadata": {"annotations":{"meta.helm.sh/release-name":"'"${HELM_CHART_NAME}"'","meta.helm.sh/release-namespace":"'"${HELM_CHART_NAMESPACE}"'"}, "labels":{"app.kubernetes.io/managed-by":"Helm"}}}'

kubectl patch servicemonitor csi-driver -n ${HELM_CHART_NAMESPACE} -p '{"metadata": {"annotations":{"meta.helm.sh/release-name":"'"${HELM_CHART_NAME}"'","meta.helm.sh/release-namespace":"'"${HELM_CHART_NAMESPACE}"'"}, "labels":{"app.kubernetes.io/managed-by":"Helm"}}}' --type=merge

Now follow Installing the Chart section to finish upgrading the CSI driver.

Uninstalling the Chart

To uninstall/delete the nutanix-csi deployment:

helm delete nutanix-csi -n <namespace of your choice>

Configuration

The following table lists the configurable parameters of the Nutanix-CSI chart and their default values.

ParameterDescriptionDefault
legacyUse old reverse notation for CSI driver namefalse
createVolumeSnapshotClassVolumesnapshotclass will be created as part of the deploymenttrue
volumeSnapshotClassNameName of the volumesnapshotclassnutanix-snapshot-class
volumeSnapshotClassAnnotationsAnnotations to add to the volumesnapshotclass{}
volumeSnapshotClassLabelsLabels to add to the volumesnapshotclass{}
volumeSnapshotClassRetentionRetention policy for the volumesnapshotclass (Delete, Retain)Retain
createPrismCentralSecretCreate secret for PC account (if false use existing)true
prismCentralEndPointPrism Central (PC) cluster Virtual IP Address or fully qualified domain name (FQDN)
pcUsernameUsername of a Prism Central (PC) cluster admin (if created)
pcPasswordPassword for the Prism Central (PC) cluster admin (if created)
pcSecretNameSecret name that stores Prism Central (PC) cluster credentials
createSecretCreate secret for PE account (if false use existing)true
prismEndPointPrism Element (PE) cluster Virtual IP Address or fully qualified domain name (FQDN)
usernameUsername of a Prism Element (PE) cluster admin (if created)
passwordPassword for the Prism Element (PE) cluster admin (if created)
secretNameSecret name that stores Prism Element (PE) cluster credentialsntnx-secret
filesKey.endpointFileServer FQDN or FileServer IP (used for snapshot feature)
filesKey.usernameFileServer REST API Username (used for snapshot feature)
filesKey.passwordFileServer REST API Password (used for snapshot feature)
ntnxInitConfigMap.associateCategoriesToVolumeset it to true if categories should be associated to the volume, When using PE as the management plane, associateCategoriesToVolume won't have any effect.true
ntnxInitConfigMap.usePCset it to true if CSI should be deployed in PC mode, set it to false if CSI should be deployed in PE modetrue
kubeletDirallows overriding the host location of kubelet's internal state/var/lib/kubelet
nodeSelectorAdd nodeSelector to all pods{}
tolerationsAdd tolerations to all pods[]
imagePullPolicySpecify imagePullPolicy for all podsIfNotPresent
maxVolumesPerNodemaximum volumes allowed per node64
controller.replicasNumber of Controllers replicas to deploy.2
controller.nodeSelectorAdd nodeSelector to provisioner pod{}
controller.tolerationsAdd tolerations to provisioner pod[]
node.nodeSelectorAdd nodeSelector to node pods{}
node.tolerationsAdd tolerations to node pods[]
servicemonitor.enabledCreate ServiceMonitor to scrape CSI metricsfalse
servicemonitor.labelsLabels to add to the ServiceMonitor (for match the Prometheus serviceMonitorSelector logic)k8s-app: csi-driver
kubernetesClusterDeploymentTypeTakes values in ["non-bare-metal", "bare-metal"] depending on the type of deploymentnon-bare-metal

Specify each parameter using the --set key=value[,key=value] argument to helm install or provide a a file whit -f value.yaml.

Configuration examples:

Install the driver in the `nt

Deploy ncs-nutanix-csi-storage with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has ncs-nutanix-csi-storage on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartncs-nutanix-csi-storage is pinned at v3.2.0-prod in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply