diff options
Diffstat (limited to '')
-rw-r--r-- | kubernetes/postgres/postgres-deployment.yaml | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/kubernetes/postgres/postgres-deployment.yaml b/kubernetes/postgres/postgres-deployment.yaml new file mode 100644 index 0000000..2711117 --- /dev/null +++ b/kubernetes/postgres/postgres-deployment.yaml @@ -0,0 +1,74 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: postgres + labels: + app: postgres +spec: + replicas: 1 + selector: + matchLabels: + app: postgres + template: + metadata: + labels: + app: postgres + spec: + containers: + - name: postgres + image: postgres:14.2-alpine3.15 + ports: + - containerPort: 5432 + env: + # - name: POSTGRES_USER + # valueFrom: + # secretKeyRef: + # name: postgres-secrets + # key: postgres-user + # optional: false + # - name: POSTGRES_DB + # valueFrom: + # secretKeyRef: + # name: postgres-secrets + # key: postgres-db + # optional: false + - name: POSTGRES_PASSWORD + valueFrom: + secretKeyRef: + name: postgres-secrets + key: postgres-password + optional: false + # - name: POSTGRES_INITDB_ARGS + # valueFrom: + # secretKeyRef: + # name: postgres-secrets + # key: postgres-initdb-args + # optional: false + - name: POSTGRES_HOST_AUTH_METHOD + valueFrom: + secretKeyRef: + name: postgres-secrets + key: postgres-host-auth-method + optional: false + volumeMounts: + - name: postgres-data + mountPath: /var/lib/postgres/data + volumes: + - name: postgres-data + persistentVolumeClaim: + claimName: postgres-data +--- +apiVersion: v1 +kind: Service +metadata: + name: postgres-service +spec: + selector: + app: postgres + type: LoadBalancer + ports: + - protocol: TCP + name: "5432" + port: 5432 + targetPort: 5432 + nodePort: 30432 |