Skip to content

Instantly share code, notes, and snippets.

@xcoulon
Created November 19, 2017 15:50
Show Gist options
  • Save xcoulon/546e7b4c1645c0936f12a487217d2a42 to your computer and use it in GitHub Desktop.
Save xcoulon/546e7b4c1645c0936f12a487217d2a42 to your computer and use it in GitHub Desktop.
Managing Pod configuration using ConfigMaps and Secrets in Kubernetes (resource for the story on Medium)
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: postgres
spec:
template:
metadata:
labels:
app: postgres
spec:
containers:
- name: postgres
image: postgres:9.6.5
ports:
- containerPort: 5432
env:
- name: POSTGRES_DB
valueFrom:
secretKeyRef:
name: database-secret-config
key: dbname
- name: POSTGRES_USER
valueFrom:
secretKeyRef:
name: database-secret-config
key: username
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: database-secret-config
key: password
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment