diff --git a/charts/latest/azurefile-csi-driver/templates/csi-azurefile-controller.yaml b/charts/latest/azurefile-csi-driver/templates/csi-azurefile-controller.yaml index fcadd2d14..edbd03089 100644 --- a/charts/latest/azurefile-csi-driver/templates/csi-azurefile-controller.yaml +++ b/charts/latest/azurefile-csi-driver/templates/csi-azurefile-controller.yaml @@ -103,6 +103,25 @@ spec: requests: cpu: 10m memory: 20Mi + - name: csi-resizer + image: "{{ .Values.image.csiResizer.repository }}:{{ .Values.image.csiResizer.tag }}" + args: + - "-csi-address=$(ADDRESS)" + - "-v=5" + - "-leader-election" + env: + - name: ADDRESS + value: /csi/csi.sock + volumeMounts: + - name: socket-dir + mountPath: /csi + resources: + limits: + cpu: 200m + memory: 200Mi + requests: + cpu: 10m + memory: 20Mi - name: liveness-probe image: "{{ .Values.image.livenessProbe.repository }}:{{ .Values.image.livenessProbe.tag }}" args: diff --git a/charts/latest/azurefile-csi-driver/templates/rbac-csi-azurefile-controller.yaml b/charts/latest/azurefile-csi-driver/templates/rbac-csi-azurefile-controller.yaml index 32aca54d7..4a52b99e8 100644 --- a/charts/latest/azurefile-csi-driver/templates/rbac-csi-azurefile-controller.yaml +++ b/charts/latest/azurefile-csi-driver/templates/rbac-csi-azurefile-controller.yaml @@ -172,4 +172,43 @@ roleRef: kind: ClusterRole name: azurefile-external-snapshotter-role apiGroup: rbac.authorization.k8s.io + +--- +kind: ClusterRole +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: azurefile-external-resizer-role + namespace: {{ .Release.Namespace }} +{{ include "azurefile.labels" . | indent 2 }} +rules: + - apiGroups: [""] + resources: ["persistentvolumes"] + verbs: ["get", "list", "watch", "update", "patch"] + - apiGroups: [""] + resources: ["persistentvolumeclaims"] + verbs: ["get", "list", "watch"] + - apiGroups: [""] + resources: ["persistentvolumeclaims/status"] + verbs: ["update", "patch"] + - apiGroups: [""] + resources: ["events"] + verbs: ["list", "watch", "create", "update", "patch"] + - apiGroups: ["coordination.k8s.io"] + resources: ["leases"] + verbs: ["get", "list", "watch", "create", "update", "patch"] +--- +kind: ClusterRoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: azurefile-csi-resizer-role + namespace: {{ .Release.Namespace }} +{{ include "azurefile.labels" . | indent 2 }} +subjects: + - kind: ServiceAccount + name: csi-azurefile-controller-sa + namespace: {{ .Release.Namespace }} +roleRef: + kind: ClusterRole + name: azurefile-external-resizer-role + apiGroup: rbac.authorization.k8s.io {{ end }} diff --git a/charts/latest/azurefile-csi-driver/values.yaml b/charts/latest/azurefile-csi-driver/values.yaml index 81f7d938e..35964fd15 100644 --- a/charts/latest/azurefile-csi-driver/values.yaml +++ b/charts/latest/azurefile-csi-driver/values.yaml @@ -19,6 +19,10 @@ image: repository: mcr.microsoft.com/oss/kubernetes-csi/csi-snapshotter tag: v1.1.0 pullPolicy: Always + csiResizer: + repository: mcr.microsoft.com/oss/kubernetes-csi/csi-resizer + tag: v0.3.0 + pullPolicy: Always livenessProbe: repository: mcr.microsoft.com/oss/kubernetes-csi/livenessprobe tag: v1.1.0 diff --git a/deploy/csi-azurefile-controller.yaml b/deploy/csi-azurefile-controller.yaml index feaa489c1..2499ff046 100644 --- a/deploy/csi-azurefile-controller.yaml +++ b/deploy/csi-azurefile-controller.yaml @@ -103,6 +103,25 @@ spec: requests: cpu: 10m memory: 20Mi + - name: csi-resizer + image: mcr.microsoft.com/oss/kubernetes-csi/csi-resizer:v0.3.0 + args: + - "-csi-address=$(ADDRESS)" + - "-v=5" + - "-leader-election" + env: + - name: ADDRESS + value: /csi/csi.sock + volumeMounts: + - name: socket-dir + mountPath: /csi + resources: + limits: + cpu: 200m + memory: 200Mi + requests: + cpu: 10m + memory: 20Mi - name: liveness-probe image: mcr.microsoft.com/oss/kubernetes-csi/livenessprobe:v1.1.0 args: diff --git a/deploy/example/storageclass-azurefile-csi.yaml b/deploy/example/storageclass-azurefile-csi.yaml index 0f1eb63ea..2cc0fb57b 100644 --- a/deploy/example/storageclass-azurefile-csi.yaml +++ b/deploy/example/storageclass-azurefile-csi.yaml @@ -4,6 +4,7 @@ kind: StorageClass metadata: name: file.csi.azure.com provisioner: file.csi.azure.com +allowVolumeExpansion: true parameters: skuName: Standard_LRS # available values: Standard_LRS, Standard_GRS, Standard_RAGRS reclaimPolicy: Delete diff --git a/deploy/rbac-csi-azurefile-controller.yaml b/deploy/rbac-csi-azurefile-controller.yaml index 1ddf5e206..44cec70b4 100644 --- a/deploy/rbac-csi-azurefile-controller.yaml +++ b/deploy/rbac-csi-azurefile-controller.yaml @@ -168,3 +168,37 @@ roleRef: kind: ClusterRole name: azurefile-external-snapshotter-role apiGroup: rbac.authorization.k8s.io + +--- + +kind: ClusterRole +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: azurefile-external-resizer-role +rules: + - apiGroups: [""] + resources: ["persistentvolumes"] + verbs: ["get", "list", "watch", "update", "patch"] + - apiGroups: [""] + resources: ["persistentvolumeclaims"] + verbs: ["get", "list", "watch"] + - apiGroups: [""] + resources: ["persistentvolumeclaims/status"] + verbs: ["update", "patch"] + - apiGroups: [""] + resources: ["events"] + verbs: ["list", "watch", "create", "update", "patch"] + +--- +kind: ClusterRoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: azurefile-csi-resizer-role +subjects: + - kind: ServiceAccount + name: csi-azurefile-controller-sa + namespace: kube-system +roleRef: + kind: ClusterRole + name: azurefile-external-resizer-role + apiGroup: rbac.authorization.k8s.io diff --git a/hack/verify-helm-chart.sh b/hack/verify-helm-chart.sh index 4cbe4aeb8..a31a23630 100755 --- a/hack/verify-helm-chart.sh +++ b/hack/verify-helm-chart.sh @@ -45,8 +45,9 @@ expected_csi_provisioner_image="$(cat ${PKG_ROOT}/deploy/csi-azurefile-controlle expected_csi_attacher_image="$(cat ${PKG_ROOT}/deploy/csi-azurefile-controller.yaml | yq -r .spec.template.spec.containers[1].image | head -n 1)" expected_cluster_driver_registrar_image="$(cat ${PKG_ROOT}/deploy/csi-azurefile-controller.yaml | yq -r .spec.template.spec.containers[2].image | head -n 1)" expected_csi_snapshotter_image="$(cat ${PKG_ROOT}/deploy/csi-azurefile-controller.yaml | yq -r .spec.template.spec.containers[3].image | head -n 1)" -expected_liveness_probe_image="$(cat ${PKG_ROOT}/deploy/csi-azurefile-controller.yaml | yq -r .spec.template.spec.containers[4].image | head -n 1)" -expected_azurefile_image="$(cat ${PKG_ROOT}/deploy/csi-azurefile-controller.yaml | yq -r .spec.template.spec.containers[5].image | head -n 1)" +expected_csi_resizer_image="$(cat ${PKG_ROOT}/deploy/csi-azurefile-controller.yaml | yq -r .spec.template.spec.containers[4].image | head -n 1)" +expected_liveness_probe_image="$(cat ${PKG_ROOT}/deploy/csi-azurefile-controller.yaml | yq -r .spec.template.spec.containers[5].image | head -n 1)" +expected_azurefile_image="$(cat ${PKG_ROOT}/deploy/csi-azurefile-controller.yaml | yq -r .spec.template.spec.containers[6].image | head -n 1)" csi_provisioner_image="$(get_image_from_helm_chart "csiProvisioner")" validate_image "${expected_csi_provisioner_image}" "${csi_provisioner_image}" @@ -60,6 +61,9 @@ validate_image "${expected_cluster_driver_registrar_image}" "${cluster_driver_re csi_snapshotter_image="$(get_image_from_helm_chart "csiSnapshotter")" validate_image "${expected_csi_snapshotter_image}" "${csi_snapshotter_image}" +csi_resizer_image="$(get_image_from_helm_chart "csiResizer")" +validate_image "${expected_csi_resizer_image}" "${csi_resizer_image}" + liveness_probe_image="$(get_image_from_helm_chart "livenessProbe")" validate_image "${expected_liveness_probe_image}" "${liveness_probe_image}"