forked from cloud-pi-native/tuto-java-infra-manifest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
postgres.yaml
69 lines (69 loc) · 1.69 KB
/
postgres.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
---
apiVersion: v1
kind: PersistentVolumeClaim # Create PVC
metadata:
name: postgresql-manifest-data-claim # Sets name of PV
spec:
accessModes:
- ReadWriteOnce # Sets read and write access
resources:
requests:
storage: 1Gi # Sets volume size
---
apiVersion: v1
kind: Service
metadata:
name: postgres-manifest # Sets service name
labels:
app: postgres-manifest # Labels and Selectors
spec:
type: ClusterIP # Sets service type
ports:
- port: 5432 # Sets port to run the postgres application
selector:
app: postgres-manifest
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: postgres-manifest # Sets Deployment name
spec:
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
app: postgres-manifest
template:
metadata:
labels:
app: postgres-manifest
spec:
containers:
- name: postgres
image: bitnami/postgresql:14.9.0
imagePullPolicy: "IfNotPresent"
ports:
- containerPort: 5432 # Exposes container port
env:
- name: "POSTGRES_USER"
value: "userdemomanifest"
- name: "POSTGRES_PASSWORD"
value: "My$ecrETPAss0rd*"
- name: POSTGRESQL_DATABASE
value: "demo"
volumeMounts:
- mountPath: /bitnami/postgresql
name: postgredb
resources:
requests:
memory: "256Mi"
cpu: "100m"
limits:
memory: "512Mi"
cpu: "500m"
restartPolicy: Always
volumes:
- name: postgredb
persistentVolumeClaim:
claimName: postgresql-manifest-data-claim