Implement Security Context for Cinder

Implement container security context for the following Cinder resources:
 - Cinder server deployment

Change-Id: Ic319fc8ccfea4c8d640ceecd0bbc93912173d172
This commit is contained in:
pd2839 2019-02-26 14:51:37 -06:00 committed by PRATEEK REDDY DODDA
parent 00fff1d274
commit ba593e1a6b
5 changed files with 20 additions and 8 deletions

View File

@ -73,8 +73,7 @@ spec:
- name: cinder-api
{{ tuple $envAll "cinder_api" | include "helm-toolkit.snippets.image" | indent 10 }}
{{ tuple $envAll $envAll.Values.pod.resources.api | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
securityContext:
allowPrivilegeEscalation: false
{{ dict "envAll" $envAll "application" "cinder" "container" "cinder-api" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }}
command:
- /tmp/cinder-api.sh
- start

View File

@ -130,6 +130,7 @@ spec:
- name: cinder-backup
{{ tuple $envAll "cinder_backup" | include "helm-toolkit.snippets.image" | indent 10 }}
{{ tuple $envAll $envAll.Values.pod.resources.backup | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
{{ dict "envAll" $envAll "application" "cinder" "container" "cinder-backup" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }}
securityContext:
capabilities:
add:

View File

@ -72,8 +72,7 @@ spec:
- name: cinder-scheduler
{{ tuple $envAll "cinder_scheduler" | include "helm-toolkit.snippets.image" | indent 10 }}
{{ tuple $envAll $envAll.Values.pod.resources.scheduler | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
securityContext:
allowPrivilegeEscalation: false
{{ dict "envAll" $envAll "application" "cinder" "container" "cinder-scheduler" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }}
command:
- /tmp/cinder-scheduler.sh
volumeMounts:

View File

@ -94,8 +94,7 @@ spec:
- name: cinder-volume
{{ tuple $envAll "cinder_volume" | include "helm-toolkit.snippets.image" | indent 10 }}
{{ tuple $envAll $envAll.Values.pod.resources.volume | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
securityContext:
allowPrivilegeEscalation: true
{{ dict "envAll" $envAll "application" "cinder" "container" "cinder-volume" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }}
command:
- /tmp/cinder-volume.sh
volumeMounts:

View File

@ -77,9 +77,23 @@ jobs:
failed: 1
pod:
user:
security_context:
cinder:
uid: 42424
pod:
runAsUser: 42424
container:
cinder_api:
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
cinder_backup:
redOnlyRootFilesystem: true
allowPrivilegeEscalation: false
cinder_scheduler:
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
cinder_volume:
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
affinity:
anti:
type: