Last active
November 19, 2017 14:30
-
-
Save cesarvr/2dedd0bb912be441aa98b67e1ac4bcc6 to your computer and use it in GitHub Desktop.
simple pod
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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