diff --git a/prometheus-blackbox-exporter/templates/deployment.yaml b/prometheus-blackbox-exporter/templates/deployment.yaml index d492488d2..e63620992 100644 --- a/prometheus-blackbox-exporter/templates/deployment.yaml +++ b/prometheus-blackbox-exporter/templates/deployment.yaml @@ -34,12 +34,14 @@ spec: annotations: {{ dict "envAll" $envAll "podName" "prometheus-blackbox-exporter" "containerNames" (list "blackbox-exporter") | include "helm-toolkit.snippets.kubernetes_mandatory_access_control_annotation" | indent 8 }} spec: +{{ dict "envAll" $envAll "application" "prometheus_blackbox_exporter" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }} nodeSelector: {{ .Values.labels.blackbox_exporter.node_selector_key }}: {{ .Values.labels.blackbox_exporter.node_selector_value | quote }} containers: - name: blackbox-exporter {{ tuple $envAll "prometheus_blackbox_exporter" | include "helm-toolkit.snippets.image" | indent 8 }} {{ tuple $envAll $envAll.Values.pod.resources.prometheus_blackbox_exporter | include "helm-toolkit.snippets.kubernetes_resources" | indent 8 }} +{{ dict "envAll" $envAll "application" "prometheus_blackbox_exporter" "container" "blackbox_exporter" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 8 }} args: - "--config.file=/config/blackbox.yaml" ports: diff --git a/prometheus-blackbox-exporter/values.yaml b/prometheus-blackbox-exporter/values.yaml index 470478f55..e0b6087cb 100644 --- a/prometheus-blackbox-exporter/values.yaml +++ b/prometheus-blackbox-exporter/values.yaml @@ -47,6 +47,14 @@ endpoints: default: 9115 pod: + security_context: + prometheus_blackbox_exporter: + pod: + runAsUser: 65534 + container: + blackbox_exporter: + allowPrivilegeEscalation: false + readOnlyRootFilesystem: true replicas: prometheus_blackbox_exporter: 1 annotations: