Skaffold is a command-line tool that 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. Skaffold is the engine that powers Cloud Code.
Skaffold projects usually start using a single
configuration to describe how to build and deploy the application. As a
project grows, it can be useful to break the application pipeline into
Skaffold supports defining multiple
either placed together in the same
skaffold.yaml file and separated using YAML
document separators (
---), or placed in separate
files that are referenced from a higher-level
skaffold.yaml file. A
configuration can be made into a module by giving it a name using the
Using modules allows you to develop and debug parts of the application independently. Dependencies can be defined between configuration files and to specific modules.
Debugging applications with Skaffold modules
You can iteratively develop and debug the entire application or a set of the defined modules. Skaffold manages the module dependencies and their order of deployment.
Getting started with a Skaffold modules sample
To select modules for your application, see Developing portions of an application independently.
If you haven't used Skaffold modules and want to test the feature
with a sample, see the
Guestbook sample, which is
For a large enterprise application sample, developed using various technologies and languages, and using Skaffold modules, see the Bank of Anthos sample.
Common use cases
This section outlines some common use case examples that demonstrate different scenarios of when and how you can use modules in your IDE.
You're a frontend developer mostly working on the
module. As a microservice,
frontend doesn't have an explicit code or library
dependency on the
backend repo, but requires
backend to be deployed and running
in the cluster.
You use your Skaffold-based project that contains a
frontend module definition to deploy and debug from a Cloud Code IDE to a shared development cluster where the backend team also deploys their service. The DevOps team maintains this shared cluster.
You don't work with or debug
backend code or update Kubernetes
configs most of the time. Skaffold builds and deploys other configurations
frontend requires. You configure Cloud Code
deployment configuration to only iterate on the
You can also deploy both the
backend to a local cluster to get a faster iterative experience.
Cross-boundary microservice development and debugging
When multiple microservices need to be debugged together, you could:
- Open the parent directory where all sub-directories with modules source code are located relative to each other
- Select the root
skaffold.yamlfile for deployment (configs)
- Configure Cloud Code deployment configuration to only iterate on
backendmodules that are available locally (and their respective Kubernetes configuration module when there are changes there).
You could also have a separate root
skaffold.yaml file for local
development that includes a static data server.
Smart module YAML editing
You're a DevOps engineer building a template repository for the team of microservice developers which uses Skaffold modules. You want to ensure there are no errors in module definitions without running Skaffold manually (such as cyclic dependencies or non-unique module names). You use Cloud Code IDEs to edit Skaffold YAML configuration files.