Merge "Implement Security Context for Cinder"

This commit is contained in:
Zuul 2019-03-22 21:18:29 +00:00 committed by Gerrit Code Review
commit ee477d4562
5 changed files with 20 additions and 8 deletions

View File

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

View File

@ -130,6 +130,7 @@ spec:
- name: cinder-backup - name: cinder-backup
{{ tuple $envAll "cinder_backup" | include "helm-toolkit.snippets.image" | indent 10 }} {{ 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 }} {{ 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: securityContext:
capabilities: capabilities:
add: add:

View File

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

View File

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

View File

@ -77,9 +77,23 @@ jobs:
failed: 1 failed: 1
pod: pod:
user: security_context:
cinder: 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: affinity:
anti: anti:
type: type: