Skip to content

Commit 3226e70

Browse files
authored
Merge pull request #1471 from jrakas-dev/controller-config-update
Add resources, topologySpreadConstraints and replicaCount to controller block
2 parents 65cd90d + ea04b86 commit 3226e70

File tree

2 files changed

+26
-5
lines changed

2 files changed

+26
-5
lines changed

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

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ metadata:
1010
{{ toYaml . | nindent 4 }}
1111
{{- end }}
1212
spec:
13-
replicas: {{ .Values.replicaCount }}
13+
replicas: {{ .Values.controller.replicaCount }}
1414
selector:
1515
matchLabels:
1616
app: efs-csi-controller
@@ -140,7 +140,7 @@ spec:
140140
volumeMounts:
141141
- name: socket-dir
142142
mountPath: /var/lib/csi/sockets/pluginproxy/
143-
{{- with .Values.sidecars.csiProvisioner.resources }}
143+
{{- with default .Values.controller.resources .Values.sidecars.csiProvisioner.resources }}
144144
resources: {{ toYaml . | nindent 12 }}
145145
{{- end }}
146146
{{- with .Values.sidecars.csiProvisioner.securityContext }}
@@ -159,7 +159,7 @@ spec:
159159
{{- with .Values.controller.volumeMounts }}
160160
{{- toYaml . | nindent 12 }}
161161
{{- end }}
162-
{{- with .Values.sidecars.livenessProbe.resources }}
162+
{{- with default .Values.controller.resources .Values.sidecars.livenessProbe.resources }}
163163
resources: {{ toYaml . | nindent 12 }}
164164
{{- end }}
165165
{{- with .Values.sidecars.livenessProbe.securityContext }}
@@ -175,4 +175,13 @@ spec:
175175
{{- with .Values.controller.affinity }}
176176
affinity: {{- toYaml . | nindent 8 }}
177177
{{- end }}
178+
{{- if .Values.controller.topologySpreadConstraints }}
179+
{{- $tscLabelSelector := dict "labelSelector" ( dict "matchLabels" ( dict "app" "efs-csi-controller" ) ) }}
180+
{{- $constraints := list }}
181+
{{- range .Values.controller.topologySpreadConstraints }}
182+
{{- $constraints = mustAppend $constraints (mergeOverwrite . $tscLabelSelector) }}
183+
{{- end }}
184+
topologySpreadConstraints:
185+
{{- $constraints | toYaml | nindent 8 }}
186+
{{- end }}
178187
{{- end }}

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

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
nameOverride: ""
66
fullnameOverride: ""
77

8-
replicaCount: 2
9-
108
useFIPS: false
119

1210
image:
@@ -50,6 +48,8 @@ imagePullSecrets: []
5048
controller:
5149
# Specifies whether a deployment should be created
5250
create: true
51+
# Number of replicas for the CSI controller service deployment
52+
replicaCount: 2
5353
# Number for the log level verbosity
5454
logLevel: 2
5555
# If set, add pv/pvc metadata to plugin create requests as parameters.
@@ -113,6 +113,18 @@ controller:
113113
privileged: true
114114
leaderElectionRenewDeadline: 10s
115115
leaderElectionLeaseDuration: 15s
116+
# TSCs without the label selector stanza
117+
#
118+
# Example:
119+
#
120+
# topologySpreadConstraints:
121+
# - maxSkew: 1
122+
# topologyKey: topology.kubernetes.io/zone
123+
# whenUnsatisfiable: ScheduleAnyway
124+
# - maxSkew: 1
125+
# topologyKey: kubernetes.io/hostname
126+
# whenUnsatisfiable: ScheduleAnyway
127+
topologySpreadConstraints: []
116128

117129
## Node daemonset variables
118130

0 commit comments

Comments
 (0)