diff --git a/glance/templates/job-metadefs-load.yaml b/glance/templates/job-metadefs-load.yaml index be3251407b..afff731ee7 100644 --- a/glance/templates/job-metadefs-load.yaml +++ b/glance/templates/job-metadefs-load.yaml @@ -34,7 +34,7 @@ spec: {{ dict "envAll" $envAll "podName" "glance-metadefs-load" "containerNames" (list "init" "glance-metadefs-load" ) | include "helm-toolkit.snippets.kubernetes_mandatory_access_control_annotation" | indent 8 }} spec: serviceAccountName: {{ $serviceAccountName }} -{{ dict "envAll" $envAll "application" "glance" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }} +{{ dict "envAll" $envAll "application" "metadefs_load" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }} restartPolicy: OnFailure nodeSelector: {{ .Values.labels.job.node_selector_key }}: {{ .Values.labels.job.node_selector_value }} @@ -44,6 +44,7 @@ spec: - name: glance-metadefs-load {{ tuple $envAll "glance_metadefs_load" | include "helm-toolkit.snippets.image" | indent 10 }} {{ tuple $envAll $envAll.Values.pod.resources.jobs.metadefs_load | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} +{{ dict "envAll" $envAll "application" "metadefs_load" "container" "glance_metadefs_load" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }} env: - name: NAMESPACE valueFrom: diff --git a/glance/templates/job-storage-init.yaml b/glance/templates/job-storage-init.yaml index 3b39581ad1..998612aedc 100644 --- a/glance/templates/job-storage-init.yaml +++ b/glance/templates/job-storage-init.yaml @@ -62,7 +62,7 @@ spec: {{ dict "envAll" $envAll "podName" "glance-storage-init" "containerNames" (list "init" "glance-storage-init" ) | include "helm-toolkit.snippets.kubernetes_mandatory_access_control_annotation" | indent 8 }} spec: serviceAccountName: {{ $serviceAccountName }} -{{ dict "envAll" $envAll "application" "glance" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }} +{{ dict "envAll" $envAll "application" "storage_init" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }} restartPolicy: OnFailure nodeSelector: {{ .Values.labels.job.node_selector_key }}: {{ .Values.labels.job.node_selector_value }} @@ -71,8 +71,7 @@ spec: {{ if or (eq .Values.storage "rbd") (eq .Values.storage "radosgw") }} - name: ceph-keyring-placement {{ tuple $envAll "glance_api" | include "helm-toolkit.snippets.image" | indent 10 }} - securityContext: - allowPrivilegeEscalation: false +{{ dict "envAll" $envAll "application" "storage_init" "container" "ceph_keyring_placement" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }} command: - /tmp/ceph-admin-keyring.sh volumeMounts: @@ -95,6 +94,7 @@ spec: - name: glance-storage-init {{ tuple $envAll "glance_storage_init" | include "helm-toolkit.snippets.image" | indent 10 }} {{ tuple $envAll $envAll.Values.pod.resources.jobs.storage_init | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} +{{ dict "envAll" $envAll "application" "storage_init" "container" "glance_storage_init" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }} env: - name: NAMESPACE valueFrom: diff --git a/glance/templates/pod-rally-test.yaml b/glance/templates/pod-rally-test.yaml index f818aaa79c..1a7a226b90 100644 --- a/glance/templates/pod-rally-test.yaml +++ b/glance/templates/pod-rally-test.yaml @@ -33,6 +33,7 @@ metadata: spec: nodeSelector: {{ .Values.labels.test.node_selector_key }}: {{ .Values.labels.test.node_selector_value }} +{{ dict "envAll" $envAll "application" "test" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 2 }} restartPolicy: Never serviceAccountName: {{ $serviceAccountName }} initContainers: @@ -40,6 +41,7 @@ spec: - name: glance-test-ks-user {{ tuple $envAll "ks_user" | include "helm-toolkit.snippets.image" | indent 6 }} {{ tuple $envAll $envAll.Values.pod.resources.jobs.ks_user | include "helm-toolkit.snippets.kubernetes_resources" | indent 6 }} +{{ dict "envAll" $envAll "application" "test" "container" "glance_test_ks_user" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 6 }} command: - /tmp/ks-user.sh volumeMounts: @@ -64,6 +66,7 @@ spec: - name: glance-test {{ tuple $envAll "test" | include "helm-toolkit.snippets.image" | indent 6 }} {{ tuple $envAll $envAll.Values.pod.resources.jobs.tests | include "helm-toolkit.snippets.kubernetes_resources" | indent 6 }} +{{ dict "envAll" $envAll "application" "test" "container" "glance_test" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 6 }} env: {{- with $env := dict "ksUserSecret" .Values.secrets.identity.admin }} {{- include "helm-toolkit.snippets.keystone_openrc_env_vars" $env | indent 8 }} diff --git a/glance/values.yaml b/glance/values.yaml index 43de91e5bd..47a30f4b9c 100644 --- a/glance/values.yaml +++ b/glance/values.yaml @@ -839,6 +839,33 @@ pod: glance_registry: readOnlyRootFilesystem: true allowPrivilegeEscalation: false + metadefs_load: + pod: + runAsUser: 42424 + container: + glance_metadefs_load: + readOnlyRootFilesystem: true + allowPrivilegeEscalation: false + storage_init: + pod: + runAsUser: 42424 + container: + ceph_keyring_placement: + readOnlyRootFilesystem: true + allowPrivilegeEscalation: false + glance_storage_init: + readOnlyRootFilesystem: true + allowPrivilegeEscalation: false + test: + pod: + runAsUser: 42424 + container: + glance_test_ks_user: + readOnlyRootFilesystem: true + allowPrivilegeEscalation: false + glance_test: + readOnlyRootFilesystem: true + allowPrivilegeEscalation: false affinity: anti: type: