Skip to content

Instantly share code, notes, and snippets.

@sandromello
Created December 6, 2023 19:00
Show Gist options
  • Save sandromello/ab8b3c5c7728df0d0f3023a944063793 to your computer and use it in GitHub Desktop.
Save sandromello/ab8b3c5c7728df0d0f3023a944063793 to your computer and use it in GitHub Desktop.
Postgres Deployment
apiVersion: apps/v1
kind: Deployment
metadata:
name: postgres
spec:
replicas: 1
selector:
matchLabels:
app: postgres
strategy:
type: Recreate
template:
metadata:
labels:
app: postgres
spec:
containers:
- env:
- name: POSTGRES_USER
value: root
- name: POSTGRES_PASSWORD
value: 1a2b3c4d
- name: POSTGRES_DB
value: hoopdb
image: postgres
name: postgres
ports:
- containerPort: 5432
name: pg
protocol: TCP
---
apiVersion: v1
kind: Service
metadata:
name: pg
spec:
ports:
- name: pg
port: 5432
protocol: TCP
targetPort: 5432
selector:
app: postgres
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment