Ceph-mon: Add pod/container security context
This updates the ceph-mon chart to include the pod security context on the pod template This also adds the container security context to set readOnlyRootFilesystem flag to true Change-Id: I4c9e292eaf3d76ee80f50553d1cbc8cdc6f57cac
This commit is contained in:
parent
548356e86c
commit
ddfa7a4741
@ -15,7 +15,8 @@ limitations under the License.
|
|||||||
{{- if and .Values.manifests.job_keyring .Values.deployment.storage_secrets }}
|
{{- if and .Values.manifests.job_keyring .Values.deployment.storage_secrets }}
|
||||||
{{- $envAll := . }}
|
{{- $envAll := . }}
|
||||||
{{- range $key1, $cephBootstrapKey := tuple "mds" "osd" "mon" "mgr" }}
|
{{- range $key1, $cephBootstrapKey := tuple "mds" "osd" "mon" "mgr" }}
|
||||||
{{- $jobName := print $cephBootstrapKey "-keyring-generator" }}
|
{{- $component := print $cephBootstrapKey "-keyring-generator" }}
|
||||||
|
{{- $jobName := print "ceph-" $component }}
|
||||||
|
|
||||||
{{- $serviceAccountName := print "ceph-" $jobName }}
|
{{- $serviceAccountName := print "ceph-" $jobName }}
|
||||||
{{ tuple $envAll "job_keyring_generator" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
|
{{ tuple $envAll "job_keyring_generator" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
|
||||||
@ -50,7 +51,7 @@ subjects:
|
|||||||
apiVersion: batch/v1
|
apiVersion: batch/v1
|
||||||
kind: Job
|
kind: Job
|
||||||
metadata:
|
metadata:
|
||||||
name: ceph-{{ $jobName }}
|
name: {{ $jobName }}
|
||||||
annotations:
|
annotations:
|
||||||
{{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }}
|
{{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }}
|
||||||
spec:
|
spec:
|
||||||
@ -59,6 +60,7 @@ spec:
|
|||||||
labels:
|
labels:
|
||||||
{{ tuple $envAll "ceph" $jobName | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }}
|
{{ tuple $envAll "ceph" $jobName | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }}
|
||||||
spec:
|
spec:
|
||||||
|
{{ dict "envAll" $envAll "application" "ceph" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }}
|
||||||
serviceAccountName: {{ $serviceAccountName }}
|
serviceAccountName: {{ $serviceAccountName }}
|
||||||
restartPolicy: OnFailure
|
restartPolicy: OnFailure
|
||||||
nodeSelector:
|
nodeSelector:
|
||||||
@ -66,9 +68,10 @@ spec:
|
|||||||
initContainers:
|
initContainers:
|
||||||
{{ tuple $envAll "job_keyring_generator" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
|
{{ tuple $envAll "job_keyring_generator" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
|
||||||
containers:
|
containers:
|
||||||
- name: ceph-{{ $jobName }}
|
- name: {{ $jobName }}
|
||||||
{{ tuple $envAll "ceph_config_helper" | include "helm-toolkit.snippets.image" | indent 10 }}
|
{{ tuple $envAll "ceph_config_helper" | include "helm-toolkit.snippets.image" | indent 10 }}
|
||||||
{{ tuple $envAll $envAll.Values.pod.resources.jobs.secret_provisioning | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
|
{{ tuple $envAll $envAll.Values.pod.resources.jobs.secret_provisioning | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
|
||||||
|
{{ dict "envAll" $envAll "application" "ceph" "container" "$jobName" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }}
|
||||||
env:
|
env:
|
||||||
- name: DEPLOYMENT_NAMESPACE
|
- name: DEPLOYMENT_NAMESPACE
|
||||||
valueFrom:
|
valueFrom:
|
||||||
|
@ -79,6 +79,22 @@ pod:
|
|||||||
ceph_storage_keys_generator:
|
ceph_storage_keys_generator:
|
||||||
allowPrivilegeEscalation: false
|
allowPrivilegeEscalation: false
|
||||||
readOnlyRootFilesystem: true
|
readOnlyRootFilesystem: true
|
||||||
|
ceph:
|
||||||
|
pod:
|
||||||
|
runAsUser: 65534
|
||||||
|
container:
|
||||||
|
ceph-mds-keyring-generator:
|
||||||
|
allowPrivilegeEscalation: false
|
||||||
|
readOnlyRootFilesystem: true
|
||||||
|
ceph-mgr-keyring-generator:
|
||||||
|
allowPrivilegeEscalation: false
|
||||||
|
readOnlyRootFilesystem: true
|
||||||
|
ceph-mon-keyring-generator:
|
||||||
|
allowPrivilegeEscalation: false
|
||||||
|
readOnlyRootFilesystem: true
|
||||||
|
ceph-osd-keyring-generator:
|
||||||
|
allowPrivilegeEscalation: false
|
||||||
|
readOnlyRootFilesystem: true
|
||||||
dns_policy: "ClusterFirstWithHostNet"
|
dns_policy: "ClusterFirstWithHostNet"
|
||||||
replicas:
|
replicas:
|
||||||
mon_check: 1
|
mon_check: 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user