Skip to content

Commit 637c4ab

Browse files
Add job to optionally create hydra db (#1339)
1 parent b688547 commit 637c4ab

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

plural/helm/plural/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
name: plural
33
description: A helm chart for installing plural
44
appVersion: 0.11.8
5-
version: 0.10.94
5+
version: 0.10.95
66
dependencies:
77
- name: hydra
88
version: 0.26.5

plural/helm/plural/templates/migration.yaml

+24
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,30 @@ spec:
5555
resources:
5656
{{- toYaml .Values.cron.resources | nindent 10 }}
5757
{{ end }}
58+
{{ if .Values.createHydraDb }}
59+
---
60+
apiVersion: batch/v1
61+
kind: Job
62+
metadata:
63+
name: create-hydra-db
64+
spec:
65+
template:
66+
spec:
67+
restartPolicy: Never
68+
serviceAccountName: plural
69+
containers:
70+
- name: createdb
71+
image: postgres:14
72+
command:
73+
- "/bin/sh"
74+
- "-c"
75+
- |
76+
psql "$POSTGRES_URL" -c "CREATE DATABASE hydra"
77+
envFrom:
78+
- secretRef:
79+
name: plural-env
80+
backoffLimit: 5
81+
{{ end }}
5882
---
5983
apiVersion: batch/v1
6084
kind: Job

0 commit comments

Comments
 (0)