skaffold: Skaffold v0.23.0 + Windows 10 regression: didn't sync any files
Expected behavior
Sync files when it changes
Actual behavior
Did not sync files. Always shows “didn’t sync any files”
Information
- Skaffold version: v0.23.0
- Operating system: Windows 10
- Contents of skaffold.yaml:
Any yamls I tried
Steps to reproduce the behavior
- Update to v0.23.0 from v0.22.0
- Sync stops working
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 3
- Comments: 22 (9 by maintainers)
Here’s a workaround that fixes Skaffold Sync at least for me.
Wrap
skaffold devin a script whichskaffold devYou may need to adjust
sleep 3for your environment.This problem still exists in Skaffold 1.5.0.
Fyi @dgageot here’s the small repro that you asked for.
Every once in a while, I have been experiencing
WARN[0032] Skipping deploy due to sync error: copying files: didn't sync any files. This comment was a key for me: https://github.com/GoogleContainerTools/skaffold/issues/1668#issuecomment-466633791I have Minikube 1.7.3, Kustomize 3.5.4 and Skaffold 1.4.0 with multiple applications in different Kubernetes namespaces.
PROBLEM: Namespace in $KUBECONFIG affects Skaffold Sync
Skaffold sync will only work when the Kubernetes namespace in $KUBECONFIG, at the time of starting Skaffold, matches the namespace of the artifact (application) being deployed.
The critical moment is when Skaffold starts. After Skaffold is running, I can change my current namespace in $KUBECONFIG and Skaffold sync works neatly. But, if the namespace in $KUBECONFIG is different from the hot-sync-artifact’s namespace when Skaffold starts, then sync will fail with error
WARN[0032] Skipping deploy due to sync error: copying files: didn't sync any files.For Skaffold Sync to work, the namespace in $KUBECONFIG must either be undefined or it must equal to the hot-sync-artifact’s namespace.
EXAMPLE: Namespace undefined
Without namespace being defined, Skaffold Sync works for artifacts in any namespace:
EXAMPLE: Namespace defined
Here namespace is defined and Skaffold Sync will fail for all artifacts (applications) which are not deployed in
devnamespace:A workaround is to run skaffold dev with --trigger=polling
Same here, no syncing after the update. Here’s the console output (no error messages):
Node.js app with
nodemonrefreshing upon file changeMacOS Mojave v10.14.3 Docker Desktop v2.0.2.0 Kubernetes v1.13.0
Nope: MacOs Mojave 10.14.3
everything running in the default namespace
Maybe this will be helpful:
Linux environment. I see that problem when my context namespace differ from a namespace defined for Helm chart, for example:
Case 1:
skaffold.yaml,testnamespace defined inskaffold.yamlResult:Case 2:
stagingnamespace defined inskaffold.yamlResult:Where is a bug? Well, probably skaffold do not use proper namespace after deployment to communicate with the cluster?
Workaround: Always change context namespace to a namespace defined in
skaffold.yamlor Helm chart before using skaffold.