Implement Security Context for Glance

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

Change-Id: I32b63226f5f2bcfff09f0b6760f5475ef7d1b5b5
This commit is contained in:
pd2839 2019-03-18 14:19:21 -05:00 committed by PRATEEK REDDY DODDA
parent e7b06a4076
commit 1d0e21e370
3 changed files with 12 additions and 6 deletions

View File

@ -92,8 +92,7 @@ spec:
- name: glance-api - name: glance-api
{{ tuple $envAll "glance_api" | include "helm-toolkit.snippets.image" | indent 10 }} {{ tuple $envAll "glance_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" "glance" "container" "glance_api" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }}
allowPrivilegeEscalation: false
command: command:
- /tmp/glance-api.sh - /tmp/glance-api.sh
- start - start

View File

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

View File

@ -786,9 +786,17 @@ endpoints:
namespace: kube-public namespace: kube-public
pod: pod:
user: security_context:
glance: glance:
uid: 42424 pod:
runAsUser: 42424
container:
glance_api:
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
glance_registry:
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
affinity: affinity:
anti: anti:
type: type: