Skip to content

Instantly share code, notes, and snippets.

@cesarvr
Last active November 19, 2017 14:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cesarvr/2dedd0bb912be441aa98b67e1ac4bcc6 to your computer and use it in GitHub Desktop.
Save cesarvr/2dedd0bb912be441aa98b67e1ac4bcc6 to your computer and use it in GitHub Desktop.
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