From 2c6c09f47524ee940c5ddf713951042ec9d1fd70 Mon Sep 17 00:00:00 2001 From: Steven Crespo Date: Thu, 18 Nov 2021 13:25:14 -0800 Subject: [PATCH] Add csi 2.1.1 --- .../rancher-vsphere-csi/2.1.1/Chart.yaml | 21 ++ .../rancher-vsphere-csi/2.1.1/README.md | 73 +++++++ .../rancher-vsphere-csi/2.1.1/app-readme.md | 21 ++ .../rancher-vsphere-csi/2.1.1/questions.yaml | 91 +++++++++ .../2.1.1/templates/_helpers.tpl | 7 + .../vsphere-csi-controller-deployment.yaml | 180 ++++++++++++++++++ .../vsphere-csi-controller-rbac.yaml | 55 ++++++ .../2.1.1/templates/vsphere-csi-node-ds.yaml | 139 ++++++++++++++ .../2.1.1/templates/vsphere-csi-secret.yaml | 9 + .../templates/vsphere-csi-storageclass.yaml | 16 ++ .../rancher-vsphere-csi/2.1.1/values.yaml | 70 +++++++ 11 files changed, 682 insertions(+) create mode 100755 charts/rancher-vsphere-csi/rancher-vsphere-csi/2.1.1/Chart.yaml create mode 100755 charts/rancher-vsphere-csi/rancher-vsphere-csi/2.1.1/README.md create mode 100755 charts/rancher-vsphere-csi/rancher-vsphere-csi/2.1.1/app-readme.md create mode 100755 charts/rancher-vsphere-csi/rancher-vsphere-csi/2.1.1/questions.yaml create mode 100755 charts/rancher-vsphere-csi/rancher-vsphere-csi/2.1.1/templates/_helpers.tpl create mode 100755 charts/rancher-vsphere-csi/rancher-vsphere-csi/2.1.1/templates/vsphere-csi-controller-deployment.yaml create mode 100755 charts/rancher-vsphere-csi/rancher-vsphere-csi/2.1.1/templates/vsphere-csi-controller-rbac.yaml create mode 100755 charts/rancher-vsphere-csi/rancher-vsphere-csi/2.1.1/templates/vsphere-csi-node-ds.yaml create mode 100755 charts/rancher-vsphere-csi/rancher-vsphere-csi/2.1.1/templates/vsphere-csi-secret.yaml create mode 100755 charts/rancher-vsphere-csi/rancher-vsphere-csi/2.1.1/templates/vsphere-csi-storageclass.yaml create mode 100755 charts/rancher-vsphere-csi/rancher-vsphere-csi/2.1.1/values.yaml diff --git a/charts/rancher-vsphere-csi/rancher-vsphere-csi/2.1.1/Chart.yaml b/charts/rancher-vsphere-csi/rancher-vsphere-csi/2.1.1/Chart.yaml new file mode 100755 index 000000000..2cda783cc --- /dev/null +++ b/charts/rancher-vsphere-csi/rancher-vsphere-csi/2.1.1/Chart.yaml @@ -0,0 +1,21 @@ +annotations: + catalog.cattle.io/certified: rancher + catalog.cattle.io/display-name: vSphere CSI + catalog.cattle.io/namespace: kube-system + catalog.cattle.io/os: linux + catalog.cattle.io/rancher-version: '>= 2.5.0-0 <= 2.5.99-0' + catalog.cattle.io/release-name: vsphere-csi +apiVersion: v1 +appVersion: 2.1.1 +description: vSphere Cloud Storage Interface (CSI) +icon: https://charts.rancher.io/assets/logos/vsphere-csi.svg +keywords: +- infrastructure +kubeVersion: <= 1.19 +maintainers: +- email: caleb@rancher.com + name: Rancher +name: rancher-vsphere-csi +sources: +- https://github.com/kubernetes-sigs/vsphere-csi-driver +version: 2.1.1 diff --git a/charts/rancher-vsphere-csi/rancher-vsphere-csi/2.1.1/README.md b/charts/rancher-vsphere-csi/rancher-vsphere-csi/2.1.1/README.md new file mode 100755 index 000000000..4a749e8ac --- /dev/null +++ b/charts/rancher-vsphere-csi/rancher-vsphere-csi/2.1.1/README.md @@ -0,0 +1,73 @@ +# vSphere Container Storage Interface (CSI) + +[vSphere Container Storage Interface (CSI)](https://github.com/kubernetes-sigs/vsphere-csi-driver/tree/release-2.1/manifests/v2.1.0/vsphere-7.0u1/) is a specification designed to enable persistent storage volume management on Container Orchestrators (COs) such as Kubernetes. The specification allows storage systems to integrate with containerized workloads running on Kubernetes. Using CSI, storage providers, such as VMware, can write and deploy plugins for storage systems in Kubernetes without a need to modify any core Kubernetes code. + +CSI allows volume plugins to be installed on Kubernetes clusters as extensions. Once a CSI compatible volume driver is deployed on a Kubernetes cluster, users can use the CSI to provision, attach, mount, and format the volumes exposed by the CSI driver. + +The CSI driver for vSphere is `csi.vsphere.vmware.com`. + +## Prerequisites + +- vSphere 6.7 U3+ +- Kubernetes v1.14+ +- Out-of-tree vSphere Cloud Provider Interface (CPI) +- A Secret on your Kubernetes cluster that contains vSphere CSI configuration and credentials + +## Installation + +This chart requires a Secret in your Kubernetes cluster that contains the CSI configuration and credentials to connect to the vCenter. You can have the chart generate it for you, or create it yourself and provide the name of the Secret during installation. + +Warning: When the option to generate the Secret is enabled, the credentials are visible in the API to authorized users. If you create the Secret yourself they will not be visible. + +You can create a Secret in one of the following ways: + +### Option 1: Create a Secret using the Rancher UI + +Go to your cluster's project (Same project you will be installing the chart) > Resources > Secrets > Add Secret. +```yaml +# Example of data required in the Secret +# The csi-vsphere.conf key name is required, otherwise the installation will fail +csi-vsphere.conf: | + [Global] + cluster-id = "" + user = "" + password = "" + port = "" + insecure-flag = "" + + [VirtualCenter ""] + datacenters = ", , ..." +``` +More information on CSI vSphere configuration [here](https://vsphere-csi-driver.sigs.k8s.io/driver-deployment/installation.html#create_k8s_secret). + +### Option 2: Create a Secret using kubectl + +Replace placeholders with actual values, and execute the following: +```bash +# The csi-vsphere.conf key name is required, otherwise the installation will fail +cat < + namespace: +stringData: + csi-vsphere.conf: | + [Global] + cluster-id = "" + user = "" + password = "" + port = "" + insecure-flag = "" + + [VirtualCenter ""] + datacenters = ", , ..." +EOF +``` + +More information on managing Secrets using kubectl [here](https://kubernetes.io/docs/tasks/configmap-secret/managing-secret-using-kubectl/). + +## Migration + +The CSI migration feature is only available for vSphere 7.0 U1. diff --git a/charts/rancher-vsphere-csi/rancher-vsphere-csi/2.1.1/app-readme.md b/charts/rancher-vsphere-csi/rancher-vsphere-csi/2.1.1/app-readme.md new file mode 100755 index 000000000..ebeb4cb9e --- /dev/null +++ b/charts/rancher-vsphere-csi/rancher-vsphere-csi/2.1.1/app-readme.md @@ -0,0 +1,21 @@ +# vSphere Container Storage Interface (CSI) + +[vSphere Container Storage Interface (CSI)](https://github.com/kubernetes-sigs/vsphere-csi-driver/tree/release-2.1/manifests/v2.1.0/vsphere-7.0u1/) is a specification designed to enable persistent storage volume management on Container Orchestrators (COs) such as Kubernetes. The specification allows storage systems to integrate with containerized workloads running on Kubernetes. Using CSI, storage providers, such as VMware, can write and deploy plugins for storage systems in Kubernetes without a need to modify any core Kubernetes code. + +CSI allows volume plugins to be installed on Kubernetes clusters as extensions. Once a CSI compatible volume driver is deployed on a Kubernetes cluster, users can use the CSI to provision, attach, mount, and format the volumes exposed by the CSI driver. + +The CSI driver for vSphere is `csi.vsphere.vmware.com`. + +## Support Matrix + +| Rancher vSphere CSI | Minimum Kubernetes Release | Maximum Kubernetes Release | +| ------------------- | -------------------------- | -------------------------- | +| 2.1.1 | | 1.19.x | +| 2.1.000 | | 1.19.x | + +## Prerequisites + +- vSphere 6.7 U3+ +- Kubernetes v1.14+ +- Out-of-tree vSphere Cloud Provider Interface (CPI) +- A Secret on your Kubernetes cluster that contains vSphere CSI configuration and credentials (Refer to `README` or `Detailed Descriptions`) diff --git a/charts/rancher-vsphere-csi/rancher-vsphere-csi/2.1.1/questions.yaml b/charts/rancher-vsphere-csi/rancher-vsphere-csi/2.1.1/questions.yaml new file mode 100755 index 000000000..114ea419f --- /dev/null +++ b/charts/rancher-vsphere-csi/rancher-vsphere-csi/2.1.1/questions.yaml @@ -0,0 +1,91 @@ +questions: + - variable: vCenter.configSecret.generate + label: Generate CSI vSphere Config Secret + description: Generates a Secret that contains a CSI vSphere config and credentials (If the option to generate it is enabled, credentials will be visible in the API to authorized users) + type: boolean + default: true + required: true + group: Configuration + show_subquestion_if: true + subquestions: + - variable: vCenter.host + label: vCenter Host + description: IP address or FQDN of the vCenter + type: string + group: Configuration + + - variable: vCenter.datacenters + description: Comma-separated list of paths to data centers. E.g ", , ..." + label: Data Centers + type: string + group: Configuration + + - variable: vCenter.username + label: Username + description: Username for vCenter + type: string + group: Configuration + + - variable: vCenter.password + label: Password + description: Password for vCenter + type: password + group: Configuration + + - variable: vCenter.configSecret.name + label: CSI vSphere Config Secret Name + description: Name of the Secret that contains a CSI vSphere config and credentials (Will not be visible in the API. More info in the README) + type: string + group: Configuration + show_if: "vCenter.configSecret.generate=false" + + - variable: csiMigration.enabled + label: Enable CSI Migration + description: Enable migration of volumes provisioned by in-tree vSphere provider to CSI (Available for vSphere 7.0 U1+ only) + type: boolean + default: false + group: Migration + + - variable: csiController.csiResizer.enabled + label: Enable CSI Volume Resizer + description: This feature is available for vSphere 7.0 U1+ only + type: boolean + default: false + group: Storage + + - variable: storageClass.enabled + default: true + label: Create Storage Class + description: Create a storageClass with the vSphere CSI provisioner + type: boolean + required: true + show_subquestion_if: true + group: Storage + subquestions: + - variable: storageClass.name + label: Storage Class Name + default: "vsphere-csi-sc" + type: string + + - variable: storageClass.isDefault + label: Default Storage Class + description: Set the Storage Class as the default + default: true + type: boolean + + - variable: storageClass.storagePolicyName + label: Storage Policy Name + description: Name of the Storage Policy created in vCenter + type: string + + - variable: storageClass.datastoreURL + label: Data Store URL + description: URL of the data store to use for new volumes (If unspecified, any data store that matches the request will be selected). + type: string + + - variable: csiNode.prefixPath + label: Prefix Path for `/var/lib/kubelet` + description: For some operating systems including RancherOS, RKE prefixes `/var/lib/kubelet` with `/opt/rke`. Add the prefix path of the location of /var/lib/kubelet + type: string + default: "" + group: Node Configuration diff --git a/charts/rancher-vsphere-csi/rancher-vsphere-csi/2.1.1/templates/_helpers.tpl b/charts/rancher-vsphere-csi/rancher-vsphere-csi/2.1.1/templates/_helpers.tpl new file mode 100755 index 000000000..7a6c36abe --- /dev/null +++ b/charts/rancher-vsphere-csi/rancher-vsphere-csi/2.1.1/templates/_helpers.tpl @@ -0,0 +1,7 @@ +{{- define "system_default_registry" -}} +{{- if .Values.global.cattle.systemDefaultRegistry -}} +{{- printf "%s/" .Values.global.cattle.systemDefaultRegistry -}} +{{- else -}} +{{- "" -}} +{{- end -}} +{{- end -}} diff --git a/charts/rancher-vsphere-csi/rancher-vsphere-csi/2.1.1/templates/vsphere-csi-controller-deployment.yaml b/charts/rancher-vsphere-csi/rancher-vsphere-csi/2.1.1/templates/vsphere-csi-controller-deployment.yaml new file mode 100755 index 000000000..773b8d253 --- /dev/null +++ b/charts/rancher-vsphere-csi/rancher-vsphere-csi/2.1.1/templates/vsphere-csi-controller-deployment.yaml @@ -0,0 +1,180 @@ +# Source: https://github.com/kubernetes-sigs/vsphere-csi-driver +kind: Deployment +apiVersion: apps/v1 +metadata: + name: vsphere-csi-controller + namespace: {{ .Release.Namespace }} +spec: + replicas: 1 + selector: + matchLabels: + app: vsphere-csi-controller + template: + metadata: + labels: + app: vsphere-csi-controller + role: vsphere-csi + spec: + serviceAccountName: vsphere-csi-controller + nodeSelector: + {{- if .Values.csiController.nodeSelector }} + {{- with .Values.csiController.nodeSelector }} + {{- toYaml . | nindent 8 }} + {{- end }} + {{- else }} + node-role.kubernetes.io/controlplane: "true" + {{- end }} + tolerations: + - operator: "Exists" + effect: NoSchedule + - operator: "Exists" + effect: NoExecute + dnsPolicy: "Default" + containers: + - name: csi-attacher + image: "{{ template "system_default_registry" . }}{{ .Values.csiController.image.csiAttacher.repository }}:{{ .Values.csiController.image.csiAttacher.tag }}" + args: + - "--v=4" + - "--timeout=300s" + - "--csi-address=$(ADDRESS)" + - "--leader-election" + env: + - name: ADDRESS + value: /csi/csi.sock + volumeMounts: + - mountPath: /csi + name: socket-dir +{{- if .Values.csiController.csiResizer.enabled }} + - name: csi-resizer + image: "{{ template "system_default_registry" . }}{{ .Values.csiController.image.csiResizer.repository }}:{{ .Values.csiController.image.csiResizer.tag }}" + args: + - "--v=4" + - "--timeout=300s" + - "--csi-address=$(ADDRESS)" + - "--leader-election" + env: + - name: ADDRESS + value: /csi/csi.sock + volumeMounts: + - mountPath: /csi + name: socket-dir +{{- end }} + - name: vsphere-csi-controller + image: "{{ template "system_default_registry" . }}{{ .Values.csiController.image.repository }}:{{ .Values.csiController.image.tag }}" + args: + - "--fss-name=internal-feature-states.csi.vsphere.vmware.com" + - "--fss-namespace=$(CSI_NAMESPACE)" + imagePullPolicy: "Always" + env: + - name: CSI_ENDPOINT + value: unix:///csi/csi.sock + - name: X_CSI_MODE + value: "controller" + - name: VSPHERE_CSI_CONFIG + value: "/etc/cloud/csi-vsphere.conf" + - name: LOGGER_LEVEL + value: "PRODUCTION" # Options: DEVELOPMENT, PRODUCTION + - name: INCLUSTER_CLIENT_QPS + value: "100" + - name: INCLUSTER_CLIENT_BURST + value: "100" + - name: CSI_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + volumeMounts: + - mountPath: /etc/cloud + name: vsphere-config-volume + readOnly: true + - mountPath: /csi + name: socket-dir + ports: + - name: healthz + containerPort: 9808 + protocol: TCP + livenessProbe: + httpGet: + path: /healthz + port: healthz + initialDelaySeconds: 10 + timeoutSeconds: 3 + periodSeconds: 5 + failureThreshold: 3 + - name: liveness-probe + image: "{{ template "system_default_registry" . }}{{ .Values.csiController.image.livenessProbe.repository }}:{{ .Values.csiController.image.livenessProbe.tag }}" + args: + - "--v=4" + - "--csi-address=/csi/csi.sock" + volumeMounts: + - name: socket-dir + mountPath: /csi + - name: vsphere-syncer + image: "{{ template "system_default_registry" . }}{{ .Values.csiController.image.vsphereSyncer.repository }}:{{ .Values.csiController.image.vsphereSyncer.tag }}" + args: + - "--leader-election" + - "--fss-name=internal-feature-states.csi.vsphere.vmware.com" + - "--fss-namespace=$(CSI_NAMESPACE)" + imagePullPolicy: "Always" + env: + - name: FULL_SYNC_INTERVAL_MINUTES + value: "30" + - name: VSPHERE_CSI_CONFIG + value: "/etc/cloud/csi-vsphere.conf" + - name: LOGGER_LEVEL + value: "PRODUCTION" # Options: DEVELOPMENT, PRODUCTION + - name: INCLUSTER_CLIENT_QPS + value: "100" + - name: INCLUSTER_CLIENT_BURST + value: "100" + - name: CSI_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + volumeMounts: + - mountPath: /etc/cloud + name: vsphere-config-volume + readOnly: true + - name: csi-provisioner + image: "{{ template "system_default_registry" . }}{{ .Values.csiController.image.csiProvisioner.repository }}:{{ .Values.csiController.image.csiProvisioner.tag }}" + args: + - "--v=4" + - "--timeout=300s" + - "--csi-address=$(ADDRESS)" + - "--leader-election" + - "--default-fstype=ext4" + # needed only for topology aware setup + #- "--feature-gates=Topology=true" + #- "--strict-topology" + env: + - name: ADDRESS + value: /csi/csi.sock + volumeMounts: + - mountPath: /csi + name: socket-dir + volumes: + - name: vsphere-config-volume + secret: + secretName: {{ .Values.vCenter.configSecret.name }} + - name: socket-dir + emptyDir: {} +--- +apiVersion: v1 +data: + "csi-migration": {{ .Values.csiMigration.enabled | quote }} +kind: ConfigMap +metadata: + name: internal-feature-states.csi.vsphere.vmware.com + namespace: {{ .Release.Namespace }} +--- +{{- if semverCompare "<1.18.0-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: storage.k8s.io/v1beta1 # For k8s 1.17 or lower use storage.k8s.io/v1beta1 +{{- else }} +apiVersion: storage.k8s.io/v1 +{{- end }} +kind: CSIDriver +metadata: + name: csi.vsphere.vmware.com +spec: + attachRequired: true + podInfoOnMount: false +--- diff --git a/charts/rancher-vsphere-csi/rancher-vsphere-csi/2.1.1/templates/vsphere-csi-controller-rbac.yaml b/charts/rancher-vsphere-csi/rancher-vsphere-csi/2.1.1/templates/vsphere-csi-controller-rbac.yaml new file mode 100755 index 000000000..819415e35 --- /dev/null +++ b/charts/rancher-vsphere-csi/rancher-vsphere-csi/2.1.1/templates/vsphere-csi-controller-rbac.yaml @@ -0,0 +1,55 @@ +# Source: https://github.com/kubernetes-sigs/vsphere-csi-driver +kind: ServiceAccount +apiVersion: v1 +metadata: + name: vsphere-csi-controller + namespace: {{ .Release.Namespace }} +--- +kind: ClusterRole +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: vsphere-csi-controller-role +rules: + - apiGroups: [""] + resources: ["nodes", "persistentvolumeclaims", "pods", "configmaps"] + verbs: ["get", "list", "watch"] + - apiGroups: [""] + resources: ["persistentvolumeclaims/status"] + verbs: ["patch"] + - apiGroups: [""] + resources: ["persistentvolumes"] + verbs: ["get", "list", "watch", "create", "update", "delete", "patch"] + - apiGroups: [""] + resources: ["events"] + verbs: ["get", "list", "watch", "create", "update", "patch"] + - apiGroups: ["coordination.k8s.io"] + resources: ["leases"] + verbs: ["get", "watch", "list", "delete", "update", "create"] + - apiGroups: ["storage.k8s.io"] + resources: ["storageclasses", "csinodes"] + verbs: ["get", "list", "watch"] + - apiGroups: ["storage.k8s.io"] + resources: ["volumeattachments"] + verbs: ["get", "list", "watch", "patch"] + - apiGroups: ["cns.vmware.com"] + resources: ["cnsvspherevolumemigrations"] + verbs: ["create", "get", "list", "watch", "update", "delete"] + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "create"] + - apiGroups: ["storage.k8s.io"] + resources: ["volumeattachments/status"] + verbs: ["patch"] +--- +kind: ClusterRoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: vsphere-csi-controller-binding +subjects: + - kind: ServiceAccount + name: vsphere-csi-controller + namespace: {{ .Release.Namespace }} +roleRef: + kind: ClusterRole + name: vsphere-csi-controller-role + apiGroup: rbac.authorization.k8s.io diff --git a/charts/rancher-vsphere-csi/rancher-vsphere-csi/2.1.1/templates/vsphere-csi-node-ds.yaml b/charts/rancher-vsphere-csi/rancher-vsphere-csi/2.1.1/templates/vsphere-csi-node-ds.yaml new file mode 100755 index 000000000..127d41ecb --- /dev/null +++ b/charts/rancher-vsphere-csi/rancher-vsphere-csi/2.1.1/templates/vsphere-csi-node-ds.yaml @@ -0,0 +1,139 @@ +# Source: https://github.com/kubernetes-sigs/vsphere-csi-driver +kind: DaemonSet +apiVersion: apps/v1 +metadata: + name: vsphere-csi-node + namespace: {{ .Release.Namespace }} +spec: + selector: + matchLabels: + app: vsphere-csi-node + updateStrategy: + type: "RollingUpdate" + rollingUpdate: + maxUnavailable: 1 + template: + metadata: + labels: + app: vsphere-csi-node + role: vsphere-csi + spec: + dnsPolicy: "Default" + containers: + - name: node-driver-registrar + image: "{{ template "system_default_registry" . }}{{ .Values.csiNode.image.nodeDriverRegistrar.repository }}:{{ .Values.csiNode.image.nodeDriverRegistrar.tag }}" + args: + - "--v=5" + - "--csi-address=$(ADDRESS)" + - "--kubelet-registration-path=$(DRIVER_REG_SOCK_PATH)" + - "--health-port=9809" + env: + - name: ADDRESS + value: /csi/csi.sock + - name: DRIVER_REG_SOCK_PATH + value: {{ .Values.csiNode.prefixPath }}/var/lib/kubelet/plugins/csi.vsphere.vmware.com/csi.sock + securityContext: + privileged: true + volumeMounts: + - name: plugin-dir + mountPath: /csi + - name: registration-dir + mountPath: /registration + ports: + - containerPort: 9809 + name: healthz + livenessProbe: + httpGet: + path: /healthz + port: healthz + initialDelaySeconds: 5 + timeoutSeconds: 5 + - name: vsphere-csi-node + image: "{{ template "system_default_registry" . }}{{ .Values.csiNode.image.repository }}:{{ .Values.csiNode.image.tag }}" + args: + - "--fss-name=internal-feature-states.csi.vsphere.vmware.com" + - "--fss-namespace=$(CSI_NAMESPACE)" + imagePullPolicy: "Always" + env: + - name: NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + - name: CSI_ENDPOINT + value: unix:///csi/csi.sock + - name: X_CSI_MODE + value: "node" + - name: X_CSI_SPEC_REQ_VALIDATION + value: "false" + # needed only for topology aware setups + #- name: VSPHERE_CSI_CONFIG + # value: "/etc/cloud/csi-vsphere.conf" # here csi-vsphere.conf is the name of the file used for creating secret using "--from-file" flag + - name: X_CSI_DEBUG + value: "true" + - name: LOGGER_LEVEL + value: "PRODUCTION" # Options: DEVELOPMENT, PRODUCTION + - name: CSI_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + securityContext: + privileged: true + capabilities: + add: ["SYS_ADMIN"] + allowPrivilegeEscalation: true + volumeMounts: + # needed only for topology aware setups + #- name: vsphere-config-volume + # mountPath: /etc/cloud + # readOnly: true + - name: plugin-dir + mountPath: /csi + - name: pods-mount-dir + mountPath: {{ .Values.csiNode.prefixPath }}/var/lib/kubelet + # needed so that any mounts setup inside this container are + # propagated back to the host machine. + mountPropagation: "Bidirectional" + - name: device-dir + mountPath: /dev + ports: + - containerPort: 9808 + name: healthz + livenessProbe: + httpGet: + path: /healthz + port: healthz + initialDelaySeconds: 10 + timeoutSeconds: 5 + - name: liveness-probe + image: "{{ template "system_default_registry" . }}{{ .Values.csiNode.image.livenessProbe.repository }}:{{ .Values.csiNode.image.livenessProbe.tag }}" + args: + - "--v=4" + - "--csi-address=/csi/csi.sock" + volumeMounts: + - name: plugin-dir + mountPath: /csi + volumes: + # needed only for topology aware setups + #- name: vsphere-config-volume + # secret: + # secretName: vsphere-config-secret + - name: registration-dir + hostPath: + path: {{ .Values.csiNode.prefixPath }}/var/lib/kubelet/plugins_registry + type: Directory + - name: plugin-dir + hostPath: + path: {{ .Values.csiNode.prefixPath }}/var/lib/kubelet/plugins/csi.vsphere.vmware.com + type: DirectoryOrCreate + - name: pods-mount-dir + hostPath: + path: {{ .Values.csiNode.prefixPath }}/var/lib/kubelet + type: Directory + - name: device-dir + hostPath: + path: /dev + tolerations: + - effect: NoExecute + operator: Exists + - effect: NoSchedule + operator: Exists diff --git a/charts/rancher-vsphere-csi/rancher-vsphere-csi/2.1.1/templates/vsphere-csi-secret.yaml b/charts/rancher-vsphere-csi/rancher-vsphere-csi/2.1.1/templates/vsphere-csi-secret.yaml new file mode 100755 index 000000000..2a8c53025 --- /dev/null +++ b/charts/rancher-vsphere-csi/rancher-vsphere-csi/2.1.1/templates/vsphere-csi-secret.yaml @@ -0,0 +1,9 @@ +{{- if .Values.vCenter.configSecret.generate -}} +apiVersion: v1 +kind: Secret +metadata: + name: {{ .Values.vCenter.configSecret.name }} + namespace: {{ .Release.Namespace }} +data: + csi-vsphere.conf: {{ tpl .Values.vCenter.configSecret.configTemplate . | b64enc | quote }} +{{- end -}} diff --git a/charts/rancher-vsphere-csi/rancher-vsphere-csi/2.1.1/templates/vsphere-csi-storageclass.yaml b/charts/rancher-vsphere-csi/rancher-vsphere-csi/2.1.1/templates/vsphere-csi-storageclass.yaml new file mode 100755 index 000000000..01c07e4cb --- /dev/null +++ b/charts/rancher-vsphere-csi/rancher-vsphere-csi/2.1.1/templates/vsphere-csi-storageclass.yaml @@ -0,0 +1,16 @@ +{{- if .Values.storageClass.enabled -}} +apiVersion: storage.k8s.io/v1 +kind: StorageClass +metadata: + name: {{ .Values.storageClass.name | quote }} + annotations: + storageclass.kubernetes.io/is-default-class: {{ .Values.storageClass.isDefault | quote }} +provisioner: csi.vsphere.vmware.com +parameters: + {{- if .Values.storageClass.datastoreURL }} + datastoreURL: {{ .Values.storageClass.datastoreURL | quote }} + {{- end }} + {{- if .Values.storageClass.storagePolicyName }} + storagepolicyname: {{ .Values.storageClass.storagePolicyName | quote }} + {{- end }} +{{- end -}} diff --git a/charts/rancher-vsphere-csi/rancher-vsphere-csi/2.1.1/values.yaml b/charts/rancher-vsphere-csi/rancher-vsphere-csi/2.1.1/values.yaml new file mode 100755 index 000000000..3e2b3a0c3 --- /dev/null +++ b/charts/rancher-vsphere-csi/rancher-vsphere-csi/2.1.1/values.yaml @@ -0,0 +1,70 @@ +vCenter: + host: "" + port: 443 + insecureFlag: "1" + clusterId: "" + datacenters: "" + username: "" + password: "" + configSecret: + name: "vsphere-config-secret" + generate: true + configTemplate: | + [Global] + cluster-id = {{ required ".Values.vCenter.clusterId must be provided" (default .Values.vCenter.clusterId .Values.global.cattle.clusterId) | quote }} + user = {{ .Values.vCenter.username | quote }} + password = {{ .Values.vCenter.password | quote }} + port = {{ .Values.vCenter.port | quote }} + insecure-flag = {{ .Values.vCenter.insecureFlag | quote }} + + [VirtualCenter {{ .Values.vCenter.host | quote }}] + datacenters = {{ .Values.vCenter.datacenters | quote }} + +csiController: + csiResizer: + enabled: false + image: + repository: rancher/mirrored-cloud-provider-vsphere-csi-release-driver + tag: v2.1.0 + csiAttacher: + repository: rancher/mirrored-k8scsi-csi-attacher + tag: v3.0.0 + csiResizer: + repository: rancher/mirrored-k8scsi-csi-resizer + tag: v1.0.0 + livenessProbe: + repository: rancher/mirrored-k8scsi-livenessprobe + tag: v2.1.0 + vsphereSyncer: + repository: rancher/mirrored-cloud-provider-vsphere-csi-release-syncer + tag: v2.1.0 + csiProvisioner: + repository: rancher/mirrored-k8scsi-csi-provisioner + tag: v2.0.0 + nodeSelector: {} + +csiMigration: + enabled: false + +csiNode: + prefixPath: "" + image: + repository: rancher/mirrored-cloud-provider-vsphere-csi-release-driver + tag: v2.1.0 + nodeDriverRegistrar: + repository: rancher/mirrored-k8scsi-csi-node-driver-registrar + tag: v2.0.1 + livenessProbe: + repository: rancher/mirrored-k8scsi-livenessprobe + tag: v2.1.0 + +storageClass: + enabled: true + name: "vsphere-csi-sc" + isDefault: true + storagePolicyName: "" + datastoreURL: "" + +global: + cattle: + systemDefaultRegistry: ""