Skip to content

Instantly share code, notes, and snippets.

@cesarvr cesarvr/pod.yml
Last active Nov 19, 2017

Embed
What would you like to do?
simple pod
apiVersion: v1
kind: Pod
metadata:
name: node-dev
labels:
app: node-js-dev
spec:
containers:
- name: nodejs
image: 172.30.1.1:5000/devel/cvr-node
command: ['/bin/sh', '-c']
args:
- cd /app/;
echo folder:$PWD;
npm install;
nodemon $(node -e "console.log(require('./package.json').main)")
volumeMounts:
- mountPath: /app
name: app-volume
- mountPath: /.npm
name: npm-cache
ports:
- containerPort: 8080
initContainers: # This is the init container it will wait until app/ folder is in sync.
- name: folder
image: busybox
command: ['/bin/sh', '-c']
args: ['until [ "$(ls -A ./app/)" ]; do echo "waiting for user to push..."; sleep 2; done']
volumeMounts:
- mountPath: /app
name: app-volume
volumes:
- name: app-volume
emptyDir: {}
- name: npm-cache
emptyDir: {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.