83a55fd19e
Change-Id: Id8dc3f86b8d6754df4ba3c0c720a78731e3f54d5
67 lines
1.8 KiB
YAML
67 lines
1.8 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:
|
|
restartPolicy: Never
|
|
containers:
|
|
- name: alerta-create-db
|
|
{{ tuple $envAll "alerta_create_db" | include "helm-toolkit.snippets.image" | 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 }}
|