Como usar os ambientes de execução do Cloud Deploy
Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Um ambiente de execução do Cloud Deploy é o ambiente em que
o Cloud Deploy executa as operações de renderização, pré-implantação, implantação, verificação e
pós-implantação. O ambiente de execução consiste nos seguintes
componentes:
O pool de workers do Cloud Build (padrão ou particular) em que o Cloud Deploy executa operações de renderização, pré-implantação, implantação, verificação e pós-implantação.
A conta de serviço (padrão ou alternativa) que chama o Cloud Deploy
para realizar essas ações.
O local de armazenamento (padrão ou alternativo) para manifestos renderizados no
Cloud Storage.
O tempo limite do Cloud Build para operações (padrão ou personalizado)
Este artigo descreve o ambiente de execução padrão, as contas de serviço e
o armazenamento do Cloud Deploy, além de por que e como você pode alterar esses
padrões.
Padrões
Confira a seguir os padrões que o Cloud Deploy usa para executar, para
renderizar e implantar, e para armazenar recursos, como manifestos renderizados:
Esse valor é o bucket do Cloud Storage em que o Cloud Deploy armazena os manifestos renderizados. Por padrão, o Cloud Deploy cria um bucket do Cloud Storage na mesma região dos recursos do Cloud Deploy, da seguinte forma:
Por padrão, o Cloud Build tem um tempo limite de 1 hora nas operações
realizadas para o Cloud Deploy. É possível mudar esse tempo limite na especificação do ambiente de execução na configuração do destino.
Detalhamento padrão para Skaffold, gcloud CLI e kubectl
Por padrão, os níveis de registro dessas ferramentas são definidos como os respectivos padrões,
normalmente warn ou o equivalente. Você pode mudar isso
para debug ou o equivalente.
As seções a seguir descrevem as circunstâncias em que você alteraria qualquer um desses valores, além de links para instruções sobre como fazer isso.
Sobre os pools de workers do Cloud Build
O ambiente de execução do Cloud Deploy pode usar um dos seguintes:
O pool de workers padrão é um ambiente seguro e hospedado com acesso à
Internet pública. As operações de renderização, implantação, pré-implantação, pós-implantação e verificação
são executadas nesse pool, isoladas de outras cargas de trabalho.
Um pool particular
Os pools de workers particulares são
privados e dedicados, podendo ser personalizados além do pool de workers
padrão. Essa personalização pode incluir a capacidade de acessar recursos em uma
rede privada. Assim como o pool de workers padrão, os pools de workers particulares são hospedados e totalmente gerenciados pelo Cloud Build. Esses pools podem ser escalonados verticalmente ou reduzidos a zero, sem infraestrutura para configurar, fazer upgrade ou escalonamento.
A visão geral dos pools de workers particulares do Cloud Build descreve com mais detalhes os pools de workers padrão e os particulares, incluindo uma tabela de comparação dos respectivos recursos.
Como mudar o ambiente de execução do Cloud Deploy
É possível mudar o ambiente de execução do Cloud Deploy nas
seguintes circunstâncias:
Você quer que as operações de renderização, implantação, pré-implantação, pós-implantação ou verificação, ou uma
combinação das cinco, sejam realizadas em um ambiente isolado de
outras organizações.
Você quer executar essas operações em um ambiente que não esteja
conectado à Internet pública.
Você quer ambientes separados para renderizar e implantar.
Você quer usar uma conta de serviço dedicada com permissões mais específicas do que as permissões disponíveis na conta de serviço padrão.
Você quer armazenar manifestos renderizados em um local diferente do bucket padrão do Cloud Storage.
A configuração das três partes do ambiente de execução (pool de workers, conta de serviço e armazenamento) é feita por destino na configuração YAML de cada destino.
Como mudar do pool padrão para um pool particular
Você configura os pools de workers por destino.
Dessa maneira, o pool é usado para RENDER, DEPLOY, PREDEPLOY, POSTDEPLOY ou
VERIFY (ou uma combinação dos cinco) apenas para esse destino.
Para usar o pool de workers padrão para operações de renderização e implantação, não é necessário fazer nada.
Confira a seguir um exemplo de configuração de destino que especifica um pool de workers particular para DEPLOY e o pool de workers padrão para RENDER, PREDEPLOY, POSTDEPLOY e VERIFY:
Como alterar do padrão para a conta de serviço de execução personalizada
Assim como no pool de workers, é possível especificar uma conta de serviço alternativa para renderização ou implantação (ou ambas) por destino. Para fazer isso, adicione a seguinte linha à
configuração de destino, após o elemento workerPool:
Como mudar o nível de registro do Skaffold, da CLI gcloud e do kubectl
Para mudar o nível de registro do Skaffold, da CLI gcloud e do kubectl dos
respectivos padrões para debug (ou o equivalente), defina verbose como
true nas configurações de execução. Veja um exemplo:
Use um pool de workers particular do Cloud Build para o ambiente de execução do destino, e não o pool de workers padrão.
O projeto que contém o pool de workers e o projeto que contém os
recursos do Cloud Deploy precisam permanecer no mesmo perímetro de segurança
do VPC Service Controls.
Qualquer cluster do GKE implantado no
perímetro do VPC Service Controls precisa ser um cluster particular.
Para configurar um pool privado de um cluster particular, consulte este tutorial.
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-08-17 UTC."],[[["\u003cp\u003eCloud Deploy's execution environment includes a Cloud Build worker pool, a service account, a storage location for rendered manifests, and a Cloud Build timeout, all of which have default settings.\u003c/p\u003e\n"],["\u003cp\u003eThe default Cloud Deploy settings use the default Cloud Build worker pool, the default Compute Engine service account, a Cloud Storage bucket for rendered manifests in the same region as the Cloud Deploy resources, and a one-hour Cloud Build timeout.\u003c/p\u003e\n"],["\u003cp\u003eYou can customize the Cloud Deploy execution environment per target, such as switching to a private Cloud Build worker pool, using a dedicated service account, or specifying a different Cloud Storage bucket for rendered manifests.\u003c/p\u003e\n"],["\u003cp\u003eChanging the execution environment is useful for deploying to private Google Kubernetes Engine clusters, isolating operations, or using dedicated service accounts with specific permissions.\u003c/p\u003e\n"],["\u003cp\u003eCloud Deploy can be configured to use a VPC Service Controls perimeter, but it requires a Cloud Build private worker pool and that the worker pool and the Cloud Deploy project be within the same security perimeter.\u003c/p\u003e\n"]]],[],null,["# Using Cloud Deploy execution environments\n\nA Cloud Deploy execution environment is the environment in which\nCloud Deploy executes its render, predeploy, deploy, verify, and\npostdeploy operations. The execution environment consists of the following\ncomponents:\n\n- The [Cloud Build worker pool](/build/docs/private-pools/private-pools-overview)\n (default or private) in which Cloud Deploy executes render,\n predeploy, deploy, verify, and postdeploy operations\n\n- The service account (default or alternate) that calls Cloud Deploy\n to perform these actions\n\n- The storage location (default or alternate) for rendered manifests in\n Cloud Storage\n\n- The Cloud Build timeout for operations (default or custom)\n\nThis article describes the default execution environment, service accounts, and\nstorage for Cloud Deploy, as well as why and how you can change these\ndefaults.\n\nDefaults\n--------\n\nThe following are the defaults that Cloud Deploy uses to run, to\nexecute rendering and deployment, and to store assets such as rendered manifests:\n\n- Default worker pool\n\n By default, Cloud Deploy runs in the default Cloud Build\n worker pool. However, you can [configure Cloud Deploy to use a Cloud Build\n private worker pool](/deploy/docs/config-files#executionconfigs).\n\n For more details about worker pools, see the Cloud Build\n [Overview of default pools and private pools](/build/docs/private-pools/private-pools-overview#overview_of_default_pools_and_private_pools).\n- Default execution service account\n\n By default, Cloud Deploy uses the [default Compute Engine\n service account](/deploy/docs/cloud-deploy-service-account#default_service_account).\n- Default Cloud Deploy storage location\n\n This value is the Cloud Storage bucket where Cloud Deploy\n stores your rendered manifests. By default, Cloud Deploy creates\n a Cloud Storage bucket, in the same [region](/deploy/docs/regions)\n as the Cloud Deploy resources, taking the following form:\n\n `\u003clocation\u003e.deploy-artifacts.\u003cproject ID\u003e.appspot.com`\n- Default Cloud Build timeout\n\n By default, Cloud Build has a timeout of 1 hour on operations it\n performs for Cloud Deploy. You can change that timeout in the\n execution environment specification in\n [target configuration](/deploy/docs/config-files#executionconfigs).\n- Default verbosity for Skaffold, gcloud CLI, and kubectl\n\n By default, log levels for these tools are set to their respective defaults,\n typically `warn` or the equivalent. You can [change this](#changing_log_level)\n to `debug` or the equivalent.\n\nThe sections that follow describe the circumstances under which you would change\nany of these values, and links to instructions for doing so.\n\nAbout Cloud Build worker pools\n------------------------------\n\nThe Cloud Deploy execution environment can use one of the following:\n\n- The [Cloud Build default pool](/build/docs/private-pools/private-pools-overview)\n\n The default worker pool is a secure, hosted environment with access to the\n public internet. Render, deploy, predeploy, postdeploy, and verify operations\n are executed in that pool, isolated from other workloads.\n- A private pool\n\n [Private worker pools](/build/docs/private-pools/private-pools-overview) are\n private, dedicated pools that can be customized more than the default worker\n pool. That customization can include the ability to access resources in a\n private network. Like the default worker pool, private worker pools are hosted\n and fully managed by Cloud Build. These pools can scale up or\n scale down to zero, with no infrastructure to set up, upgrade, or scale.\n\n The Cloud Build [Private pools overview](/build/docs/private-pools/private-pools-overview)\n describes default worker pools and private worker pools more thoroughly,\n including a table comparing their features.\n\n| **Note:** Cloud Build private worker pools are regional resources. Cloud Deploy lets you configure [targets](/deploy/docs/terminology#target) with private pools in other regions. This configuration makes it possible to share private worker pools among targets, and allows cross-regional dependencies.\n\nChanging the Cloud Deploy execution environment\n-----------------------------------------------\n\nYou might change the Cloud Deploy execution environment under the\nfollowing circumstances:\n\n- You want to [deploy to a private Google Kubernetes Engine cluster](/build/docs/private-pools/use-in-private-network#deploying-to-clusters)\n\n- You want render, deploy, predeploy, postdeploy, or verify operations, or a\n combination of the five, to be performed in an environment that's isolated from\n other organizations.\n\n- You want these operations to be performed in an environment that isn't\n connected to the public internet.\n\n- You want separate environments for render and deploy.\n\n- You want to use a dedicated service account with permissions that are more\n specific to your use than the permissions available in the default service\n account.\n\n- You want to store rendered manifests in a location different from the default\n Cloud Storage bucket.\n\nConfiguration of all three parts of the execution environment (worker pool, service\naccount, and storage) is done per target, in [each target's YAML configuration](/deploy/docs/config-files#target_definitions).\n\n### Changing from the default pool to a private pool\n\nYou configure worker pools [per target](/deploy/docs/config-files#target_definitions),\nso that the pool is used for `RENDER`, `DEPLOY`, `PREDEPLOY`, `POSTDEPLOY`, or\n`VERIFY` (or a combination of the five) *for that target only*.\n\nTo use the default worker pool for both render and deploy operations, you don't\nneed to do anything.\n| **Note:** if you want to configure a target to use a private worker pool for either operation (`RENDER` or `DEPLOY`), but the default worker pool for the other, you must configure both. That is, you can't specify a private worker pool for `DEPLOY` but assume Cloud Deploy will perform rendering in the default pool.\n\nThe following is a sample target configuration that specifies a private worker\npool for `DEPLOY`, and the default worker pool for `RENDER`, `PREDEPLOY`,\n`POSTDEPLOY` and `VERIFY`: \n\n executionConfigs:\n - usages:\n - DEPLOY\n privatePool:\n workerPool: \"projects/p123/locations/us-central1/workerPools/wp123\"\n - usages:\n - RENDER\n - PREDEPLOY\n - VERIFY\n - POSTDEPLOY\n\n| **Note:** if Cloud Deploy is running in a different project from the worker pool's project, make sure the [service agent](/deploy/docs/cloud-deploy-service-account#service_agent) has permission on the worker pool in that project. You can use either the `roles/cloudbuild.workerPoolUser` role or the `cloudbuild.workerpools.use` direct permission.\n\nFor more information about how to configure private pools for targets, see\n[Delivery pipeline configuration documentation](/deploy/docs/config-files#executionconfigs).\n\n### Changing from the default to custom execution service account\n\nAs with the worker pool, you can specify an alternate service account to use for\nrendering or deploying (or both) per target. To do so, add the following line to\nthe target configuration, after the `workerPool` element:\n\n`serviceAccount: \"[name]@[project_name].iam.gserviceaccount.com\"`\n\nThe specified service account must include the `clouddeploy.jobRunner` role, as\ndescribed in the [Cloud Deploy service accounts](/deploy/docs/cloud-deploy-service-account)\ndocument.\n\nSee [Target definitions](/deploy/docs/config-files#target_definitions) for more\ndetails on this configuration.\n\n### Changing the storage location\n\nTo change the storage bucket from the Cloud Deploy default, add the\nfollowing line to the [target definition](/deploy/docs/config-files#target_definitions)\nin the `workerPool` stanza:\n\n`artifactStorage: \"gs://[bucket_name]/[dir]\"`\n\nThis configuration changes where the rendered manifests are stored, but does not\naffect [where the rendering source is stored](/sdk/gcloud/reference/deploy/releases/create#--source).\n\n### Changing the log level for Skaffold, gcloud CLI, and kubectl\n\nTo change the log level for Skaffold, gcloud CLI, and kubectl, from\ntheir respective defaults to `debug` (or the equivalent), set `verbose` to\n`true` in the execution configs. Here's an example: \n\n executionConfigs:\n - usages:\n - [RENDER | PREDEPLOY| DEPLOY | VERIFY | POSTDEPLOY]\n workerPool:\n serviceAccount:\n artifactStorage:\n executionTimeout:\n verbose: true\n\nUsing Cloud Deploy in a VPC Service Controls perimeter\n------------------------------------------------------\n\nCloud Deploy supports [VPC Service Controls](/vpc-service-controls).\n\nYou can follow the [VPC Service Controls quickstart](/vpc-service-controls/docs/set-up-service-perimeter)\nto set up a service perimeter.\n\n### Limitations\n\n- You must use a Cloud Build private worker pool for the target's\n execution environment---not the default worker pool.\n\n- The project that contains the worker pool and the project that contains your\n Cloud Deploy resources must remain in the same VPC Service Controls\n security perimeter.\n\n- Any GKE cluster you deploy to in the\n VPC Service Controls perimeter must be a private cluster.\n\n To set up a private pool for a private cluster, see [this tutorial](https://cloud.google.com/architecture/accessing-private-gke-clusters-with-cloud-build-private-pools).\n\nWhat's next\n-----------\n\n- Find out more about [Cloud Deploy target configuration](/deploy/docs/config-files#target_definitions).\n\n- Read about [Cloud Build private pools](/build/docs/private-pools/private-pools-overview).\n\n- Read about [how Cloud Build uses VPC Service Controls](/build/docs/private-pools/using-vpc-service-controls).\n\n- Learn about how Cloud Deploy uses [service accounts](/deploy/docs/cloud-deploy-service-account).\n\n- [Access private GKE clusters with Cloud Build private pools](/architecture/accessing-private-gke-clusters-with-cloud-build-private-pools)."]]