Stay organized with collections
Save and categorize content based on your preferences.
This document describes how to configure and use custom canary deployments to
deploy your applications to all target types
using Cloud Deploy.
How custom canary deployments work
When you deploy using a custom canary deployment strategy,
Cloud Deploy does not modify your manifests in order to facilitate the
chosen traffic-balancing configuration. Instead you are responsible for
providing manifests that are applied to your target runtime for each canary
phase.
Make sure you have the required permissions
In addition to other Identity and Access Management permissions you need for using
Cloud Deploy, you need the following permissions in order to
perform additional actions that might be needed for a canary deployment:
clouddeploy.rollouts.advance
clouddeploy.rollouts.ignoreJob
clouddeploy.rollouts.cancel
clouddeploy.rollouts.retryJob
clouddeploy.jobRuns.get
clouddeploy.jobRuns.list
clouddeploy.jobRuns.terminate
See IAM roles and permissions
for more information about what available roles include these permissions.
Prepare your skaffold.yaml
Your skaffold.yaml file defines how your manifests are rendered and deployed.
For a custom canary deployment you are responsible for defining profiles that
are associated with each canary phase in order to facilitate the chosen
traffic-balancing configuration. These profiles are mapped to phases in the
delivery pipeline strategy configuration.
The following is an example skaffold.yaml configuration used by a custom
canary:
With custom canary configuration, you specify the following, in your delivery
pipeline definition:
Rollout phase names
In a fully-automated canary, Cloud Deploy names the phases for you
(canary-25, canary-75, stable, for example). With a custom canary,
however, you can give each phase any name, as long as it's unique among all
phases for this canary stage, and it honors
resource ID restrictions. But the final
(100%) phase name must be stable.
Percentage goals for each phase
Specify the percentages separately, per phase.
Skaffold profiles to use for the phase
You can use a separate Skaffold profile for each phase, or the same profile,
or any combination. And each profile can use a different Cloud Run service definition. You can also use more than
one profile for a given phase. Cloud Deploy combines them.
Whether there is a verify job for the phase
Remember that if you're enabling verify, you need to
configure your skaffold.yaml for
verification also.
Whether there are predeploy or postdeploy jobs for the phase
If you're enabling predeploy or postdeploy jobs, you need to
configure your skaffold.yaml for those jobs.
Custom canary configuration elements
The following YAML shows the configuration for the phases of fully custom canary
deployment:
strategy:canary:# Custom configuration for each canary phasecustomCanaryDeployment:phaseConfigs:-phaseId:"PHASE1_NAME"percentage:PERCENTAGE1profiles:["PROFILE_NAME"]verify:true | falsepredeploy:actions:"PREDEPLOY_ACTION"postdeploy:actions:"POSTDEPLOY_ACTION"-…-phaseId:"stable"percentage:100profiles:["LAST_PROFILE_NAME"]verify:true|falsepredeploy:actions:"PREDEPLOY_ACTION"postdeploy:actions:"POSTDEPLOY_ACTION"
In this YAML
PHASE1_NAME
Is the name of the phase. Each phase name must be unique.
[ "PROFILE_NAME" ]
Is the name of the profile to use for the phase. You can use the same profile
for each phase, or a different one for each, or any combination. Also, you can
specify more than one profile. Cloud Deploy uses all of the
profiles you specify, plus the profile or manifest used by the overall
stage.
stable
The final phase must be named stable.
PERCENTAGE1
Is the percentage to deploy for the first phase. Each phase must have a unique
percentage value, and that value must be a whole percentage (not 10.5, for
example), and the phases must be in ascending order.
verify: true|false
Tells Cloud Deploy whether to include a verify job for the phase.
Note that for each phase to use verify, Skaffold uses the same profile for
verify that is specified for render and deploy for that phase.
PREDEPLOY_ACTION
Is the same as the ACTION_NAME that you used in your
skaffold.yaml to define the custom action you want to run before deploying.
POSTDEPLOY_ACTION
Is the same as the ACTION_NAME that you used in your
skaffold.yaml to define the custom action you want to run after deploying.
The percentage for the last phase must be 100. Phases are executed according
in the order you configure them in this customCanaryDeployment stanza, but if
the percentage values are not in ascending order, the command to
register the delivery pipeline
fails with an error.
Note that the configuration for a custom canary doesn't include a
runtimeConfig stanza. If you include runtimeConfig, it's considered a
custom-automated canary.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-29 UTC."],[],[],null,["# Custom Canary Deployments\n\nThis document describes how to configure and use custom canary deployments to\ndeploy your applications to [all target types](/deploy/docs/deploying-application#set_up_for_the_runtime_environment_of_your_choice)\nusing Cloud Deploy.\n\nHow custom canary deployments work\n----------------------------------\n\nWhen you deploy using a custom canary deployment strategy,\nCloud Deploy does not modify your manifests in order to facilitate the\nchosen traffic-balancing configuration. Instead you are responsible for\nproviding manifests that are applied to your target runtime for each canary\nphase.\n\n### Make sure you have the required permissions\n\nIn addition to other Identity and Access Management permissions you need for using\nCloud Deploy, you need the following permissions in order to\nperform additional actions that might be needed for a canary deployment:\n\n- `clouddeploy.rollouts.advance`\n- `clouddeploy.rollouts.ignoreJob`\n- `clouddeploy.rollouts.cancel`\n- `clouddeploy.rollouts.retryJob`\n- `clouddeploy.jobRuns.get`\n- `clouddeploy.jobRuns.list`\n- `clouddeploy.jobRuns.terminate`\n\nSee [IAM roles and permissions](/deploy/docs/iam-roles-permissions)\nfor more information about what available roles include these permissions.\n\n### Prepare your `skaffold.yaml`\n\nYour `skaffold.yaml` file defines how your manifests are rendered and deployed.\nFor a custom canary deployment you are responsible for defining profiles that\nare associated with each canary phase in order to facilitate the chosen\ntraffic-balancing configuration. These profiles are mapped to phases in the\ndelivery pipeline strategy configuration.\n\nThe following is an example `skaffold.yaml` configuration used by a custom\ncanary: \n\n apiVersion: skaffold/v4beta7\n kind: Config\n profiles:\n - name: canary-25\n manifests:\n rawYaml:\n - canary-25-resources.yaml\n - name: canary-50\n manifests:\n rawYaml:\n - canary-50-resources.yaml\n - name: stable\n manifests:\n rawYaml:\n - stable-resources.yaml\n\n### Configure a custom canary\n\nWith custom canary configuration, you specify the following, in your delivery\npipeline definition:\n\n- Rollout phase names\n\n In a fully-automated canary, Cloud Deploy names the phases for you\n (`canary-25`, `canary-75`, `stable`, for example). With a custom canary,\n however, you can give each phase any name, as long as it's unique among all\n phases for this canary stage, and it honors\n [resource ID restrictions](/apis/design/resource_names#resource-id-segments). But the final\n (100%) phase name must be `stable`.\n- Percentage goals for each phase\n\n Specify the percentages separately, per phase.\n- Skaffold profiles to use for the phase\n\n You can use a separate Skaffold profile for each phase, or the same profile,\n or any combination. And each profile can use a different Cloud Run service definition. You can also use more than\n one profile for a given phase. Cloud Deploy combines them.\n- Whether there is a verify job for the phase\n\n Remember that if you're enabling verify, you need to\n [configure](/deploy/docs/verify-deployment) your `skaffold.yaml` for\n verification also.\n- Whether there are predeploy or postdeploy jobs for the phase\n\n If you're enabling predeploy or postdeploy jobs, you need to\n [configure](/deploy/docs/hooks) your `skaffold.yaml` for those jobs.\n\n#### Custom canary configuration elements\n\nThe following YAML shows the configuration for the phases of fully custom canary\ndeployment: \n\n strategy:\n canary:\n # Custom configuration for each canary phase\n customCanaryDeployment:\n phaseConfigs:\n - phaseId: \"\u003cvar label=\"phase 1\" translate=\"no\"\u003ePHASE1_NAME\u003c/var\u003e\"\n percentage: \u003cvar label=\"percent1\" translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003ePERCENTAGE1\u003c/span\u003e\u003c/var\u003e\n profiles: [ \"\u003cvar label=\"profile\" translate=\"no\"\u003ePROFILE_NAME\u003c/var\u003e\" ]\n verify: true | false\n predeploy:\n actions: \"\u003cvar translate=\"no\"\u003ePREDEPLOY_ACTION\u003c/var\u003e\"\n postdeploy:\n actions: \"\u003cvar translate=\"no\"\u003ePOSTDEPLOY_ACTION\u003c/var\u003e\"\n - ...\n - phaseId: \"stable\"\n percentage: 100\n profiles: [ \"\u003cvar label=\"profile n\" translate=\"no\"\u003eLAST_PROFILE_NAME\u003c/var\u003e\" ]\n verify: true|false\n predeploy:\n actions: \"\u003cvar translate=\"no\"\u003ePREDEPLOY_ACTION\u003c/var\u003e\"\n postdeploy:\n actions: \"\u003cvar translate=\"no\"\u003ePOSTDEPLOY_ACTION\u003c/var\u003e\"\n\nIn this YAML\n\n- \u003cvar label=\"phase 1\" translate=\"no\"\u003ePHASE1_NAME\u003c/var\u003e\n\n Is the name of the phase. Each phase name must be unique.\n- `[ \"`\u003cvar label=\"profile 1\" translate=\"no\"\u003ePROFILE_NAME\u003c/var\u003e`\" ]`\n\n Is the name of the profile to use for the phase. You can use the same profile\n for each phase, or a different one for each, or any combination. Also, you can\n specify more than one profile. Cloud Deploy uses all of the\n profiles you specify, *plus* the profile or manifest used by the overall\n stage.\n- `stable`\n\n The final phase must be named `stable`.\n- \u003cvar label=\"percent1\" translate=\"no\"\u003ePERCENTAGE1\u003c/var\u003e\n\n Is the percentage to deploy for the first phase. Each phase must have a unique\n percentage value, and that value must be a whole percentage (not `10.5`, for\n example), and the phases must be in ascending order.\n- `verify: true|false`\n\n Tells Cloud Deploy whether to include a verify job for the phase.\n Note that for each phase to use verify, Skaffold uses the same profile for\n verify that is specified for render and deploy for that phase.\n- \u003cvar translate=\"no\"\u003ePREDEPLOY_ACTION\u003c/var\u003e\n\n Is the same as the \u003cvar translate=\"no\"\u003eACTION_NAME\u003c/var\u003e that you used in your\n `skaffold.yaml` to define the custom action you want to run before deploying.\n- \u003cvar translate=\"no\"\u003ePOSTDEPLOY_ACTION\u003c/var\u003e\n\n Is the same as the \u003cvar translate=\"no\"\u003eACTION_NAME\u003c/var\u003e that you used in your\n `skaffold.yaml` to define the custom action you want to run after deploying.\n\nThe percentage for the last phase must be `100`. Phases are executed according\nin the order you configure them in this `customCanaryDeployment` stanza, but if\nthe percentage values are not in ascending order, the command to\n[register the delivery pipeline](/deploy/docs/create-pipeline-targets#register_the_delivery_pipeline_and_targets)\nfails with an error.\n\nNote that the configuration for a custom canary doesn't include a\n`runtimeConfig` stanza. If you include `runtimeConfig`, it's considered a\n[custom-automated canary](/deploy/docs/deployment-strategies/canary#types_of_canary).\n\nWhat's next\n-----------\n\n- Try the [canary deployment quickstart](/deploy/docs/deploy-app-canary).\n\n- Find out how to [manage the lifecycle of your canary's rollouts](/deploy/docs/deployment-strategies/manage-rollout).\n\n- Learn more about [parallel deployment](/deploy/docs/parallel).\n\n- Learn more about [Cloud Deploy deployment strategies](/deploy/docs/deployment-strategies)."]]