Skip to content

Commit 0466ba0

Browse files
authored
Fix Helm templates bug which caused duplicate ports key #551 (#461)
* Fix Helm Chart templates - duplicate ports key bug Fixes aws/eks-charts#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. * Revert Helm Chart version bump as it is not needed
1 parent fbfffad commit 0466ba0

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

config/helm/aws-node-termination-handler/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ Parameter | Description | Default
135135
`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. | `{}`
136136
`tolerations` | list of node taints to tolerate | `[ {"operator": "Exists"} ]`
137137
`rbac.create` | if `true`, create and use RBAC resources | `true`
138-
`rbac.pspEnabled` | If `true`, create and use a restricted pod security policy | `false`
138+
`rbac.pspEnabled` | If `true`, create and use a restricted pod security policy | `true`
139139
`serviceAccount.create` | If `true`, create a new service account | `true`
140140
`serviceAccount.name` | Service account to be used | None
141141
`serviceAccount.annotations` | Specifies the annotations for ServiceAccount | `{}`

config/helm/aws-node-termination-handler/templates/daemonset.linux.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,10 @@ spec:
180180
value: {{ .Values.kubernetesEventsExtraAnnotations | quote }}
181181
resources:
182182
{{- toYaml .Values.resources | nindent 12 }}
183-
{{- if .Values.enablePrometheusServer }}
183+
{{- if or .Values.enablePrometheusServer .Values.enableProbesServer }}
184184
ports:
185+
{{- end }}
186+
{{- if .Values.enablePrometheusServer }}
185187
- containerPort: {{ .Values.prometheusServerPort }}
186188
{{- if .Values.useHostNetwork }}
187189
hostPort: {{ .Values.prometheusServerPort }}
@@ -190,7 +192,6 @@ spec:
190192
protocol: TCP
191193
{{- end }}
192194
{{- if .Values.enableProbesServer }}
193-
ports:
194195
- containerPort: {{ .Values.probesServerPort }}
195196
{{- if .Values.useHostNetwork }}
196197
hostPort: {{ .Values.probesServerPort }}

config/helm/aws-node-termination-handler/templates/daemonset.windows.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,15 +154,16 @@ spec:
154154
value: {{ .Values.kubernetesEventsExtraAnnotations | quote }}
155155
resources:
156156
{{- toYaml .Values.resources | nindent 12 }}
157-
{{- if .Values.enablePrometheusServer }}
157+
{{- if or .Values.enablePrometheusServer .Values.enableProbesServer }}
158158
ports:
159+
{{- end }}
160+
{{- if .Values.enablePrometheusServer }}
159161
- containerPort: {{ .Values.prometheusServerPort }}
160162
hostPort: {{ .Values.prometheusServerPort }}
161163
name: http-metrics
162164
protocol: TCP
163165
{{- end }}
164166
{{- if .Values.enableProbesServer }}
165-
ports:
166167
- containerPort: {{ .Values.probesServerPort }}
167168
hostPort: {{ .Values.probesServerPort }}
168169
name: liveness-probe

config/helm/aws-node-termination-handler/templates/deployment.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,15 +156,16 @@ spec:
156156
value: {{ .Values.kubernetesEventsExtraAnnotations | quote }}
157157
resources:
158158
{{- toYaml .Values.resources | nindent 12 }}
159-
{{- if .Values.enablePrometheusServer }}
159+
{{- if or .Values.enablePrometheusServer .Values.enableProbesServer }}
160160
ports:
161+
{{- end }}
162+
{{- if .Values.enablePrometheusServer }}
161163
- containerPort: {{ .Values.prometheusServerPort }}
162164
hostPort: {{ .Values.prometheusServerPort }}
163165
name: http-metrics
164166
protocol: TCP
165167
{{- end }}
166168
{{- if .Values.enableProbesServer }}
167-
ports:
168169
- containerPort: {{ .Values.probesServerPort }}
169170
hostPort: {{ .Values.probesServerPort }}
170171
name: liveness-probe

0 commit comments

Comments
 (0)