This article describes Skaffold, how and why Cloud Deploy uses it, and what you need to do to make it work for you.
Cloud Deploy uses Skaffold for render and deploy operations. You can also use it for local development, build, test, and for advanced deployment features. However, Cloud Deploy requires only a Skaffold configuration that identifies the manifests to render and apply.
What is Skaffold?
Skaffold is a command-line tool that enables continuous development for Kubernetes-native applications. You can use Skaffold to configure a local development workspace to use with Cloud Deploy continuous delivery pipelines.
Skaffold includes the following features:
It gives you discrete control of CI/CD pipeline activities (build, render, test deploy, and so on).
It's useful as a local development tool.
Skaffold profiles let you differentiate among different environments, with different build, test, and deploy configurations, all in the same configuration file.
Why does Cloud Deploy use Skaffold?
Google Cloud Deploy uses Skaffold to separate rendering tools from the delivery pipeline. Your delivery pipeline simply defines the progression from target to target, while your Skaffold configuration defines which manifests are rendered and how. This makes manifest rendering flexible without affecting how you define your delivery pipeline.
Here are some of the advantages that Skaffold provides when you use it with Cloud Deploy:
Easy onboarding
Start with a local development loop. You can share your
skaffold.yamlfile with your team, which can enable consistency and help new team members get started.Consistent control over rendering across diverse deployment targets
You can use Skaffold profiles, with different rendering and deployment for different targets.
Choice of rendering tools without compromising how delivery pipelines are defined
Using Skaffold allows Cloud Deploy to separate delivery pipeline definition from render details. This separation lets you experiment with your manifests without disrupting the delivery pipeline.
Coherent rendering process
The rendering source plus your containers are use to generate rendered manifests.
Deployment health checks
Skaffold performs them, and Cloud Deploy uses them.
How does Cloud Deploy use Skaffold?
The rendering source and references to container images are passed to Cloud Deploy when you create a release.
As part of release creation, Cloud Deploy calls Cloud Build, which, in turn, invokes
skaffold diagnoseandskaffold renderto render the manifest or manifests using that rendering source and those images.You can use Skaffold profiles to differentiate manifests that will be applied to different targets.
Cloud Deploy supports static Skaffold modules.
When deploying, Cloud Deploy calls
skaffold applyto apply the rendered manifest or manifests to the target cluster.Cloud Deploy doesn't support the use of other deployers to deploy your application, unless you use custom targets. However, you can use tools like