From f60ddd5a9d9acccc712df439e440bbcf15a1067d Mon Sep 17 00:00:00 2001 From: Alexander Berger Date: Wed, 30 Jun 2021 14:12:50 +0200 Subject: [PATCH 1/2] Fix Helm Chart templates - duplicate ports key bug Fixes https://github.com/aws/eks-charts/issues/550 The Helm templates for aws-node-termination-handler will produce invalid DaemonSet(s) and Deployment spec with duplicate ports key if values enableProbesServer and enablePrometheusServer are both set to true. --- config/helm/aws-node-termination-handler/Chart.yaml | 2 +- config/helm/aws-node-termination-handler/README.md | 2 +- .../templates/daemonset.linux.yaml | 5 +++-- .../templates/daemonset.windows.yaml | 5 +++-- .../aws-node-termination-handler/templates/deployment.yaml | 5 +++-- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/config/helm/aws-node-termination-handler/Chart.yaml b/config/helm/aws-node-termination-handler/Chart.yaml index 00aa1f2b..949f2c1a 100644 --- a/config/helm/aws-node-termination-handler/Chart.yaml +++ b/config/helm/aws-node-termination-handler/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 name: aws-node-termination-handler description: A Helm chart for the AWS Node Termination Handler -version: 0.15.1 +version: 0.15.2 appVersion: 1.13.1 home: https://github.com/aws/eks-charts icon: https://raw.githubusercontent.com/aws/eks-charts/master/docs/logo/aws.png diff --git a/config/helm/aws-node-termination-handler/README.md b/config/helm/aws-node-termination-handler/README.md index 3cc54bda..e0934993 100644 --- a/config/helm/aws-node-termination-handler/README.md +++ b/config/helm/aws-node-termination-handler/README.md @@ -135,7 +135,7 @@ Parameter | Description | Default `windowsNodeSelector` | Tells the Windows daemon set where to place the node-termination-handler pods. For example: `lifecycle: "Ec2Spot"`, `on-demand: "false"`, `aws.amazon.com/purchaseType: "spot"`, etc. Value must be a valid yaml expression. | `{}` `tolerations` | list of node taints to tolerate | `[ {"operator": "Exists"} ]` `rbac.create` | if `true`, create and use RBAC resources | `true` -`rbac.pspEnabled` | If `true`, create and use a restricted pod security policy | `false` +`rbac.pspEnabled` | If `true`, create and use a restricted pod security policy | `true` `serviceAccount.create` | If `true`, create a new service account | `true` `serviceAccount.name` | Service account to be used | None `serviceAccount.annotations` | Specifies the annotations for ServiceAccount | `{}` diff --git a/config/helm/aws-node-termination-handler/templates/daemonset.linux.yaml b/config/helm/aws-node-termination-handler/templates/daemonset.linux.yaml index e85bf0de..a1add405 100644 --- a/config/helm/aws-node-termination-handler/templates/daemonset.linux.yaml +++ b/config/helm/aws-node-termination-handler/templates/daemonset.linux.yaml @@ -180,8 +180,10 @@ spec: value: {{ .Values.kubernetesEventsExtraAnnotations | quote }} resources: {{- toYaml .Values.resources | nindent 12 }} - {{- if .Values.enablePrometheusServer }} + {{- if or .Values.enablePrometheusServer .Values.enableProbesServer }} ports: + {{- end }} + {{- if .Values.enablePrometheusServer }} - containerPort: {{ .Values.prometheusServerPort }} {{- if .Values.useHostNetwork }} hostPort: {{ .Values.prometheusServerPort }} @@ -190,7 +192,6 @@ spec: protocol: TCP {{- end }} {{- if .Values.enableProbesServer }} - ports: - containerPort: {{ .Values.probesServerPort }} {{- if .Values.useHostNetwork }} hostPort: {{ .Values.probesServerPort }} diff --git a/config/helm/aws-node-termination-handler/templates/daemonset.windows.yaml b/config/helm/aws-node-termination-handler/templates/daemonset.windows.yaml index 7c7babcf..9ada6a3f 100644 --- a/config/helm/aws-node-termination-handler/templates/daemonset.windows.yaml +++ b/config/helm/aws-node-termination-handler/templates/daemonset.windows.yaml @@ -154,15 +154,16 @@ spec: value: {{ .Values.kubernetesEventsExtraAnnotations | quote }} resources: {{- toYaml .Values.resources | nindent 12 }} - {{- if .Values.enablePrometheusServer }} + {{- if or .Values.enablePrometheusServer .Values.enableProbesServer }} ports: + {{- end }} + {{- if .Values.enablePrometheusServer }} - containerPort: {{ .Values.prometheusServerPort }} hostPort: {{ .Values.prometheusServerPort }} name: http-metrics protocol: TCP {{- end }} {{- if .Values.enableProbesServer }} - ports: - containerPort: {{ .Values.probesServerPort }} hostPort: {{ .Values.probesServerPort }} name: liveness-probe diff --git a/config/helm/aws-node-termination-handler/templates/deployment.yaml b/config/helm/aws-node-termination-handler/templates/deployment.yaml index e9262647..c5c4664f 100644 --- a/config/helm/aws-node-termination-handler/templates/deployment.yaml +++ b/config/helm/aws-node-termination-handler/templates/deployment.yaml @@ -156,15 +156,16 @@ spec: value: {{ .Values.kubernetesEventsExtraAnnotations | quote }} resources: {{- toYaml .Values.resources | nindent 12 }} - {{- if .Values.enablePrometheusServer }} + {{- if or .Values.enablePrometheusServer .Values.enableProbesServer }} ports: + {{- end }} + {{- if .Values.enablePrometheusServer }} - containerPort: {{ .Values.prometheusServerPort }} hostPort: {{ .Values.prometheusServerPort }} name: http-metrics protocol: TCP {{- end }} {{- if .Values.enableProbesServer }} - ports: - containerPort: {{ .Values.probesServerPort }} hostPort: {{ .Values.probesServerPort }} name: liveness-probe From 6ef99bd4a33e7c9354a659e61cdd83696df880b3 Mon Sep 17 00:00:00 2001 From: Alexander Berger Date: Thu, 1 Jul 2021 07:41:10 +0200 Subject: [PATCH 2/2] Revert Helm Chart version bump as it is not needed --- config/helm/aws-node-termination-handler/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/helm/aws-node-termination-handler/Chart.yaml b/config/helm/aws-node-termination-handler/Chart.yaml index 949f2c1a..00aa1f2b 100644 --- a/config/helm/aws-node-termination-handler/Chart.yaml +++ b/config/helm/aws-node-termination-handler/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 name: aws-node-termination-handler description: A Helm chart for the AWS Node Termination Handler -version: 0.15.2 +version: 0.15.1 appVersion: 1.13.1 home: https://github.com/aws/eks-charts icon: https://raw.githubusercontent.com/aws/eks-charts/master/docs/logo/aws.png