Merge "Libvirt: Fix security context"

This commit is contained in:
Zuul 2019-04-22 16:17:39 +00:00 committed by Gerrit Code Review
commit 2f747ad6ba
2 changed files with 16 additions and 7 deletions

View File

@ -48,6 +48,7 @@ spec:
configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "helm-toolkit.utils.hash" }} configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "helm-toolkit.utils.hash" }}
configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "helm-toolkit.utils.hash" }} configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "helm-toolkit.utils.hash" }}
spec: spec:
{{ dict "envAll" $envAll "application" "libvirt" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }}
serviceAccountName: {{ $serviceAccountName }} serviceAccountName: {{ $serviceAccountName }}
nodeSelector: nodeSelector:
{{ .Values.labels.agent.libvirt.node_selector_key }}: {{ .Values.labels.agent.libvirt.node_selector_value }} {{ .Values.labels.agent.libvirt.node_selector_key }}: {{ .Values.labels.agent.libvirt.node_selector_value }}
@ -62,8 +63,7 @@ spec:
{{- if empty .Values.conf.ceph.cinder.keyring }} {{- if empty .Values.conf.ceph.cinder.keyring }}
- name: ceph-admin-keyring-placement - name: ceph-admin-keyring-placement
{{ tuple $envAll "libvirt" | include "helm-toolkit.snippets.image" | indent 10 }} {{ tuple $envAll "libvirt" | include "helm-toolkit.snippets.image" | indent 10 }}
securityContext: {{ dict "envAll" $envAll "application" "libvirt" "container" "ceph_admin_keyring_placement" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }}
runAsUser: 0
command: command:
- /tmp/ceph-admin-keyring.sh - /tmp/ceph-admin-keyring.sh
volumeMounts: volumeMounts:
@ -84,8 +84,7 @@ spec:
{{ end }} {{ end }}
- name: ceph-keyring-placement - name: ceph-keyring-placement
{{ tuple $envAll "libvirt" | include "helm-toolkit.snippets.image" | indent 10 }} {{ tuple $envAll "libvirt" | include "helm-toolkit.snippets.image" | indent 10 }}
securityContext: {{ dict "envAll" $envAll "application" "libvirt" "container" "ceph_keyring_placement" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }}
runAsUser: 0
env: env:
- name: CEPH_CINDER_USER - name: CEPH_CINDER_USER
value: "{{ .Values.conf.ceph.cinder.user }}" value: "{{ .Values.conf.ceph.cinder.user }}"
@ -115,9 +114,7 @@ spec:
- name: libvirt - name: libvirt
{{ tuple $envAll "libvirt" | include "helm-toolkit.snippets.image" | indent 10 }} {{ tuple $envAll "libvirt" | include "helm-toolkit.snippets.image" | indent 10 }}
{{ tuple $envAll $envAll.Values.pod.resources.libvirt | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} {{ tuple $envAll $envAll.Values.pod.resources.libvirt | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
securityContext: {{ dict "envAll" $envAll "application" "libvirt" "container" "libvirt" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }}
privileged: true
runAsUser: 0
{{- if .Values.conf.ceph.enabled }} {{- if .Values.conf.ceph.enabled }}
env: env:
- name: CEPH_CINDER_USER - name: CEPH_CINDER_USER

View File

@ -91,6 +91,18 @@ conf:
cgroup: "kubepods" cgroup: "kubepods"
pod: pod:
security_context:
libvirt:
pod:
runAsUser: 0
container:
ceph_admin_keyring_placement:
readOnlyRootFilesystem: false
ceph_keyring_placement:
readOnlyRootFilesystem: false
libvirt:
privileged: true
readOnlyRootFilesystem: false
affinity: affinity:
anti: anti:
type: type: