forked from joedborg/django-kubernetes-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
postgres.yaml.tmpl
68 lines (67 loc) · 1.22 KB
/
postgres.yaml.tmpl
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
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: postgres-data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: postgres-data-volume
spec:
accessModes:
- ReadWriteOnce
capacity:
storage: 5Gi
gcePersistentDisk:
pdName: pg-data
fsType: ext4
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: postgres
spec:
replicas: 1
template:
metadata:
labels:
name: postgres
spec:
containers:
- name: postgres
image: gcr.io/<PROJECT>/postgres-pw:v1
imagePullPolicy: IfNotPresent
ports:
- containerPort: 5432
volumeMounts:
- name: postgresdata
mountPath: /usr/local/var/postgres
- name: secrets
mountPath: /etc/secrets
readOnly: true
volumes:
- name: postgresdata
persistentVolumeClaim:
claimName: postgres-data
- name: secrets
secret:
secretName: db-passwords
---
metadata:
name: postgres
kind: Service
apiVersion: v1
spec:
ports:
- name: postgres
protocol: TCP
port: 5432
targetPort: 5432
selector:
name: postgres