diff --git a/postgresql/templates/monitoring/prometheus/exporter-deployment.yaml b/postgresql/templates/monitoring/prometheus/exporter-deployment.yaml index 84f2da184..bc5b5bd5a 100644 --- a/postgresql/templates/monitoring/prometheus/exporter-deployment.yaml +++ b/postgresql/templates/monitoring/prometheus/exporter-deployment.yaml @@ -34,6 +34,9 @@ spec: labels: {{ tuple $envAll "prometheus_postgresql_exporter" "exporter" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }} namespace: {{ .Values.endpoints.prometheus_postgresql_exporter.namespace }} + annotations: +{{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" | indent 8 }} +{{ dict "envAll" $envAll "podName" "prometheus-postgresql-exporter" "containerNames" (list "postgresql-exporter") | include "helm-toolkit.snippets.kubernetes_mandatory_access_control_annotation" | indent 8 }} spec: {{ dict "envAll" $envAll "application" "prometheus_postgresql_exporter" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }} serviceAccountName: {{ $serviceAccountName }} diff --git a/postgresql/templates/statefulset.yaml b/postgresql/templates/statefulset.yaml index 38a6af4a1..3379570b8 100644 --- a/postgresql/templates/statefulset.yaml +++ b/postgresql/templates/statefulset.yaml @@ -122,6 +122,7 @@ spec: {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" | indent 8 }} configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "helm-toolkit.utils.hash" }} configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "helm-toolkit.utils.hash" }} +{{ dict "envAll" $envAll "podName" "postgresql" "containerNames" (list "postgresql" "set-volume-perms") | include "helm-toolkit.snippets.kubernetes_mandatory_access_control_annotation" | indent 8 }} configmap-admin-hash: {{ tuple "secret-admin.yaml" . | include "helm-toolkit.utils.hash" }} configmap-replica-hash: {{ tuple "secret-replica.yaml" . | include "helm-toolkit.utils.hash" }} configmap-secrets-etc-hash: {{ tuple "secrets-etc.yaml" . | include "helm-toolkit.utils.hash" }} diff --git a/postgresql/values_overrides/apparmor.yaml b/postgresql/values_overrides/apparmor.yaml new file mode 100644 index 000000000..7025648f9 --- /dev/null +++ b/postgresql/values_overrides/apparmor.yaml @@ -0,0 +1,8 @@ +pod: + mandatory_access_control: + type: apparmor + postgresql: + postgresql: runtime/default + set-volume-perms: runtime/default + prometheus-postgresql-exporter: + postgresql-exporter: runtime/default diff --git a/tools/deployment/apparmor/130-postgresql.sh b/tools/deployment/apparmor/130-postgresql.sh new file mode 120000 index 000000000..bb8d4c2e7 --- /dev/null +++ b/tools/deployment/apparmor/130-postgresql.sh @@ -0,0 +1 @@ +../osh-infra-monitoring/130-postgresql.sh \ No newline at end of file diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml index a24b793de..90a64126f 100644 --- a/zuul.d/jobs.yaml +++ b/zuul.d/jobs.yaml @@ -285,6 +285,7 @@ - ./tools/deployment/apparmor/100-fluentbit.sh - ./tools/deployment/apparmor/110-fluentd-daemonset.sh - ./tools/deployment/apparmor/120-openvswitch.sh + - ./tools/deployment/apparmor/130-postgresql.sh - job: name: openstack-helm-infra-openstack-support