-
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
Two-way sync #2492
Comments
Our use case: We have a complex application with 100+ json configuration files. These files are updated by the application UI running in the container. To save them in git we need to get them back out to the developers environment. We have tried using minikube volume mounts for this use case. It works- but has some drawbacks - such as complexity (we want to keep things simple for the developer), it doesn't work on non minikube environments, and you can get into a sync loop race with skaffold as files are updated. Today we use |
Great to hear from you. We are facing the same challenge. The problem with the So |
We use selector labels on kubectl cp ( |
Can we take some inspiration by how DevSpace solved bi-directional host<>pod sync? https://github.com/devspace-cloud/devspace/tree/master/sync/inject
|
I don't know if my use case is valid as I'm just starting to use K8S, but I currently have a multi-stage docker build for two micro-services which need to be deployed to K8S. I'm using Minikube and plan to deploy the "dev" stage of my dockerfiles to K8S. That "dev" stage's goal is to provide me with an environment in which I have all the necessary dependencies and tools to build (node, npm, etc). As such my goal is to develop, build and run from within K8S. This setup was working fine with docker + docker-compose, where I could bind-mount my local source code into the containers and have it sync both ways. At the moment I'm looking at solutions for this with K8S, but have found quite a lot of different things so far.. :) Skaffold looks really appealing for multiple reasons, but at the moment I'm thinking about combining skaffold and devspace to reach my goals. If Skaffold could do it all, then all the better :) |
Maybe I am missing something, but should’t be easy to just using an hostpath volume as docker does for local development ? |
@paolomainardi In case I am missing something a nudge into the right direction is highly appreciated. |
Two-way file synchronization is really necessary. |
Two-way sync can be especially tricky with remote clusters, where reverse mounts are not easily done. I haven't heard about anyone actively planning on working on this, so I'm going to downgrade the priority. If someone wants to propose a design document, I'd love to take a look. |
Two-way sync can be enabled locally for development mode, not a remote cluster. For example: I am a developer Ruby on Rails, I need to generate a model.
Many files generated in the pod/container, but I cannot copy them by the manual. |
Though tricky, two-way sync is essential as people developing in containers simply can’t use Skaffold at the moment. Solutions such as Okteto or Devspace do have that feature so developers don’t have to pollute their local machine with dev dependencies. |
Guys! Such feature is a must have for full local development inside Kubernetes. I have reviewed the ways how to implement it - and only one way looks is better for me - inject a sidecar container which will do such sync. In similar way how the devspace doing it. What do you think? |
Update about this issue: currently we had to deprioritize the work for this feature; it will imply a good amount of changes. We are aiming to resume work for this as soon as we have more cicles available for the work (hopefully some point in h2 2023). Thanks everyone for your inputs. |
@renzodavid9 I made a recap here on why it is hard to develop on Vscode + Kubernetes pod also with Skaffold at devcontainers/spec#10 (comment) What do you think? |
Is there any chance that this features will be worked on in h2 2023 by the core team? Cannot wait to have this feature in skaffold! Are there any other Laravel developers using kubernetes and skaffold for dev environments who deal with this issue? |
Any update here? This is the only feature preventing us from using skaffold... |
I’m surprised this isn’t a higher priority issue. |
@samjurriaans this is an issue for any workflow that has configuration data generated by some process CLI/UI that runs on the container. That data is necessary to sync in multi env environments so it is not wiped when restarting skaffold… |
Hi friends, I created a poc for downstream-sync https://github.com/ericzzzzzzz/skaffold/tree/downstream-sync , we'd like some feedbacks to formalize the design, if you can help to try out, that would be great! thanks! To use this, you need to clone https://github.com/ericzzzzzzz/skaffold/tree/downstream-sync and build from source (You may want to back up your exiting skaffold binary first :) )
|
Hello @ericzzzzzzz I will test this out! Beyond testing what does the path look like for getting this feature in? |
I have developers that get confused by having to remember copying changes back to their filesystem due to this issue so I'm hoping to improve DX through this change! |
Hi @shadiramadan , Our team has placed the Skaffold project in a maintenance state (KTLO). This means we won't be actively adding new features ourselves. However, we wholeheartedly welcome community contributions in the form of pull requests. To facilitate this, I've completed a design document for this downstream file-sync feature. I'll share this document next week and create issues outlining the feature's MVP, making it easier for the community to get involved |
@ericzzzzzzz would Google consider donating the project to the CNCF if that is the case? I'm not sure what that process is like but it could give the project the boost it deserves. Skaffold has come a long way and there are definitely some quality of life changes that would make the DX more friendly and increase adoption! |
Hello @shadiramadan , I'm the Engineering Manager for the Skaffold team at Google. We would very much consider donating Skaffold to the CNCF -- especially if doing so means more community involvement from folks like you! Any interest in partnering with us on working through that process? |
What are the next steps? |
I suppose you need to open a ticket at https://github.com/cncf/sandbox right? |
P.s. Google Kaniko recently it is trying to do the same: |
@bhack Correct on both counts. We would like to hear from Skaffold users and contributors interested in working on and supporting such an application! |
Can you open and pin a new ticket on this? |
Here is the draft design proposal for downstream sync, https://github.com/ericzzzzzzz/skaffold/blob/downstream-sync/docs-v2/design_proposals/downstream-sync.md |
Thank you @ericzzzzzzz I'll review the design proposal and your existing work. No promises on my own timelines but this has been a TODO on my end for a while! |
Syncing in Skaffold to the container works well. However, applications sometimes change files on the filesystem themselves. If this happens inside the container, it is hard to get that change quickly during development.
There might be two types of file changes:
Mounting directories is tricky and slow, also can collide with Skaffold's one directional filesync.
Maybe Skaffold should be able to help with syncing back from the container in dev mode.
I would like to collect feedback from users who face this and see what use cases are there.
The text was updated successfully, but these errors were encountered: