Skip to content

Commit adcb3f6

Browse files
authored
helm: added necessary hostPorts in the PodSecurityPolicy (#371)
When metric/prometheus endpoint is enabled, we currently have an issue as the PodSecurityPolicy does not allow the pod to bind the ports. This change sorts this issue out (#365). Signed-off-by: Maxime VISONNEAU <[email protected]>
1 parent 60494ab commit adcb3f6

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ spec:
1212
hostIPC: false
1313
hostNetwork: {{ .Values.useHostNetwork }}
1414
hostPID: false
15+
{{- if and .Values.rbac.pspEnabled .Values.enablePrometheusServer }}
16+
hostPorts:
17+
- min: {{ .Values.prometheusServerPort }}
18+
max: {{ .Values.prometheusServerPort }}
19+
{{- end }}
1520
readOnlyRootFilesystem: false
1621
allowPrivilegeEscalation: false
1722
allowedCapabilities:

config/helm/aws-node-termination-handler/test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ windowsNodeSelector: {
122122
}
123123

124124
enablePrometheusServer: true
125-
prometheusServerPort: "9092"
125+
prometheusServerPort: 9092
126126

127127
tolerations:
128128
- operator: "Exists"

config/helm/aws-node-termination-handler/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ nodeSelectorTermsOs: ""
142142
nodeSelectorTermsArch: ""
143143

144144
enablePrometheusServer: false
145-
prometheusServerPort: "9092"
145+
prometheusServerPort: 9092
146146

147147
tolerations:
148148
- operator: "Exists"

0 commit comments

Comments
 (0)