-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpostgresql-workload.yml
94 lines (94 loc) · 2.18 KB
/
postgresql-workload.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
82
83
84
85
86
87
88
89
90
91
92
93
94
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: pvc-postgresql-data
namespace: airflow
annotations:
everest.io/disk-volume-type: SAS # EVS disk type.
labels:
# Region of the node where the application is to be deployed.
failure-domain.beta.kubernetes.io/region: sa-brazil-1
# AZ of the node where the application is to be deployed.
failure-domain.beta.kubernetes.io/zone: sa-brazil-1a
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
storageClassName: csi-disk
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
annotations:
description: ''
labels:
appgroup: ''
version: v1
name: postgresql
namespace: airflow
spec:
selector:
matchLabels:
app: postgresql
version: v1
template:
metadata:
labels:
app: postgresql
version: v1
spec:
containers:
- name: postgresql
image: docker.io/postgres:14.10-alpine3.19
imagePullPolicy: IfNotPresent
env:
- name: POSTGRES_PASSWORD
value: G35*******************BgH
- name: POSTGRES_USER
value: airflow
- name: POSTGRES_DB
value: airflow
- name: PGDATA
value: /var/lib/postgresql/data/pgdata
volumeMounts:
- name: pvc-postgresql-data
mountPath: /var/lib/postgresql/data
resources:
requests:
cpu: 250m
memory: 512Mi
limits: {}
terminationGracePeriodSeconds: 30
dnsPolicy: ClusterFirst
volumes:
- name: pvc-postgresql-data
persistentVolumeClaim:
claimName: pvc-postgresql-data
initContainers: []
serviceName: postgresql
replicas: 1
---
apiVersion: v1
kind: Service
metadata:
name: postgresql
labels:
app: postgresql
version: v1
namespace: airflow
annotations:
service.alpha.kubernetes.io/tolerate-unready-endpoints: 'true'
spec:
selector:
app: postgresql
version: v1
clusterIP: None
ports:
- name: postgresql
targetPort: 5432
nodePort: 0
port: 5432
protocol: TCP
type: ClusterIP