This article describes Skaffold, how and why Google Cloud Deploy uses it, and what you need to do to make it work for you.
Google 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, Google 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 Google 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 Google 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 Google Cloud Deploy:
Start with a local development loop. You can share your
skaffold.yamlfile with your team, which can enable consistency help new team members.
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 Google 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 Google Cloud Deploy uses them.
How does Google Cloud Deploy use Skaffold?
The rendering source and references to container images are passed to Google Cloud Deploy when you create a release.
As part of release creation, Google Cloud Deploy calls Cloud Build, which, in turn, invokes
skaffold 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.
Google Cloud Deploy supports static Skaffold modules.
When deploying, Google Cloud Deploy calls
skaffold applyto apply the rendered manifest or manifest to the target cluster.
Google Cloud Deploy doesn't support the use of other deployers to deploy your application. You can, however, use tools like Helm or Kustomize as renderers. To learn more about how Google Cloud Deploy deploys without using specific deployers (like Helm), see Service architecture.
Make Skaffold work for you
Configure Skaffold according to your pipeline needs.
Determine the needs of your delivery pipeline.
How many targets will you have? Are rendering and deployment the same for each. If configuration is the same for each target in your progression, you won't need to use Skaffold profiles. You only need a
skaffold.yamlfile that describes the manifests to render.
If applicable, create a Skaffold profile for each target
Define this in your
skaffold.yamlfile and bind in your delivery pipeline definition progression sequence.
Connect Cloud Deploy to your continuous-integration system.
At the end of your CI process, pass the
skaffold.yaml, the rendering source, and the container images to be populated into the rendered manifest.
Optional: set up your local development loop, using Skaffold.
Using Skaffold for development is optional in Google Cloud Deploy. The only thing that's required in order for Google Cloud Deploy to operate is a
skaffold.yamlfile that identifies manifests to render.
Visit the Skaffold site to find out about how it works and what it can do for you.
Learn how Google Cloud Deploy selects the Skaffold version to use, when the Skaffold version changes, and how to determine which version is currently in use.
Learn how to use Skaffold profiles in conjunction with advanced manifest-management tools like Helm, Kustomize, and kpt.
Try out the Skaffold profiles walkthrough.