Skip to content

Commit

Permalink
pod security spec updates
Browse files Browse the repository at this point in the history
- Update to the podSpec in `_helpers.tpl` with `customPingGroupRange` and included sensible default for ping range
- Update to the `deployment.yaml` to reflect updates

Signed-off-by: Sacha <[email protected]>
  • Loading branch information
sachasmart committed Dec 14, 2023
1 parent 27d6377 commit b1ca00b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 5 additions & 0 deletions charts/prometheus-blackbox-exporter/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,11 @@ priorityClassName: "{{ . }}"
{{- with .Values.podSecurityContext }}
securityContext:
{{ toYaml . | indent 2 }}
{{- if has "NET_RAW" .Values.securityContext.capabilities.add }}
sysctls:
- name: net.ipv4.ping_group_range
value: {{ .Values.customPingGroupRange | default "0 65535" }}
{{- end }}
{{- end }}
{{- with .Values.extraInitContainers }}
initContainers:
Expand Down
7 changes: 5 additions & 2 deletions charts/prometheus-blackbox-exporter/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,13 @@ spec:
{{- end }}
spec:
{{- include "prometheus-blackbox-exporter.podSpec" . | nindent 6 }}
{{- if has "NET_RAW" .Values.securityContext.capabilities.add }}
{{- with .Values.podSecurityContext }}
securityContext:
{{ toYaml . | indent 2 }}
{{- if has "NET_RAW" .capabilities.add }}
sysctls:
- name: net.ipv4.ping_group_range
value: 0 65536
value: {{ .customPingGroupRange | default "0 65536" }}
{{- end }}
{{- end }}
{{- end }}

0 comments on commit b1ca00b

Please sign in to comment.