Why Skaffold Exists
Skaffold by Google handles the build-push-deploy cycle for Kubernetes development. Define your pipeline once, and skaffold dev watches your code, rebuilds, and redeploys automatically.
Install
brew install skaffold
# or
curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-amd64
chmod +x skaffold && mv skaffold /usr/local/bin/
Initialize a Project
skaffold init
This generates skaffold.yaml by detecting your Dockerfiles and Kubernetes manifests.
Basic skaffold.yaml
apiVersion: skaffold/v4beta11
kind: Config
build:
artifacts:
- image: myapp
docker:
dockerfile: Dockerfile
deploy:
kubectl:
manifests:
- k8s/*.yaml
portForward:
- resourceType: service
resourceName: myapp
port: 8080
localPort: 8080
Development Loop
# Watch mode — rebuilds on file changes
skaffold dev
# One-time build and deploy
skaffold run
# Deploy with specific profile
skaffold run -p production
File Sync (No Rebuild)
build:
artifacts:
- image: myapp
sync:
manual:
- src: "src/**/*.py"
dest: /app/src
infer:
- "**/*.html"
Multiple Profiles
profiles:
- name: dev
build:
local:
push: false
deploy:
kubectl:
manifests: ["k8s/dev/*.yaml"]
- name: production
build:
googleCloudBuild: {}
deploy:
kubectl:
manifests: ["k8s/prod/*.yaml"]
Helm Deployment
deploy:
helm:
releases:
- name: myapp
chartPath: charts/myapp
valuesFiles:
- charts/myapp/values-dev.yaml
setValues:
image.tag: "{{.IMAGE_TAG}}"
CI/CD Pipeline
# GitHub Actions
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Skaffold
run: curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-amd64 && chmod +x skaffold
- name: Deploy
run: ./skaffold run -p production
Key Features
- Dev loop — watch, build, push, deploy in one command
- File sync — update without rebuilding images
- Multi-builder — Docker, Jib, Buildpacks, Bazel, ko, Kaniko
- Multi-deployer — kubectl, Helm, kustomize
- Profiles — different configs per environment
- Port forwarding — automatic
Resources
Need to extract CI/CD pipeline data, deployment metrics, or Kubernetes config? Check out my Apify tools or email spinov001@gmail.com for custom data extraction.
Top comments (0)