Agents need a fast, non-interactive way to run local code changes in a deployed dev environment. okteto sync pushes local changes to their containers, and exits. It’s a much simpler architecture than the file sync of okteto up (Syncthing, SSH, persistent volume): no sidecars, no volumes, no long-running process.
Usage
okteto sync # all dev containers in the manifest
okteto sync api worker # only these
How sync works
- Incremental, à la rsync.
okteto synconly sends the changes between local and remote. - One way. Local is the source of truth. Files deleted locally are deleted in the container. Paths in
.oktetoignoreare never touched, so generated folders (node_modules, build output) should be listed there. - No sidecars, no volumes. Files are written to the container filesystem. If the pod restarts, they’re gone and the next
okteto syncsends everything again. - No restarts. The container’s process picks up changes itself, e.g. with a hot-reload
command(npm run dev,air, …). Support arestartfield in dev containers to force a restart. - Works the same on macOS, Linux and Windows, with nothing to install besides the Okteto CLI.