-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathmanifest.yaml
More file actions
125 lines (124 loc) · 2.45 KB
/
manifest.yaml
File metadata and controls
125 lines (124 loc) · 2.45 KB
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
apiVersion: v1
kind: Service
metadata:
labels:
app: postgres
name: postgres
spec:
ports:
- name: postgres
port: 5434
protocol: TCP
targetPort: 5432
selector:
app: postgres
type: ClusterIP
---
apiVersion: v1
kind: Service
metadata:
labels:
app: webapp
name: webapp
spec:
ports:
- name: webapp
port: 5000
protocol: TCP
targetPort: 5000
selector:
app: webapp
type: ClusterIP
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: postgres
spec:
replicas: 1
selector:
matchLabels:
app: postgres
serviceName: postgres
template:
metadata:
labels:
app: postgres
spec:
containers:
- env:
- name: POSTGRES_DB
value: postgresdb
- name: POSTGRES_USER
value: postgres
- name: PGUSER
value: postgres
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
key: postgres
name: postgres-passwords
- name: POD_IP
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: status.podIP
image: docker.io/library/postgres:11.11-alpine
imagePullPolicy: IfNotPresent
name: postgres
ports:
- containerPort: 5432
readinessProbe:
exec:
command:
- sh
- -c
- exec pg_isready --host $POD_IP
failureThreshold: 3
initialDelaySeconds: 5
periodSeconds: 5
successThreshold: 1
timeoutSeconds: 3
volumeMounts:
- mountPath: /var/lib/postgresql/data
name: postgres
subPath: data
volumeClaimTemplates:
- metadata:
name: postgres
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
storageClassName: gold
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: webapp
spec:
replicas: 1
selector:
matchLabels:
app: webapp
serviceName: webapp
template:
metadata:
annotations:
labels:
app: webapp
spec:
containers:
- name: webapp
image: gcr.io/on-prem-test-314219/interview-project/webapp:latest
imagePullPolicy: Always
ports:
- containerPort: 5000
env:
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
key: postgres
name: postgres-passwords