Using Cloud Deploy execution environments (original) (raw)

A Cloud Deploy execution environment is the environment in which Cloud Deploy executes its render, predeploy, deploy, verify, and postdeploy operations. The execution environment consists of the following components:

This article describes the default execution environment, service accounts, and storage for Cloud Deploy, as well as why and how you can change these defaults.

Defaults

The following are the defaults that Cloud Deploy uses to run, to execute rendering and deployment, and to store assets such as rendered manifests:

The sections that follow describe the circumstances under which you would change any of these values, and links to instructions for doing so.

About Cloud Build worker pools

The Cloud Deploy execution environment can use one of the following:

Changing the Cloud Deploy execution environment

You might change the Cloud Deploy execution environment under the following circumstances:

Configuration of all three parts of the execution environment (worker pool, service account, and storage) is done per target, in each target's YAML configuration.

Changing from the default pool to a private pool

You configure worker pools per target, so that the pool is used for RENDER, DEPLOY, PREDEPLOY, POSTDEPLOY, orVERIFY (or a combination of the five) for that target only.

To use the default worker pool for both render and deploy operations, you don't need to do anything.

The following is a sample target configuration that specifies a private worker pool for DEPLOY, and the default worker pool for RENDER, PREDEPLOY,POSTDEPLOY and VERIFY:

executionConfigs:
- usages:
  - DEPLOY
  privatePool:
    workerPool: "projects/p123/locations/us-central1/workerPools/wp123"
- usages:
  - RENDER
  - PREDEPLOY
  - VERIFY
  - POSTDEPLOY

For more information about how to configure private pools for targets, seeDelivery pipeline configuration documentation.

Changing from the default to custom execution service account

As with the worker pool, you can specify an alternate service account to use for rendering or deploying (or both) per target. To do so, add the following line to the target configuration, after the workerPool element:

serviceAccount: "[name]@[project_name].iam.gserviceaccount.com"

The specified service account must include the clouddeploy.jobRunner role, as described in the Cloud Deploy service accountsdocument.

See Target definitions for more details on this configuration.

Changing the storage location

To change the storage bucket from the Cloud Deploy default, add the following line to the target definitionin the workerPool stanza:

artifactStorage: "gs://[bucket_name]/[dir]"

This configuration changes where the rendered manifests are stored, but does not affect where the rendering source is stored.

Changing the log level for Skaffold, gcloud CLI, and kubectl

To change the log level for Skaffold, gcloud CLI, and kubectl, from their respective defaults to debug (or the equivalent), set verbose totrue in the execution configs. Here's an example:

executionConfigs:
- usages:
  - [RENDER | PREDEPLOY|  DEPLOY | VERIFY | POSTDEPLOY]
  workerPool:
  serviceAccount:
  artifactStorage:
  executionTimeout:
  verbose: true

Using Cloud Deploy in a VPC Service Controls perimeter

Cloud Deploy supports VPC Service Controls.

You can follow the VPC Service Controls quickstartto set up a service perimeter.

Limitations

What's next