-
Notifications
You must be signed in to change notification settings - Fork 1
/
db_statefulset.yaml
48 lines (48 loc) · 1.17 KB
/
db_statefulset.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
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: postgresql
labels:
app: postgresql
spec:
serviceName: "postgresql"
replicas: 1
selector:
matchLabels:
app: postgresql
template:
metadata:
labels:
app: postgresql
spec:
containers:
- name: postgresql
image: postgres:15
imagePullPolicy: IfNotPresent
resources:
limits:
cpu: 1000m
ephemeral-storage: 1000Mi
memory: 1000Mi
requests:
cpu: 100m
ephemeral-storage: 100Mi
memory: 100Mi
ports:
- containerPort: 5432
volumeMounts:
- name: postgres-storage
mountPath: /var/lib/postgresql/data
env:
- name: POSTGRES_USER
value: yourusername
- name: POSTGRES_PASSWORD
value: yourpassword
- name: POSTGRES_DB
value: YourDatabaseName
- name: HOST
value: "postgresql"
volumes:
- name: postgres-storage
persistentVolumeClaim:
claimName: postgres-pvc