mirror of
https://github.com/Sheldan/OnePlusBot.git
synced 2026-01-26 11:21:25 +00:00
[OPB-xxx] adding configuration and changing structure for k8s deployment
This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
{{- if .Values.dbConfigDeployment.enabled -}}
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
{{- $deploymentJobName := print ((include "oneplusBot.fullname" .) | trunc 39) "-db-config-deployment-job" }}
|
||||
name: {{ $deploymentJobName | trunc 63 }}
|
||||
annotations:
|
||||
"helm.sh/hook": pre-upgrade,pre-install
|
||||
"helm.sh/hook-weight": "-5"
|
||||
"helm.sh/hook-delete-policy": hook-succeeded
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
{{- with .Values.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: db-config-deployment-job
|
||||
image: "{{ $.Values.dbConfigDeployment.repository }}/{{ $.Values.dbConfigDeployment.image }}:{{ $.Values.dbConfigDeployment.tag | default .Chart.AppVersion}}"
|
||||
imagePullPolicy: {{ $.Values.dbConfigDeployment.pullPolicy }}
|
||||
args:
|
||||
- "/var/db-config/"
|
||||
env:
|
||||
- name: DB_PASS
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: db-credentials
|
||||
key: dbPassword
|
||||
- name: DB_HOST
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: db-credentials
|
||||
key: dbHost
|
||||
- name: DB_PORT
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: db-credentials
|
||||
key: dbPort
|
||||
- name: DB_USER
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: db-credentials
|
||||
key: dbUser
|
||||
- name: DB_NAME
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: db-credentials
|
||||
key: dbName
|
||||
- name: DB_SCHEME
|
||||
value: "abstracto"
|
||||
volumeMounts:
|
||||
- mountPath: "/var/db-config/"
|
||||
name: database-config-mount
|
||||
restartPolicy: Never
|
||||
initContainers:
|
||||
- name: database-config-data
|
||||
image: "{{ $.Values.dbConfigDeploymentData.repository }}/{{ $.Values.dbConfigDeploymentData.image }}:{{ $.Values.dbConfigDeploymentData.tag | default .Chart.AppVersion}}"
|
||||
imagePullPolicy: {{ $.Values.dbConfigDeploymentData.pullPolicy }}
|
||||
volumeMounts:
|
||||
- mountPath: "/var/run-config"
|
||||
name: database-config-mount
|
||||
volumes:
|
||||
- name: database-config-mount
|
||||
emptyDir: {}
|
||||
backoffLimit: 4
|
||||
{{- end }}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user