Skip to content

Instantly share code, notes, and snippets.

@rbudiharso
Created December 11, 2019 03:44
Show Gist options
  • Save rbudiharso/693be1aa3e584324d1b19035cc3b58de to your computer and use it in GitHub Desktop.
Save rbudiharso/693be1aa3e584324d1b19035cc3b58de to your computer and use it in GitHub Desktop.
---
apiVersion: v1
kind: Secret
metadata:
name: hello-secret
type: Opaque
data:
SECRET_VALUE: SGVsbG8gU2VjcmV0
# SGVsbG8gU2VjcmV0 is 'Hello Secret'
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: node-hello-world
spec:
replicas: 1
selector:
matchLabels:
app: node-hello-world
template:
metadata:
labels:
app: node-hello-world
spec:
containers:
- name: node-hello-world
image: rbudiharso/node-hello-world
imagePullPolicy: IfNotPresent
ports:
- containerPort: 3000
env:
- name: SECRET_VALUE
valueFrom:
secretKeyRef:
name: hello-secret
key: SECRET_VALUE
volumes:
- name: env
secret:
secretName: hello-secret
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment