From 5db6fcf8dee3c04833d45503f25f63514119785c Mon Sep 17 00:00:00 2001 From: Christophe Jauffret Date: Thu, 7 Dec 2023 15:37:40 +0100 Subject: [PATCH] add files-key support and fix cr --- charts/nutanix-csi-storage/README.md | 3 +++ charts/nutanix-csi-storage/templates/ntnx-sc.yaml | 4 ++-- charts/nutanix-csi-storage/templates/ntnx-secret.yaml | 6 ++++++ charts/nutanix-csi-storage/values.yaml | 6 ++++++ 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/charts/nutanix-csi-storage/README.md b/charts/nutanix-csi-storage/README.md index 4713e00..4a97a52 100644 --- a/charts/nutanix-csi-storage/README.md +++ b/charts/nutanix-csi-storage/README.md @@ -150,6 +150,9 @@ The following table lists the configurable parameters of the Nutanix-CSI chart a | `filePath` | Path of the NFS share | | | `fileServerName` | Name of the Nutanix File Server (As seen in the Prism Interface) | | | `dynamicFileSquashType` | Squash-type for dynamic files (none, root-squash, all-squash) | `root-squash` | +| `filesKey.endpoint` | FileServer FQDN or FileServer IP (used for snapshot feature) | | +| `filesKey.username` | FileServer REST API Username (used for snapshot feature) | | +| `filesKey.password` | FileServer REST API Password (used for snapshot feature) | | | `kubeletDir` | allows overriding the host location of kubelet's internal state | `/var/lib/kubelet` | | `nodeSelector` | Add nodeSelector to all pods | `{}` | | `tolerations` | Add tolerations to all pods | `[]` | diff --git a/charts/nutanix-csi-storage/templates/ntnx-sc.yaml b/charts/nutanix-csi-storage/templates/ntnx-sc.yaml index a580a78..3b8280d 100644 --- a/charts/nutanix-csi-storage/templates/ntnx-sc.yaml +++ b/charts/nutanix-csi-storage/templates/ntnx-sc.yaml @@ -50,7 +50,7 @@ driver: {{ include "nutanix-csi-storage.drivername" . }} parameters: storageType: NutanixVolumes deletionPolicy: {{ .Values.volumeSnapshotClassRetention}} -{{- end }} +{{ end }} {{- if eq .Values.fileClass true }} @@ -79,7 +79,7 @@ parameters: nfsPath: {{ .Values.filePath }} allowVolumeExpansion: true reclaimPolicy: {{ .Values.fileClassRetention }} -{{- end }} +{{ end }} {{- if eq .Values.dynamicFileClass true }} diff --git a/charts/nutanix-csi-storage/templates/ntnx-secret.yaml b/charts/nutanix-csi-storage/templates/ntnx-secret.yaml index a6c8388..cacbc63 100644 --- a/charts/nutanix-csi-storage/templates/ntnx-secret.yaml +++ b/charts/nutanix-csi-storage/templates/ntnx-secret.yaml @@ -15,6 +15,12 @@ data: # base64 encoded prism-ip:prism-port:admin:password. # E.g.: echo -n "10.83.0.91:9440:admin:mypassword" | base64 key: {{ printf "%s:9440:%s:%s" .Values.prismEndPoint .Values.username .Values.password | b64enc}} +{{- if .Values.filesKey }} +{{- $filesUsername := .Values.filesKey.username | required "files username is required to create files-key." }} +{{- $filesPassword := .Values.filesKey.password | required "files password is required to create files-key." }} +{{- $filesEndPoint := .Values.filesKey.endpoint | required "files endpoint is required to create files-key." }} + files-key: {{ printf "%s:%s:%s" .Values.filesKey.endpoint .Values.filesKey.username .Values.filesKey.password | b64enc }} +{{ end }} {{- end }} {{- if eq .Values.createPrismCentralSecret true }} diff --git a/charts/nutanix-csi-storage/values.yaml b/charts/nutanix-csi-storage/values.yaml index 150d5e0..ec31007 100644 --- a/charts/nutanix-csi-storage/values.yaml +++ b/charts/nutanix-csi-storage/values.yaml @@ -132,6 +132,12 @@ networkSegmentation: false # Values are: none, root-squash, all-squash. Default is root-squash dynamicFileSquashType: root-squash +## Files key to use Snapshot feature +filesKey: + # endpoint: FileServer FQDN or FileServer IP + # username: REST API Username + # password: REST API Password + # Volume metrics and CSI operations metrics configuration #