-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Support static files/interpreted language containers #477
Comments
I've run some tests on platforms that support sharing files with the host: Docker for Desktop and minikube. Let's say I'm developing a static website that runs with nginx. My original k8s manifest is: apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx
spec:
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: web
image: nginx We could have some kind of configuration at the artifact level in the apiVersion: skaffold/v1alpha2
kind: Config
build:
artifacts:
- imageName: gcr.io/k8s-skaffold/skaffold-example
watchChanges: false
mount: ./html:/usr/share/nginx/html
deploy:
kubectl:
manifests:
- k8s-* On Docker for Desktop, Skaffold could then patch the yaml: apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx
spec:
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: web
image: nginx
volumeMounts:
- mountPath: /usr/share/nginx/html
name: html
volumes:
- name: html
hostPath:
path: /Users/dgageot/[...]/html On minikube, Skaffold could patch a different way: apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx
spec:
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: web
image: nginx
volumeMounts:
- mountPath: /usr/share/nginx/html
name: html
volumes:
- name: html
hostPath:
path: /skaffold/mount1 and make sure this command runs: |
@r2d4 @dlorenc @viglesiasce Do you think I should try and implement something along those lines? |
Could you use the same heuristic as in #565 to skip building these? |
What do you think of the ksync approach? |
@dgageot this feature would make using Skaffold for containers running TypeScript or Babel on NodeJS a great option, I wondered whether you’ve been able to make any progress on this at all? |
closing this as #1039 fixed it. |
Containers that serve static resources such as html, css or javascript shouldn't be built each time there's a change. It's too painful for the users.
With Docker for Desktop and docker-compose, I’d just bind mount the sources and that would be it. No rebuild involved and Live Reload could be setup to smooth the developer experience even more.
What we could do in Skaffold, un dev mode, is let the user bind mount the sources into the container running on the local Kubernetes. That’s not trivial because:
Once we have that, we can also think about Live Reload.
The text was updated successfully, but these errors were encountered: