forked from jfrog/artifactory-docker-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpostgresql.yml
81 lines (81 loc) · 1.89 KB
/
postgresql.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
72
73
74
75
76
77
78
79
80
81
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: postgresql-k8s-deployment
spec:
replicas: 1
template:
metadata:
labels:
app: postgresql-k8s
group: artifactory-k8s-demo
spec:
initContainers:
- name: "remove-lost-found"
image: "busybox:1.26.2"
imagePullPolicy: "IfNotPresent"
command:
- 'sh'
- '-c'
- 'rm -rf /var/lib/postgresql/data/lost+found'
volumeMounts:
- mountPath: "/var/lib/postgresql/data"
name: postgresql-volume
containers:
- name: postgresql-k8s
image: docker.bintray.io/postgres:9.6.11
env:
- name: POSTGRES_DB
value: artifactory
- name: POSTGRES_USER
value: artifactory
- name: POSTGRES_PASSWORD
value: password
ports:
- containerPort: 5432
resources:
requests:
memory: "500Mi"
cpu: "100m"
limits:
memory: "1Gi"
cpu: "500m"
volumeMounts:
- mountPath: "/var/lib/postgresql/data"
name: postgresql-volume
livenessProbe:
exec:
command:
- sh
- -c
- exec pg_isready
initialDelaySeconds: 60
timeoutSeconds: 5
failureThreshold: 6
readinessProbe:
exec:
command:
- sh
- -c
- exec pg_isready
initialDelaySeconds: 30
timeoutSeconds: 3
periodSeconds: 5
volumes:
- name: postgresql-volume
persistentVolumeClaim:
claimName: postgresql-claim
---
apiVersion: v1
kind: Service
metadata:
name: postgresql-k8s-service
labels:
app: postgresql-k8s-service
group: artifactory-k8s-demo
spec:
ports:
- port: 5432
protocol: TCP
selector:
app: postgresql-k8s