-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeployment.yaml
112 lines (112 loc) · 2.68 KB
/
deployment.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
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
apiVersion: v1
kind: Namespace
metadata:
name: dump-system
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: database-data
namespace: dump-system
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
---
apiVersion: v1
kind: Secret
metadata:
name: dump-ipfs-key
namespace: dump-system
type: Opaque
stringData:
ENCRYPTION_KEY: "7Wky+OEIsaZXzJhTejN2OqYWJ6TBa64h"
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: database
namespace: dump-system
spec:
selector:
matchLabels:
app: database
replicas: 1
template:
metadata:
labels:
app: database
spec:
terminationGracePeriodSeconds: 60
volumes:
- name: data
persistentVolumeClaim:
claimName: database-data
containers:
- name: postgres
image: ghusta/postgres-world-db:2.10
volumeMounts:
- name: data
mountPath: /var/lib/postgresql/data
resources:
requests:
cpu: "500m"
memory: 500Mi
limits:
cpu: "500m"
memory: 500Mi
ports:
- name: postgres
containerPort: 5432
livenessProbe:
exec:
command:
- pg_isready
- -h
- localhost
- -U
- world
- -d
- world-db
initialDelaySeconds: 30
timeoutSeconds: 5
readinessProbe:
exec:
command:
- pg_isready
- -h
- localhost
- -U
- world
- -d
- world-db
initialDelaySeconds: 5
timeoutSeconds: 1
- name: ipfs-backup
image: pg-backup-ipfs:v0.0.1
env:
- name: ENCRYPTION_KEY
valueFrom:
secretKeyRef:
name: dump-ipfs-key
key: ENCRYPTION_KEY
- name: API_KEY
value: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJkaWQ6ZXRocjoweGJGN2RCRTU5RkUyNzEyMzMyQTIzREU2MTE3NTUzNzY5MzE2ZjFENzUiLCJpc3MiOiJ3ZWIzLXN0b3JhZ2UiLCJpYXQiOjE2OTAwMjEwNzE4NTcsIm5hbWUiOiJoYWNrYXRob24ifQ.NOvJIxbLrxAQvrG0Cp7F9ltmyZjT0EI_u8e28ruYFf4
command: ["/service/pg-backup-ipfs"]
args: ["0 */30 * * * *", "postgresql://world:world123@localhost:5432/world-db"]
---
apiVersion: v1
kind: Service
metadata:
name: database-service
namespace: dump-system
spec:
type: ClusterIP
selector:
app: database
ports:
- name: postgres
port: 5432
targetPort: postgres