From f3a57d3042f57392a76f9c38c31858c940c1e18f Mon Sep 17 00:00:00 2001 From: dntosas Date: Tue, 9 Feb 2021 10:40:21 +0200 Subject: [PATCH 1/2] [chart] Allow resources override for node DaemonSet CSI controller and node have different needs in a manner of capacity so in this commit we enable users to define specific resources for the node component. This will allow users not to reserve not needed resources on all of their instances as node is a DaemonSet and may not need as much CPU/Memory as the controller Pods. Signed-off-by: dntosas --- charts/aws-ebs-csi-driver/Chart.yaml | 2 +- charts/aws-ebs-csi-driver/templates/node.yaml | 18 ++++++++++++++++++ charts/aws-ebs-csi-driver/values.yaml | 1 + 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/charts/aws-ebs-csi-driver/Chart.yaml b/charts/aws-ebs-csi-driver/Chart.yaml index 13a922b431..4ac72eafb9 100644 --- a/charts/aws-ebs-csi-driver/Chart.yaml +++ b/charts/aws-ebs-csi-driver/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 appVersion: "0.9.0" name: aws-ebs-csi-driver description: A Helm chart for AWS EBS CSI Driver -version: 0.9.4 +version: 0.9.5 kubeVersion: ">=1.17.0-0" home: https://github.com/kubernetes-sigs/aws-ebs-csi-driver sources: diff --git a/charts/aws-ebs-csi-driver/templates/node.yaml b/charts/aws-ebs-csi-driver/templates/node.yaml index b32958d16a..978c5e729f 100644 --- a/charts/aws-ebs-csi-driver/templates/node.yaml +++ b/charts/aws-ebs-csi-driver/templates/node.yaml @@ -80,9 +80,15 @@ spec: timeoutSeconds: 3 periodSeconds: 10 failureThreshold: 5 + {{- if .Values.node.resources }} + {{- with .Values.node.resources }} + resources: {{ toYaml . | nindent 12 }} + {{- end }} + {{- else }} {{- with .Values.resources }} resources: {{ toYaml . | nindent 12 }} {{- end }} + {{- end }} - name: node-driver-registrar image: {{ printf "%s:%s" .Values.sidecars.nodeDriverRegistrarImage.repository .Values.sidecars.nodeDriverRegistrarImage.tag }} args: @@ -103,9 +109,15 @@ spec: mountPath: /csi - name: registration-dir mountPath: /registration + {{- if .Values.node.resources }} + {{- with .Values.node.resources }} + resources: {{ toYaml . | nindent 12 }} + {{- end }} + {{- else }} {{- with .Values.resources }} resources: {{ toYaml . | nindent 12 }} {{- end }} + {{- end }} - name: liveness-probe image: {{ printf "%s:%s" .Values.sidecars.livenessProbeImage.repository .Values.sidecars.livenessProbeImage.tag }} args: @@ -113,9 +125,15 @@ spec: volumeMounts: - name: plugin-dir mountPath: /csi + {{- if .Values.node.resources }} + {{- with .Values.node.resources }} + resources: {{ toYaml . | nindent 12 }} + {{- end }} + {{- else }} {{- with .Values.resources }} resources: {{ toYaml . | nindent 12 }} {{- end }} + {{- end }} volumes: - name: kubelet-dir hostPath: diff --git a/charts/aws-ebs-csi-driver/values.yaml b/charts/aws-ebs-csi-driver/values.yaml index bb4a609beb..adf3d000f0 100644 --- a/charts/aws-ebs-csi-driver/values.yaml +++ b/charts/aws-ebs-csi-driver/values.yaml @@ -91,6 +91,7 @@ node: podAnnotations: {} tolerateAllTaints: true tolerations: [] + resources: {} serviceAccount: controller: From 5a03305031962bd0b9df0551c1ad80c057cc6b25 Mon Sep 17 00:00:00 2001 From: dntosas Date: Tue, 9 Feb 2021 12:12:40 +0200 Subject: [PATCH 2/2] [chart] Ability to add priorityClassName CSI components and especially the node one, may be critical for operators so in this commit we enable them to define priorities for this kind of Pods. Signed-off-by: dntosas --- charts/aws-ebs-csi-driver/templates/controller.yaml | 2 +- charts/aws-ebs-csi-driver/templates/node.yaml | 2 +- charts/aws-ebs-csi-driver/templates/statefulset.yaml | 2 +- charts/aws-ebs-csi-driver/values.yaml | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/charts/aws-ebs-csi-driver/templates/controller.yaml b/charts/aws-ebs-csi-driver/templates/controller.yaml index 43b5b082cd..24d76df068 100644 --- a/charts/aws-ebs-csi-driver/templates/controller.yaml +++ b/charts/aws-ebs-csi-driver/templates/controller.yaml @@ -27,7 +27,7 @@ spec: {{ toYaml . | indent 8 }} {{- end }} serviceAccountName: {{ .Values.serviceAccount.controller.name }} - priorityClassName: system-cluster-critical + priorityClassName: {{ .Values.priorityClassName | default "system-cluster-critical" }} {{- with .Values.affinity }} affinity: {{ toYaml . | nindent 8 }} {{- end }} diff --git a/charts/aws-ebs-csi-driver/templates/node.yaml b/charts/aws-ebs-csi-driver/templates/node.yaml index 978c5e729f..4a08ad6209 100644 --- a/charts/aws-ebs-csi-driver/templates/node.yaml +++ b/charts/aws-ebs-csi-driver/templates/node.yaml @@ -36,7 +36,7 @@ spec: {{- end }} hostNetwork: true serviceAccountName: {{ .Values.serviceAccount.node.name }} - priorityClassName: system-node-critical + priorityClassName: {{ .Values.node.priorityClassName | default "system-cluster-critical" }} tolerations: {{- if .Values.node.tolerateAllTaints }} - operator: Exists diff --git a/charts/aws-ebs-csi-driver/templates/statefulset.yaml b/charts/aws-ebs-csi-driver/templates/statefulset.yaml index 38fcb9f601..741e26f84c 100644 --- a/charts/aws-ebs-csi-driver/templates/statefulset.yaml +++ b/charts/aws-ebs-csi-driver/templates/statefulset.yaml @@ -26,7 +26,7 @@ spec: {{- with .Values.nodeSelector }} {{ toYaml . | indent 8 }} {{- end }} - priorityClassName: system-cluster-critical + priorityClassName: {{ .Values.priorityClassName | default "system-cluster-critical" }} {{- with .Values.affinity }} affinity: {{ toYaml . | nindent 8 }} {{- end }} diff --git a/charts/aws-ebs-csi-driver/values.yaml b/charts/aws-ebs-csi-driver/values.yaml index adf3d000f0..0017abb363 100644 --- a/charts/aws-ebs-csi-driver/values.yaml +++ b/charts/aws-ebs-csi-driver/values.yaml @@ -60,11 +60,10 @@ resources: # cpu: 100m # memory: 128Mi +priorityClassName: "" nodeSelector: {} - tolerateAllTaints: true tolerations: [] - affinity: {} # Extra volume tags to attach to each dynamically provisioned volume. @@ -87,6 +86,7 @@ k8sTagClusterId: "" region: "" node: + priorityClassName: "" nodeSelector: {} podAnnotations: {} tolerateAllTaints: true