-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathk8s-postgres.yaml
More file actions
90 lines (89 loc) · 1.83 KB
/
k8s-postgres.yaml
File metadata and controls
90 lines (89 loc) · 1.83 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
---
# PostgreSQL StatefulSet for Current beta
apiVersion: v1
kind: Service
metadata:
name: postgres
namespace: current-beta
labels:
app: current
component: postgres
spec:
ports:
- port: 5432
name: postgres
clusterIP: None
selector:
app: current
component: postgres
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: postgres
namespace: current-beta
labels:
app: current
component: postgres
spec:
serviceName: postgres
replicas: 1
selector:
matchLabels:
app: current
component: postgres
template:
metadata:
labels:
app: current
component: postgres
spec:
containers:
- name: postgres
image: postgres:16-alpine
ports:
- containerPort: 5432
name: postgres
env:
- name: POSTGRES_DB
value: current
- name: POSTGRES_USER
value: current
- name: POSTGRES_PASSWORD
value: current-beta-password
- name: PGDATA
value: /var/lib/postgresql/data/pgdata
volumeMounts:
- name: postgres-storage
mountPath: /var/lib/postgresql/data
resources:
requests:
cpu: 100m
memory: 256Mi
limits:
cpu: 1000m
memory: 1Gi
livenessProbe:
exec:
command:
- pg_isready
- -U
- current
initialDelaySeconds: 30
periodSeconds: 10
readinessProbe:
exec:
command:
- pg_isready
- -U
- current
initialDelaySeconds: 5
periodSeconds: 5
volumeClaimTemplates:
- metadata:
name: postgres-storage
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 10Gi