diff --git a/charts/aws-ebs-csi-driver/templates/_helpers.tpl b/charts/aws-ebs-csi-driver/templates/_helpers.tpl index 42fc13825..73d3e140a 100644 --- a/charts/aws-ebs-csi-driver/templates/_helpers.tpl +++ b/charts/aws-ebs-csi-driver/templates/_helpers.tpl @@ -83,3 +83,21 @@ Handle http proxy env vars - name: NO_PROXY value: {{ .Values.proxy.no_proxy | quote }} {{- end -}} + +{{/* +Recommended daemonset tolerations +*/}} +{{- define "aws-ebs-csi-driver.daemonset-tolerations" -}} +# Prevents stateful workloads from being scheduled to node before CSI Driver reports volume attachment limit +- key: "ebs.csi.aws.com/agent-not-ready" + operator: "Exists" +# Prevents undesired eviction by Cluster Autoscalar +- key: "ToBeDeletedByClusterAutoscaler" + operator: Exists +# Prevents undesired eviction by v1 Karpenter +- key: "karpenter.sh/disrupted" + operator: Exists +# Prevents undesired eviction by v1beta1 Karpenter +- key: "karpenter.sh/disruption" + operator: Exists +{{- end -}} diff --git a/charts/aws-ebs-csi-driver/templates/_node-windows.tpl b/charts/aws-ebs-csi-driver/templates/_node-windows.tpl index 9f09ed609..3bd70367a 100644 --- a/charts/aws-ebs-csi-driver/templates/_node-windows.tpl +++ b/charts/aws-ebs-csi-driver/templates/_node-windows.tpl @@ -49,6 +49,7 @@ spec: {{- with .Values.node.tolerations }} {{- toYaml . | nindent 8 }} {{- end }} + {{- include "aws-ebs-csi-driver.daemonset-tolerations" . | nindent 8 }} {{- end }} {{- if .Values.node.windowsHostProcess }} securityContext: diff --git a/charts/aws-ebs-csi-driver/templates/_node.tpl b/charts/aws-ebs-csi-driver/templates/_node.tpl index a91b1b5eb..49464cbcb 100644 --- a/charts/aws-ebs-csi-driver/templates/_node.tpl +++ b/charts/aws-ebs-csi-driver/templates/_node.tpl @@ -53,8 +53,7 @@ spec: {{- with .Values.node.tolerations }} {{- toYaml . | nindent 8 }} {{- end }} - - key: "ebs.csi.aws.com/agent-not-ready" - operator: "Exists" + {{- include "aws-ebs-csi-driver.daemonset-tolerations" . | nindent 8 }} {{- end }} hostNetwork: {{ .Values.node.hostNetwork }} {{- with .Values.node.securityContext }}