2021-06-16 22:27:40 -06:00
|
|
|
apiVersion: apps/v1
|
|
|
|
kind: StatefulSet
|
|
|
|
metadata:
|
|
|
|
name: postgres
|
|
|
|
spec:
|
|
|
|
serviceName: postgres
|
|
|
|
replicas: 1
|
|
|
|
selector:
|
|
|
|
matchLabels:
|
|
|
|
app: postgres
|
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
labels:
|
|
|
|
app: postgres
|
|
|
|
spec:
|
|
|
|
containers:
|
|
|
|
- name: postgres
|
2021-11-13 01:11:55 -07:00
|
|
|
image: "postgres:13"
|
|
|
|
imagePullPolicy: IfNotPresent
|
|
|
|
env:
|
|
|
|
- name: POSTGRES_PASSWORD
|
|
|
|
valueFrom:
|
|
|
|
secretKeyRef:
|
|
|
|
name: postgresql
|
|
|
|
key: password
|
|
|
|
- name: POSTGRES_USER
|
|
|
|
value: headscale
|
|
|
|
ports:
|
|
|
|
- name: postgres
|
|
|
|
protocol: TCP
|
|
|
|
containerPort: 5432
|
|
|
|
livenessProbe:
|
|
|
|
tcpSocket:
|
|
|
|
port: 5432
|
|
|
|
initialDelaySeconds: 30
|
|
|
|
timeoutSeconds: 5
|
|
|
|
periodSeconds: 15
|
|
|
|
volumeMounts:
|
|
|
|
- name: pgdata
|
|
|
|
mountPath: /var/lib/postgresql/data
|
2021-06-16 22:27:40 -06:00
|
|
|
volumeClaimTemplates:
|
2021-11-13 01:11:55 -07:00
|
|
|
- metadata:
|
|
|
|
name: pgdata
|
|
|
|
spec:
|
|
|
|
storageClassName: local-path
|
|
|
|
accessModes: ["ReadWriteOnce"]
|
|
|
|
resources:
|
|
|
|
requests:
|
|
|
|
storage: 1Gi
|