-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpostgres-deployment.yaml
More file actions
34 lines (34 loc) · 946 Bytes
/
postgres-deployment.yaml
File metadata and controls
34 lines (34 loc) · 946 Bytes
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
apiVersion: apps/v1
kind: Deployment # Create a deployment
metadata:
name: postgres # Set the name of the deployment
spec:
replicas: 1
selector:
matchLabels:
app: postgres
template:
metadata:
labels:
app: postgres
spec:
containers:
- name: postgres
image: postgres:13.5-alpine # Docker image
imagePullPolicy: "IfNotPresent"
ports:
- containerPort: 5432 # Exposing the container port 5432 for PostgreSQL client connections.
env:
- name: POSTGRES_USER
value: awms
- name: POSTGRES_PASSWORD
value: therootpassword
- name: POSTGRES_DB
value: awms
volumeMounts:
- mountPath: /var/lib/postgresql/data
name: postgresdata
volumes:
- name: postgresdata
persistentVolumeClaim:
claimName: postgres-pvc