-
Notifications
You must be signed in to change notification settings - Fork 1
/
5-gitlab-postgres.yaml
83 lines (82 loc) · 1.81 KB
/
5-gitlab-postgres.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: apps/v1
kind: StatefulSet
metadata:
name: postgres
namespace: gitlab
labels:
app: gitlab
spec:
selector:
matchLabels:
app: gitlab-postgres
serviceName: postgres
replicas: 1
volumeClaimTemplates:
- metadata:
name: postgres
namespace: gitlab
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 5Gi
selector:
matchLabels:
volume-name: gitlab-postgres
template:
metadata:
labels:
app: gitlab-postgres
spec:
nodeSelector:
gitlab: "true"
containers:
- name: postgresql
image: sameersbn/postgresql:10
envFrom:
- configMapRef:
name: postgres
- secretRef:
name: postgres
env:
- name: DB_EXTENSION
value: pg_trgm
resources:
limits:
cpu: "250m"
memory: "250Mi"
requests:
cpu: "250m"
memory: "125Mi"
ports:
- name: postgres
containerPort: 5432
volumeMounts:
- name: postgres
mountPath: /var/lib/postgresql
livenessProbe:
tcpSocket:
port: 5432
initialDelaySeconds: 30
periodSeconds: 10
readinessProbe:
exec:
command: ["pg_isready","-h","localhost","-U","postgres"]
initialDelaySeconds: 5
timeoutSeconds: 1
---
# -- Service for the Ingress to target
apiVersion: v1
kind: Service
metadata:
name: postgres
namespace: gitlab
labels:
app: gitlab
spec:
selector:
app: gitlab-postgres
ports:
- name: postgres
port: 5432
targetPort: 5432