Skip to content

Commit a728a99

Browse files
committed
feat(helm): extend helm template to support startup taints
we extend the helm chart to (1) automatically add provisionerNotReadyNodeTaintKey tolerations to the daemonset (2) pass the provisionerNotReadyNodeTaintKey and removeNodeNotReadyTaint to config map, and (3) extend the rbac to so the pod can update the node taints.
1 parent 3c29b0c commit a728a99

File tree

4 files changed

+24
-3
lines changed

4 files changed

+24
-3
lines changed

helm/provisioner/templates/configmap.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ data:
2424
{{- if .Values.setPVOwnerRef }}
2525
setPVOwnerRef: "true"
2626
{{- end }}
27+
{{- if .Values.removeNodeNotReadyTaint }}
28+
removeNodeNotReadyTaint: {{ .Values.removeNodeNotReadyTaint | quote }}
29+
provisionerNotReadyNodeTaintKey: {{ .Values.provisionerNotReadyNodeTaintKey | quote }}
30+
{{- end }}
2731
{{- if .Values.useJobForCleaning }}
2832
useJobForCleaning: "yes"
2933
{{- end }}

helm/provisioner/templates/daemonset_linux.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,15 @@ spec:
4444
{{- if .Values.nodeSelector }}
4545
{{ toYaml .Values.nodeSelector | nindent 8 }}
4646
{{- end }}
47-
{{- if .Values.tolerations }}
47+
{{- if or (.Values.tolerations) (.Values.removeNodeNotReadyTaint) }}
4848
tolerations:
49-
{{ toYaml .Values.tolerations | nindent 8 }}
49+
{{- if .Values.tolerations}}
50+
{{- toYaml .Values.tolerations | nindent 8 }}
51+
{{- end }}
52+
{{- if .Values.removeNodeNotReadyTaint }}
53+
- key: {{ .Values.provisionerNotReadyNodeTaintKey}}
54+
operator: Exists
55+
{{- end }}
5056
{{- end }}
5157
{{- if .Values.affinity }}
5258
affinity:

helm/provisioner/templates/rbac.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ rules:
2323
verbs: ["create", "update", "patch"]
2424
- apiGroups: [""]
2525
resources: ["nodes"]
26-
verbs: ["get"]
26+
verbs: ["get", "update"]
2727
{{- if .Values.rbac.extraRules }}
2828
{{ toYaml .Values.rbac.extraRules }}
2929
{{- end}}

helm/provisioner/values.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,17 @@ nodeSelectorWindows: {}
133133
# Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
134134
tolerations: []
135135
#
136+
# If configured, removeNodeNotReadyTaint will add provisionerNotReadyNodeTaintKey as the toleration key
137+
# to the DaemonSet PodSpec.
138+
#
139+
# removeNodeNotReadyTaint controls whether the provisioner should remove the provisionerNotReadyNodeTaintKey
140+
# once it becomes ready.
141+
removeNodeNotReadyTaint: false
142+
#
143+
# The key of the startup taint that provisioner will remove once it becomes ready.
144+
# Ref: https://karpenter.sh/docs/concepts/nodepools/#cilium-startup-taint
145+
provisionerNotReadyNodeTaintKey: "sig-storage-local-static-provisioner/agent-not-ready"
146+
#
136147
# If configured, affinity will add a affinity filed to the DeamonSet PodSpec.
137148
# Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity
138149
affinity: {}

0 commit comments

Comments
 (0)