forked from vishnoisuresh/netbox-kubernetes
-
Notifications
You must be signed in to change notification settings - Fork 8
/
postgres-all.yaml
83 lines (79 loc) · 1.57 KB
/
postgres-all.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: postgres
labels:
backend: postgres
spec:
replicas: 1
template:
metadata:
labels:
backend: postgres
spec:
containers:
- image: postgres:10-alpine
name: postgres
ports:
- containerPort: 5432
env:
- name: POSTGRES_DB
valueFrom:
configMapKeyRef:
key: POSTGRES_DB
name: postgres-env
- name: POSTGRES_USER
valueFrom:
configMapKeyRef:
key: POSTGRES_USER
name: postgres-env
- name: POSTGRES_PASSWORD
valueFrom:
configMapKeyRef:
key: POSTGRES_PASSWORD
name: postgres-env
volumeMounts:
- name: netbox-pg-backups
mountPath: /var/lib/backups
volumes:
- name: netbox-pg-backups
persistentVolumeClaim:
claimName: netbox-pg-backups
restartPolicy: Always
---
apiVersion: v1
kind: Service
metadata:
name: postgres
labels:
backend: postgres
spec:
clusterIP: None
ports:
- name: headless
port: 5432
targetPort: 5432
selector:
backend: postgres
---
apiVersion: v1
kind: ConfigMap
metadata:
name: postgres-env
data:
POSTGRES_DB: netbox
POSTGRES_USER: netbox
POSTGRES_PASSWORD: J5brHrAXFLQSif0K
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: netbox-pg-backups
labels:
pvcname: netbox-pg-backups
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 40Gi