Skip to content

Commit

Permalink
Merge pull request #1152 from nishant221/controller-deploy-flex
Browse files Browse the repository at this point in the history
Additional Controller Deployment features
  • Loading branch information
k8s-ci-robot committed Feb 16, 2024
2 parents 9d532eb + 0fe7e6c commit 3836d95
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 2 deletions.
27 changes: 25 additions & 2 deletions charts/aws-efs-csi-driver/templates/controller-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ metadata:
name: efs-csi-controller
labels:
app.kubernetes.io/name: {{ include "aws-efs-csi-driver.name" . }}
{{- with .Values.controller.additionalLabels }}
{{ toYaml . | nindent 4 }}
{{- end }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
Expand All @@ -23,10 +26,16 @@ spec:
app: efs-csi-controller
app.kubernetes.io/name: {{ include "aws-efs-csi-driver.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- with .Values.controller.podLabels }}
{{ toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.controller.podAnnotations }}
annotations: {{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- if hasKey .Values.controller "hostNetwork" }}
hostNetwork: {{ .Values.controller.hostNetwork }}
{{- end }}
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
{{- range .Values.imagePullSecrets }}
Expand All @@ -39,18 +48,26 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ .Values.controller.serviceAccount.name }}
priorityClassName: system-cluster-critical
priorityClassName: {{ .Values.controller.priorityClassName | default "system-cluster-critical" }}
{{- with .Values.controller.tolerations }}
tolerations: {{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.controller.securityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.controller.dnsPolicy }}
dnsPolicy: {{ .Values.controller.dnsPolicy }}
{{- end }}
{{- with .Values.controller.dnsConfig }}
dnsConfig: {{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: efs-plugin
{{- with .Values.controller.containerSecurityContext }}
securityContext:
privileged: true
{{- toYaml . | nindent 12 }}
{{- end }}
image: {{ printf "%s:%s" .Values.image.repository (default (printf "v%s" .Chart.AppVersion) (toString .Values.image.tag)) }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
Expand Down Expand Up @@ -105,6 +122,12 @@ spec:
- --extra-create-metadata
{{- end }}
- --leader-election
{{- if hasKey .Values.controller "leaderElectionRenewDeadline" }}
- --leader-election-renew-deadline={{ .Values.controller.leaderElectionRenewDeadline }}
{{- end }}
{{- if hasKey .Values.controller "leaderElectionLeaseDuration" }}
- --leader-election-lease-duration={{ .Values.controller.leaderElectionLeaseDuration }}
{{- end }}
env:
- name: ADDRESS
value: /var/lib/csi/sockets/pluginproxy/csi.sock
Expand Down
12 changes: 12 additions & 0 deletions charts/aws-efs-csi-driver/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ controller:
# path on efs when deleteing an access point
deleteAccessPointRootDir: false
podAnnotations: {}
podLabel: {}
hostNetwork: false
priorityClassName: system-cluster-critical
dnsPolicy: ClusterFirst
dnsConfig: {}
additionalLabels: {}
resources:
{}
# We usually recommend not to specify default resources and to leave this as a conscious
Expand Down Expand Up @@ -98,6 +104,12 @@ controller:
runAsUser: 0
runAsGroup: 0
fsGroup: 0
# securityContext on the controller container
# Setting privileged=false will cause the "delete-access-point-root-dir" controller option to fail
containerSecurityContext:
privileged: true
leaderElectionRenewDeadline: 10s
leaderElectionLeaseDuration: 15s


## Node daemonset variables
Expand Down

0 comments on commit 3836d95

Please sign in to comment.