-
Notifications
You must be signed in to change notification settings - Fork 55
/
Copy pathpostgres.yml
71 lines (69 loc) · 1.51 KB
/
postgres.yml
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
---
kind: Service
apiVersion: v1
metadata:
name: imagetagger-postgres
labels:
tier: database
spec:
selector:
tier: database
ports:
- name: postgres
port: 5432
targetPort: postgres
---
kind: Deployment
apiVersion: apps/v1
metadata:
name: imagetagger-postgres
labels:
tier: database
spec:
selector:
matchLabels:
tier: database
template:
metadata:
labels:
tier: database
spec:
automountServiceAccountToken: false
volumes:
- name: data
persistentVolumeClaim:
claimName: imagetagger-database
containers:
- name: main
image: docker.io/postgres:12
imagePullPolicy: Always
envFrom:
- configMapRef:
name: imagetagger-postgres
env:
# postgres recommends putting the actual data in a sub-folder if it is mounted from external sources
- name: PGDATA
value: /var/lib/postgresql/data/pgdata
volumeMounts:
- name: data
mountPath: /var/lib/postgresql/data
ports:
- name: postgres
containerPort: 5432
livenessProbe:
tcpSocket:
port: postgres
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: imagetagger-database
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 1Gi # should be enough even for large instances
selector:
matchLabels:
tier: database