Skip to content

Instantly share code, notes, and snippets.

@ipedrazas
Forked from resouer/pod1.yml
Created November 10, 2015 13:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ipedrazas/c35e8c67c92b7432cf19 to your computer and use it in GitHub Desktop.
Save ipedrazas/c35e8c67c92b7432cf19 to your computer and use it in GitHub Desktop.
How to implement volumes-from in Kubernetes Pod?
---
apiVersion: v1
kind: Pod
metadata:
name: server
spec:
containers:
- image: resouer/sample:v2
name: war
lifecycle:
postStart:
exec:
command:
- "cp"
- "/sample.war"
- "/app"
volumeMounts:
- mountPath: /app
name: hostv1
- name: peer
image: busybox
command: ["tail", "-f", "/dev/null"]
volumeMounts:
- name: hostv2
mountPath: /app/sample.war
volumes:
- name: hostv1
hostPath:
path: /tmp
- name: hostv2
hostPath:
path: /tmp/sample.war
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment