diff --git a/mariadb/templates/cron-job-backup-mariadb.yaml b/mariadb/templates/cron-job-backup-mariadb.yaml index e3501f7d3..69a21b66e 100644 --- a/mariadb/templates/cron-job-backup-mariadb.yaml +++ b/mariadb/templates/cron-job-backup-mariadb.yaml @@ -35,6 +35,8 @@ spec: metadata: labels: {{ tuple $envAll "mariadb-backup" "backup" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }} + annotations: +{{ dict "envAll" $envAll "podName" "mariadb-backup" "containerNames" (list "mariadb-backup") | include "helm-toolkit.snippets.kubernetes_mandatory_access_control_annotation" | indent 8 }} spec: template: metadata: diff --git a/mariadb/templates/monitoring/prometheus/exporter-job-create-user.yaml b/mariadb/templates/monitoring/prometheus/exporter-job-create-user.yaml index 79fe879c8..75b2a64ce 100644 --- a/mariadb/templates/monitoring/prometheus/exporter-job-create-user.yaml +++ b/mariadb/templates/monitoring/prometheus/exporter-job-create-user.yaml @@ -30,6 +30,9 @@ spec: metadata: labels: {{ tuple $envAll "prometheus-mysql-exporter" "create-sql-user" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }} + annotations: +{{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" | indent 8 }} +{{ dict "envAll" $envAll "podName" "prometheus-mysql-exporter" "containerNames" (list "exporter-create-sql-user") | include "helm-toolkit.snippets.kubernetes_mandatory_access_control_annotation" | indent 8 }} spec: shareProcessNamespace: true serviceAccountName: {{ $serviceAccountName }} diff --git a/mariadb/templates/pod-test.yaml b/mariadb/templates/pod-test.yaml index fbc103905..5f9c8b83b 100644 --- a/mariadb/templates/pod-test.yaml +++ b/mariadb/templates/pod-test.yaml @@ -30,6 +30,7 @@ metadata: annotations: "helm.sh/hook": test-success {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }} +{{ dict "envAll" $envAll "podName" "mariadb-test" "containerNames" (list "mariadb-mariadb-test") | include "helm-toolkit.snippets.kubernetes_mandatory_access_control_annotation" | indent 4 }} spec: shareProcessNamespace: true serviceAccountName: {{ $serviceAccountName }} diff --git a/mariadb/values_overrides/apparmor.yaml b/mariadb/values_overrides/apparmor.yaml index abb4964f4..9551fdcc3 100644 --- a/mariadb/values_overrides/apparmor.yaml +++ b/mariadb/values_overrides/apparmor.yaml @@ -7,8 +7,13 @@ pod: ingress: runtime/default mariadb-server: mariadb: runtime/default + mariadb-backup: + mariadb-backup: runtime/default + mariadb-test: + mariadb-mariadb-test: runtime/default prometheus-mysql-exporter: mysql-exporter: runtime/default + exporter-create-sql-user: runtime/default monitoring: prometheus: diff --git a/tools/deployment/apparmor/030-mariadb.sh b/tools/deployment/apparmor/030-mariadb.sh index 2fe0dc20d..54c91a9b5 100755 --- a/tools/deployment/apparmor/030-mariadb.sh +++ b/tools/deployment/apparmor/030-mariadb.sh @@ -33,3 +33,6 @@ helm upgrade --install mariadb ./mariadb \ #NOTE: Validate Deployment info helm status mariadb + +#NOTE: Validate the deployment +helm test mariadb