Skip to content

Commit 4a364ef

Browse files
committed
Additional Controller Deployment features
1 parent cb9d97d commit 4a364ef

File tree

2 files changed

+36
-2
lines changed

2 files changed

+36
-2
lines changed

charts/aws-efs-csi-driver/templates/controller-deployment.yaml

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ metadata:
66
name: efs-csi-controller
77
labels:
88
app.kubernetes.io/name: {{ include "aws-efs-csi-driver.name" . }}
9+
{{- with .Values.controller.additionalLabels }}
10+
{{ toYaml . | nindent 4 }}
11+
{{- end }}
912
spec:
1013
replicas: {{ .Values.replicaCount }}
1114
selector:
@@ -23,10 +26,16 @@ spec:
2326
app: efs-csi-controller
2427
app.kubernetes.io/name: {{ include "aws-efs-csi-driver.name" . }}
2528
app.kubernetes.io/instance: {{ .Release.Name }}
29+
{{- with .Values.controller.podLabels }}
30+
{{ toYaml . | nindent 8 }}
31+
{{- end }}
2632
{{- with .Values.controller.podAnnotations }}
2733
annotations: {{- toYaml . | nindent 8 }}
2834
{{- end }}
2935
spec:
36+
{{- if hasKey .Values.controller "hostNetwork" }}
37+
hostNetwork: {{ .Values.controller.hostNetwork }}
38+
{{- end }}
3039
{{- if .Values.imagePullSecrets }}
3140
imagePullSecrets:
3241
{{- range .Values.imagePullSecrets }}
@@ -39,18 +48,26 @@ spec:
3948
{{- toYaml . | nindent 8 }}
4049
{{- end }}
4150
serviceAccountName: {{ .Values.controller.serviceAccount.name }}
42-
priorityClassName: system-cluster-critical
51+
priorityClassName: {{ .Values.controller.priorityClassName | default "system-cluster-critical" }}
4352
{{- with .Values.controller.tolerations }}
4453
tolerations: {{- toYaml . | nindent 8 }}
4554
{{- end }}
4655
{{- with .Values.controller.securityContext }}
4756
securityContext:
4857
{{- toYaml . | nindent 8 }}
4958
{{- end }}
59+
{{- if .Values.controller.dnsPolicy }}
60+
dnsPolicy: {{ .Values.node.dnsPolicy }}
61+
{{- end }}
62+
{{- with .Values.node.dnsConfig }}
63+
dnsConfig: {{- toYaml . | nindent 8 }}
64+
{{- end }}
5065
containers:
5166
- name: efs-plugin
67+
{{- with .Values.controller.containerSecurityContext }}
5268
securityContext:
53-
privileged: true
69+
{{- toYaml . | nindent 12 }}
70+
{{- end }}
5471
image: {{ printf "%s:%s" .Values.image.repository (default (printf "v%s" .Chart.AppVersion) (toString .Values.image.tag)) }}
5572
imagePullPolicy: {{ .Values.image.pullPolicy }}
5673
args:
@@ -105,6 +122,12 @@ spec:
105122
- --extra-create-metadata
106123
{{- end }}
107124
- --leader-election
125+
{{- if hasKey .Values.controller "leaderElectionRenewDeadline" }}
126+
- --leader-election-renew-deadline={{ .Values.controller.leaderElectionRenewDeadline }}
127+
{{- end }}
128+
{{- if hasKey .Values.controller "leaderElectionLeaseDuration" }}
129+
- --leader-election-lease-duration={{ .Values.controller.leaderElectionLeaseDuration }}
130+
{{- end }}
108131
env:
109132
- name: ADDRESS
110133
value: /var/lib/csi/sockets/pluginproxy/csi.sock

charts/aws-efs-csi-driver/values.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ controller:
6363
# path on efs when deleteing an access point
6464
deleteAccessPointRootDir: false
6565
podAnnotations: {}
66+
podLabel: {}
67+
hostNetwork: false
68+
priorityClassName: system-cluster-critical
69+
dnsPolicy: ClusterFirst
70+
dnsConfig: {}
71+
additionalLabels: {}
6672
resources:
6773
{}
6874
# We usually recommend not to specify default resources and to leave this as a conscious
@@ -94,6 +100,11 @@ controller:
94100
runAsUser: 0
95101
runAsGroup: 0
96102
fsGroup: 0
103+
# securityContext on the controller container
104+
containerSecurityContext:
105+
privileged: true
106+
leaderElectionRenewDeadline: 10s
107+
leaderElectionLeaseDuration: 15s
97108

98109

99110
## Node daemonset variables

0 commit comments

Comments
 (0)