initial commit
Signed-off-by: Ava Affine <ava@sunnypup.io>
This commit is contained in:
commit
aca076e864
21 changed files with 1558 additions and 0 deletions
87
templates/postgres.yaml
Normal file
87
templates/postgres.yaml
Normal file
|
|
@ -0,0 +1,87 @@
|
|||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: postgres-configuration
|
||||
labels:
|
||||
app: postgres
|
||||
data:
|
||||
POSTGRES_DB: {{ .Values.pg.db }}
|
||||
POSTGRES_USER: {{ .Values.pg.user }}
|
||||
POSTGRES_PASSWORD: {{ .Values.pg.pass }}
|
||||
POSTGRES_INITDB_ARGS: "--locale=C --encoding=UTF-8"
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: postgres-pv
|
||||
labels:
|
||||
pvc_type: postgres-pv
|
||||
spec:
|
||||
capacity:
|
||||
storage: 80Gi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
persistentVolumeReclaimPolicy: Retain
|
||||
hostPath:
|
||||
path: {{ .Values.pg.path }}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: postgres-pvc
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
storageClassName: ""
|
||||
volumeMode: Filesystem
|
||||
volumeName: postgres-pv
|
||||
resources:
|
||||
requests:
|
||||
storage: 80Gi
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: postgres
|
||||
labels:
|
||||
app: postgres
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: postgres
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: postgres
|
||||
spec:
|
||||
containers:
|
||||
- name: postgres
|
||||
image: postgres:14.6
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: postgres-configuration
|
||||
ports:
|
||||
- containerPort: 5432
|
||||
name: postgres-tcp
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /var/lib/postgresql/data
|
||||
volumes:
|
||||
- name: data
|
||||
persistentVolumeClaim:
|
||||
claimName: postgres-pvc
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: postgres
|
||||
labels:
|
||||
app: postgres
|
||||
spec:
|
||||
clusterIP: None
|
||||
ports:
|
||||
- port: 5432
|
||||
name: postgres-tcp
|
||||
type: ClusterIP
|
||||
selector:
|
||||
app: postgres
|
||||
Loading…
Add table
Add a link
Reference in a new issue