chore: add external-resizer in deployment

Signed-off-by: ZeroMagic <anthonyliu@zju.edu.cn>
This commit is contained in:
ZeroMagic 2020-02-26 11:43:46 +00:00
parent 1da29ae685
commit d8319ec93e
7 changed files with 122 additions and 2 deletions

View File

@ -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:

View File

@ -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 }}

View File

@ -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

View File

@ -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:

View File

@ -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

View File

@ -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

View File

@ -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}"