Skip to content

Instantly share code, notes, and snippets.

@cahyowhy
Last active April 12, 2021 05:12
Show Gist options
  • Save cahyowhy/e4cfe3810b41597b8140eb2d5bfcbe69 to your computer and use it in GitHub Desktop.
Save cahyowhy/e4cfe3810b41597b8140eb2d5bfcbe69 to your computer and use it in GitHub Desktop.
hello-deployment-vol.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: hello
labels:
app: hello
spec:
replicas: 2
selector:
matchLabels:
app: hello
template: # pod template follows
metadata:
labels:
app: hello
spec:
containers:
- name: hello
image: cahyowhy/junk:1.0
envFrom:
- configMapRef:
name: hello-config
- secretRef:
name: hello-secret
volumeMounts:
- name: data-vol
mountPath: /testdata # mounted inside pod/container
volumes:
- name: data-vol
hostPath:
path: /d/script/go-simple-docker-kube-hello-deployment-vol/testdata # actual path on this machine [host path] [in production we would use awsElasticBlockStore or gcePersistendDisk]
terminationGracePeriodSeconds: 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment