Skaffold is a tool that is termed to be in a command-line which facilitates continuous development for Kubernetes-native applications. Skaffold handles the workflow for building, pushing, and deploying your application, and provides building blocks for creating CI/CD pipelines. This enables you to focus on iterating on your application locally while Skaffold continuously deploys to your local or remote Kubernetes cluster.
Features
Fast local Kubernetes Development
optimized “Source to Kubernetes” – Skaffold detects changes in your source code and handles the pipeline to build, push, and deploy your application automatically with policy-based image tagging and highly optimized, fast local workflows
continuous feedback – Skaffold automatically manages deployment logging and resource port-forwarding
Skaffold projects work everywhere
Share with other developers – Skaffold is the easiest way to share your project with the world: git clone and skaffold run
context aware – use Skaffold profiles, local user config, environment variables, and flags to easily incorporate differences across environments
CI/CD building blocks – use skaffold build and skaffold deploy as part of your CI/CD pipeline or simply skaffold run end-to-end
GitOps integration – use skaffold render to build your images and render templated Kubernetes manifests for use in GitOps workflows
skaffold.yaml – a single pluggable, declarative configuration for your project
skaffold init – Skaffold can discover your build and deployment configuration and generate a Skaffold config
multi-component apps – Skaffold supports applications with many components, making it great for microservice-based applications
bring your own tools – Skaffold has a pluggable architecture, allowing for different implementations of the build and deploy stages
Lightweight
client-side only – Skaffold has no cluster-side component, so there’s no overhead or maintenance burden to your cluster
minimal pipeline – Skaffold provides an opinionated, minimal pipeline to keep things simple
Skaffold Workflow and Architecture
Skaffold simplifies your development workflow by organizing common development stages into one simple command. Every time you run skaffold dev, the system
Collects and watches your source code for changes
Syncs files directly to pods if user marks them as syncable
Builds artifacts from the source code
Tests the built artifacts using container-structure-tests
Tags the artifacts
Pushes the artifacts
Deploys the artifacts
Monitors the deployed artifacts
Cleans up deployed artifacts on exit (Ctrl+C)
The pluggable architecture is central to Skaffold’s design, allowing you to use your preferred tool or technology in each stage. Also, Skaffold’s profiles feature grants you the freedom to switch tools on the fly with a simple flag.
For example, if you are coding on a local machine, you can configure Skaffold to build artifacts with your local Docker daemon and deploy them to minikube using kubectl. When you finalize your design, you can switch to your production profile and start building with Google Cloud Build and deploy with Helm.
Skaffold supports the following tools:
Image Builders:
Dockerfile
locally with Docker
in-cluster with Kaniko
on cloud with Google Cloud Build
Jib Maven and Gradle
Locally
on cloud with Google Cloud Build
Bazel locally
Cloud Native Buildpacks
locally with Docker
on cloud with Google Cloud Build
Custom script
Locally
In-cluster