Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
spec:
containers:
- name: postgres
image: postgres:latest
envFrom:
- configMapRef:
name: postgres-config
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: postgres
spec:
serviceName: "postgres"
replicas: 2
selector:
matchLabels:
app: ecommerce
tier: postgres
template:
metadata:
labels:
app: ecommerce
tier: postgres
spec:
containers:
- name: postgres
image: postgres:latest
envFrom:
- configMapRef:
name: postgres-config
ports:
- containerPort: 5432
name: postgredb
volumeMounts:
- name: postgredb
mountPath: /var/lib/postgresql
subPath: postgres
volumeClaimTemplates:
- metadata:
name: postgredb
spec:
accessModes: ["ReadWriteOnce"]
resources:
requests:
storage: 1Gi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment