Skip to content

Commit

Permalink
Merge pull request kubernetes-sigs#1471 from jrakas-dev/controller-co…
Browse files Browse the repository at this point in the history
…nfig-update

Add resources, topologySpreadConstraints and replicaCount to controller block
  • Loading branch information
k8s-ci-robot authored Oct 10, 2024
2 parents 65cd90d + ea04b86 commit 3226e70
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 5 deletions.
15 changes: 12 additions & 3 deletions charts/aws-efs-csi-driver/templates/controller-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ metadata:
{{ toYaml . | nindent 4 }}
{{- end }}
spec:
replicas: {{ .Values.replicaCount }}
replicas: {{ .Values.controller.replicaCount }}
selector:
matchLabels:
app: efs-csi-controller
Expand Down Expand Up @@ -140,7 +140,7 @@ spec:
volumeMounts:
- name: socket-dir
mountPath: /var/lib/csi/sockets/pluginproxy/
{{- with .Values.sidecars.csiProvisioner.resources }}
{{- with default .Values.controller.resources .Values.sidecars.csiProvisioner.resources }}
resources: {{ toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.sidecars.csiProvisioner.securityContext }}
Expand All @@ -159,7 +159,7 @@ spec:
{{- with .Values.controller.volumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.sidecars.livenessProbe.resources }}
{{- with default .Values.controller.resources .Values.sidecars.livenessProbe.resources }}
resources: {{ toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.sidecars.livenessProbe.securityContext }}
Expand All @@ -175,4 +175,13 @@ spec:
{{- with .Values.controller.affinity }}
affinity: {{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.controller.topologySpreadConstraints }}
{{- $tscLabelSelector := dict "labelSelector" ( dict "matchLabels" ( dict "app" "efs-csi-controller" ) ) }}
{{- $constraints := list }}
{{- range .Values.controller.topologySpreadConstraints }}
{{- $constraints = mustAppend $constraints (mergeOverwrite . $tscLabelSelector) }}
{{- end }}
topologySpreadConstraints:
{{- $constraints | toYaml | nindent 8 }}
{{- end }}
{{- end }}
16 changes: 14 additions & 2 deletions charts/aws-efs-csi-driver/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
nameOverride: ""
fullnameOverride: ""

replicaCount: 2

useFIPS: false

image:
Expand Down Expand Up @@ -50,6 +48,8 @@ imagePullSecrets: []
controller:
# Specifies whether a deployment should be created
create: true
# Number of replicas for the CSI controller service deployment
replicaCount: 2
# Number for the log level verbosity
logLevel: 2
# If set, add pv/pvc metadata to plugin create requests as parameters.
Expand Down Expand Up @@ -113,6 +113,18 @@ controller:
privileged: true
leaderElectionRenewDeadline: 10s
leaderElectionLeaseDuration: 15s
# TSCs without the label selector stanza
#
# Example:
#
# topologySpreadConstraints:
# - maxSkew: 1
# topologyKey: topology.kubernetes.io/zone
# whenUnsatisfiable: ScheduleAnyway
# - maxSkew: 1
# topologyKey: kubernetes.io/hostname
# whenUnsatisfiable: ScheduleAnyway
topologySpreadConstraints: []

## Node daemonset variables

Expand Down

0 comments on commit 3226e70

Please sign in to comment.