chore: upgrade to Postgres 15 and add init-script
This commit is contained in:
+31
-1
@@ -7,6 +7,30 @@ data:
|
|||||||
DB_PORT: "5432"
|
DB_PORT: "5432"
|
||||||
DB_USER: "postgres"
|
DB_USER: "postgres"
|
||||||
---
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: postgres-init
|
||||||
|
data:
|
||||||
|
initdb.sh: |-
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
|
||||||
|
CREATE DATABASE schemas WITH OWNER postgres ENCODING utf8;
|
||||||
|
CREATE DATABASE accounting WITH OWNER postgres ENCODING utf8;
|
||||||
|
CREATE DATABASE authz WITH OWNER postgres ENCODING utf8;
|
||||||
|
CREATE DATABASE company WITH OWNER postgres ENCODING utf8;
|
||||||
|
CREATE DATABASE consumer WITH OWNER postgres ENCODING utf8;
|
||||||
|
CREATE DATABASE employee WITH OWNER postgres ENCODING utf8;
|
||||||
|
CREATE DATABASE invoice WITH OWNER postgres ENCODING utf8;
|
||||||
|
CREATE DATABASE notification WITH OWNER postgres ENCODING utf8;
|
||||||
|
CREATE DATABASE salary WITH OWNER postgres ENCODING utf8;
|
||||||
|
CREATE DATABASE time WITH OWNER postgres ENCODING utf8;
|
||||||
|
CREATE DATABASE dancefinder WITH OWNER postgres ENCODING utf8;
|
||||||
|
CREATE DATABASE hifi WITH OWNER postgres ENCODING utf8;
|
||||||
|
EOSQL
|
||||||
|
---
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
@@ -23,7 +47,7 @@ spec:
|
|||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: postgres
|
- name: postgres
|
||||||
image: postgres:12.0
|
image: argoyle/postgres-sv_se:15
|
||||||
imagePullPolicy: "IfNotPresent"
|
imagePullPolicy: "IfNotPresent"
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
@@ -42,10 +66,16 @@ spec:
|
|||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: data
|
- name: data
|
||||||
mountPath: /var/lib/postgresql/data
|
mountPath: /var/lib/postgresql/data
|
||||||
|
- mountPath: /docker-entrypoint-initdb.d/initdb.sh
|
||||||
|
name: initdb
|
||||||
|
subPath: initdb.sh
|
||||||
volumes:
|
volumes:
|
||||||
- name: data
|
- name: data
|
||||||
hostPath:
|
hostPath:
|
||||||
path: /data/postgres
|
path: /data/postgres
|
||||||
|
- name: initdb
|
||||||
|
configMap:
|
||||||
|
name: postgres-init
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
|
|||||||
Reference in New Issue
Block a user