Skip to content

Commit

Permalink
Allow setting extra, non-selector labels on pods
Browse files Browse the repository at this point in the history
Signed-off-by: Denis Iskandarov <d.iskandarov@gmail.com>

revert chart version bump

Signed-off-by: Denis Iskandarov <d.iskandarov@gmail.com>
  • Loading branch information
den-is committed Feb 17, 2024
1 parent 3836d95 commit 4633846
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 13 deletions.
19 changes: 19 additions & 0 deletions charts/aws-efs-csi-driver/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,22 @@ Create a string out of the map for controller tags flag
{{- end -}}
{{- join " " $tags -}}
{{- end -}}


{{/*
Controller Selector labels
*/}}
{{- define "aws-efs-csi-driver.controllerSelectorLabels" -}}
app: efs-csi-controller
app.kubernetes.io/name: {{ include "aws-efs-csi-driver.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Node Selector labels
*/}}
{{- define "aws-efs-csi-driver.nodeSelectorLabels" -}}
app: efs-csi-node
app.kubernetes.io/name: {{ include "aws-efs-csi-driver.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
10 changes: 3 additions & 7 deletions charts/aws-efs-csi-driver/templates/controller-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,17 @@ spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app: efs-csi-controller
app.kubernetes.io/name: {{ include "aws-efs-csi-driver.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- include "aws-efs-csi-driver.controllerSelectorLabels" . | nindent 6 }}
{{- with .Values.controller.updateStrategy }}
strategy:
{{ toYaml . | nindent 4 }}
{{- end }}
template:
metadata:
labels:
app: efs-csi-controller
app.kubernetes.io/name: {{ include "aws-efs-csi-driver.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- include "aws-efs-csi-driver.controllerSelectorLabels" . | nindent 8 }}
{{- with .Values.controller.podLabels }}
{{ toYaml . | nindent 8 }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.controller.podAnnotations }}
annotations: {{- toYaml . | nindent 8 }}
Expand Down
11 changes: 5 additions & 6 deletions charts/aws-efs-csi-driver/templates/node-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,18 @@ metadata:
spec:
selector:
matchLabels:
app: efs-csi-node
app.kubernetes.io/name: {{ include "aws-efs-csi-driver.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- include "aws-efs-csi-driver.nodeSelectorLabels" . | nindent 6 }}
{{- with .Values.node.updateStrategy }}
updateStrategy:
{{ toYaml . | nindent 4 }}
{{- end }}
template:
metadata:
labels:
app: efs-csi-node
app.kubernetes.io/name: {{ include "aws-efs-csi-driver.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- include "aws-efs-csi-driver.nodeSelectorLabels" . | nindent 8 }}
{{- with .Values.node.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.node.podAnnotations }}
annotations: {{ toYaml .Values.node.podAnnotations | nindent 8 }}
{{- end }}
Expand Down
2 changes: 2 additions & 0 deletions charts/aws-efs-csi-driver/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ controller:
# Enable if you want the controller to also delete the
# path on efs when deleteing an access point
deleteAccessPointRootDir: false
podLabels: {}
podAnnotations: {}
podLabel: {}
hostNetwork: false
Expand Down Expand Up @@ -138,6 +139,7 @@ node:
# dnsConfig:
# nameservers:
# - 169.254.169.253
podLabels: {}
podAnnotations: {}
resources:
{}
Expand Down

0 comments on commit 4633846

Please sign in to comment.