Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix and improve sync samples #2131

Merged
merged 12 commits into from
May 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions integration/examples/hot-reload/k8s/node.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
apiVersion: v1
kind: Service
metadata:
name: node
spec:
ports:
- port: 3000
type: LoadBalancer
selector:
app: node
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: node
spec:
selector:
matchLabels:
app: node
template:
metadata:
labels:
app: node
spec:
containers:
- name: node
image: gcr.io/k8s-skaffold/node-example
ports:
- containerPort: 3000
29 changes: 29 additions & 0 deletions integration/examples/hot-reload/k8s/python.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
apiVersion: v1
kind: Service
metadata:
name: python
spec:
ports:
- port: 5000
type: LoadBalancer
selector:
app: python
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: python
spec:
selector:
matchLabels:
app: python
template:
metadata:
labels:
app: python
spec:
containers:
- name: python
image: gcr.io/k8s-skaffold/python-reload
ports:
- containerPort: 5000
10 changes: 7 additions & 3 deletions integration/examples/hot-reload/node/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
FROM gcr.io/k8s-skaffold/nodemon
FROM node:10.15.3-alpine

WORKDIR /app
EXPOSE 3000
CMD ["nodemon","--legacy-watch", "server.js"]
COPY src ./
CMD ["npm", "run", "dev"]

COPY package* ./
RUN npm install
COPY src .
Copy link
Contributor

@corneliusweig corneliusweig May 17, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
COPY src .
COPY src src/

Otherwise docker flattens the directory at the destination. And in the package.json the main file is src/index.js. I think it only works by accident, because node looks for index.js in the root folder if the entrypoint is not found.

The other examples are fine, because they use COPY . .

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the idea was to flatten the directory. in the skaffold.yaml, sync is configured to strip the src/ prefix.
I'll fix the package.json though.

10 changes: 0 additions & 10 deletions integration/examples/hot-reload/node/k8s/pod.yaml

This file was deleted.

Loading