{{/* # # 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 }}