skaffold icon indicating copy to clipboard operation
skaffold copied to clipboard

Skaffold File Sync - Subsequent Pod Deploy

Open SizZiKe opened this issue 3 years ago • 6 comments

Expected behavior

Skaffold resyncs files after a breaking change causes a pod to redeploy

Actual behavior

Skaffold doesn't do anything - it will continue to sync files to the new pod when changes are made but previous changes are ignored. I understand the files are synced to the pod rather than the container, but this requires skaffold dev to be restarted if the pod ever crashes.

Information

  • Skaffold version: v1.33.0
  • Operating system: MacOS 11.6
  • Installed via: Homebrew
  • Contents of skaffold.yaml:
  - image: myapp
    context: myapp
    docker:
      dockerfile: myapp.Dockerfile
    sync:
      infer:
      - '**'

Steps to reproduce the behavior

  1. setup skaffold with file sync
  2. once stable, make a change to trigger the file sync
  3. delete the pod that the file was synced to
  4. examine the new pod, the content isn't synced on pod standup

SizZiKe avatar Dec 01 '21 14:12 SizZiKe

Thanks for the bug @SizZiKe. Someone from the team will take a look. Lets us know if you are interested in contributing and we can get a team member to help you!

tejal29 avatar Dec 15 '21 09:12 tejal29

I currently have a large amount of unstaged files. Whenever a pod restarts I have to restart skaffold. As of late that's not even working because skaffold detects that the image is available in docker's cache and therefore just starts an old container with none of my changes, so I have to ssh into minikube to purge the cache. Are there any workarounds? Can I force skaffold to sync all files?

circlingthesun avatar Jul 17 '22 22:07 circlingthesun

@tejal29 I'm also experiencing the same issue. It would be nice if Skaffold triggers a resync of changed or created files after the pod restarts. I'm using a manual sync in my scenario, but I have the same symptoms. After pods are redeployed, I need to "update" all the files again to trigger a sync. In any case, a user would expect the files to remain in sync locally, similar to how the bind mount in docker-compose works. I'm happy to help with the implementation of this.

stefanhenseler avatar Sep 13 '23 11:09 stefanhenseler

Same here, as @stefanhenseler mentioned, the only way I found to make it work is to re-update manually all of the files to trigger the sync again. I think this is crucial for anyone using the sync functionality.

gianfrancodemarco avatar Sep 18 '23 10:09 gianfrancodemarco

Any news on this?

MrCox007 avatar Apr 10 '24 09:04 MrCox007