Skaffold — Fast Kubernetes Development Workflow from Google
Skaffold handles the inner-loop build-push-deploy cycle for Kubernetes apps. Edit code, and Skaffold rebuilds images, updates manifests, and redeploys to a cluster in seconds — ideal for local dev and CI/CD.
Agent 可直接安装
这个资产可安装;Agent 先选择当前运行时、检查安装计划,再运行匹配命令。
npx -y tokrepo@latest install 63a20dfb-37c8-11f1-9bc6-00163e2b0d79 --target codex先 dry-run 确认安装计划,再运行此命令。
What it is
Skaffold is a command-line tool from Google that automates the inner development loop for Kubernetes applications. When you edit code, Skaffold detects the change, rebuilds the container image, pushes it (or sideloads it to a local cluster), updates Kubernetes manifests, and redeploys — all in seconds.
It targets developers building microservices on Kubernetes who are tired of manually running docker build, docker push, and kubectl apply after every code change.
How it saves time or tokens
Skaffold eliminates the manual build-push-deploy cycle that typically takes minutes per iteration. Its file sync feature can copy changed files directly into running pods without rebuilding the entire image. Combined with smart caching and incremental builds, Skaffold reduces the feedback loop from minutes to seconds.
How to use
- Install Skaffold via Homebrew or the official binary release.
- Run
skaffold initin a project directory that has a Dockerfile and Kubernetes manifests. This generates askaffold.yamlconfiguration. - Run
skaffold devto start the continuous development loop. Skaffold watches files, rebuilds on change, redeploys, and streams logs.
Example
# skaffold.yaml
apiVersion: skaffold/v4beta11
kind: Config
build:
artifacts:
- image: myapp
docker:
dockerfile: Dockerfile
deploy:
kubectl:
manifests:
- k8s/*.yaml
# Start continuous dev loop
skaffold dev
# Or one-shot deploy
skaffold run
Related on TokRepo
- DevOps tools — CI/CD and infrastructure automation
- Automation tools — workflow automation for developers
Common pitfalls
- Skaffold works with any builder (Docker, Buildpacks, Jib, Kaniko) but the default is Docker. If your cluster cannot pull from a local registry, configure Skaffold to use a remote registry or sideload images directly.
- File sync only works for interpreted languages (Python, Node.js) where restarting the process picks up changes. Compiled languages (Go, Java) still require a full rebuild.
- Skaffold profiles let you configure different behaviors for dev vs. staging vs. production, but mixing profiles with Helm values files can create confusing override chains.
常见问题
Yes. Skaffold supports kubectl, Helm, and Kustomize as deployers. You configure the deployer in skaffold.yaml and Skaffold handles rendering manifests and applying them to the cluster. You can even chain multiple deployers in a single config.
Yes. Skaffold works with any Kubernetes cluster your kubeconfig points to, including GKE, EKS, AKS, and self-managed clusters. For remote clusters, configure a container registry that the cluster can pull from.
Both automate Kubernetes inner-loop development. Skaffold uses a declarative YAML config and runs as a CLI. Tilt uses a Starlark-based Tiltfile and provides a web dashboard. Skaffold is more CI/CD-friendly; Tilt offers richer real-time UI feedback.
File sync copies changed files directly into a running pod without rebuilding the container image. This is useful for interpreted languages where a file change plus process restart is sufficient. It reduces iteration time from tens of seconds to under a second.
Skaffold is maintained by Google Cloud and is part of the GoogleContainerTools organization. It receives regular releases and is used internally at Google for Kubernetes development workflows.
引用来源 (3)
- Skaffold GitHub— Skaffold automates the build-push-deploy cycle for Kubernetes
- Skaffold Documentation— Skaffold supports Docker, Buildpacks, Jib, Bazel, and Kaniko builders
- Skaffold File Sync Docs— File sync copies changed files into running pods without image rebuild
讨论
相关资产
Eclipse Che — Cloud Development Environments for Kubernetes
Eclipse Che provides Kubernetes-native cloud development environments with browser-based IDEs, enabling teams to standardize and instantly provision developer workspaces.
cdk8s — Define Kubernetes Manifests Using Real Programming Languages
cdk8s (Cloud Development Kit for Kubernetes) lets you define Kubernetes resources using TypeScript, Python, Java, or Go, generating standard YAML manifests from code.
Kubero — Self-Hosted PaaS for Kubernetes with Git Push Deployments
Deploy applications to Kubernetes with Heroku-style git push workflows. Kubero provides a web UI, automatic SSL, built-in CI/CD pipelines, and add-on marketplace without requiring deep Kubernetes expertise.
werf — Consistent Delivery Tool for Kubernetes
Build container images and deploy Helm-compatible releases to Kubernetes with content-based tagging, GitOps-ready pipelines, and built-in cleanup policies.