openstack-helm-infra/alerta/templates/create_db.yaml
KHIYANI, RAHUL (rk0850) b4d0793b98 Add pod/contianer security context template to create_db.yaml
This enables the runAsUser and ReadOnly-fs flags overridden in
values.yaml

Change-Id: I2e5cbd57f90ef1f5c09b7a54cd04d92dcfd8edc5
2020-10-22 20:50:25 +00:00

69 lines
2.1 KiB
YAML

{{/*
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
*/}}
{{- if .Values.manifests.alerta.create_db }}
{{- $envAll := . }}
---
apiVersion: v1
kind: Pod
metadata:
name: alerta-create-db
spec:
{{ dict "envAll" $envAll "application" "alerta_create_db" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 2 }}
restartPolicy: Never
containers:
- name: alerta-create-db
{{ tuple $envAll "alerta_create_db" | include "helm-toolkit.snippets.image" | indent 4 }}
{{ dict "envAll" $envAll "application" "alerta_create_db" "container" "alerta_create_db" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 4 }}
env:
- name: DB_FQDN
valueFrom:
secretKeyRef:
name: {{ .Values.secrets.postgresql.admin }}
key: DATABASE_HOST
- name: DB_PORT
valueFrom:
secretKeyRef:
name: {{ .Values.secrets.postgresql.admin }}
key: DATABASE_PORT
- name: DB_ADMIN_USER
valueFrom:
secretKeyRef:
name: {{ .Values.secrets.postgresql.admin }}
key: POSTGRES_USER
- name: ADMIN_PASSWORD
valueFrom:
secretKeyRef:
name: {{ .Values.secrets.postgresql.admin }}
key: POSTGRES_PASSWORD
command:
- /tmp/create_db.sh
volumeMounts:
- name: pod-tmp
mountPath: /tmp
- name: alerta-bin
mountPath: /tmp/create_db.sh
subPath: create_db.sh
readOnly: true
volumes:
- name: pod-tmp
emptyDir: {}
- name: alerta-bin
secret:
secretName: alerta-bin
defaultMode: 0555
{{- end }}