Utilizzo degli ambienti di esecuzione di Cloud Deploy
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Un ambiente di esecuzione di Cloud Deploy รจ l'ambiente in cui Cloud Deploy esegue le operazioni di rendering, predeployment, deployment, verifica e post-deployment. L'ambiente di esecuzione รจ costituito dai seguenti componenti:
Il pool di worker Cloud Build
(predefinito o privato) in cui Cloud Deploy esegue le operazioni di rendering, predeployment, deployment, verifica e postdeployment
L'account di servizio (predefinito o alternativo) che chiama Cloud Deploy per eseguire queste azioni
La posizione di archiviazione (predefinita o alternativa) per i manifest visualizzati in Cloud Storage
Il timeout di Cloud Build per le operazioni (predefinito o personalizzato)
Questo articolo descrive l'ambiente di esecuzione, gli account di servizio e lo spazio di archiviazione predefiniti per Cloud Deploy, nonchรฉ il motivo e il modo in cui puoi modificare queste impostazioni predefinite.
Predefiniti
Di seguito sono riportate le impostazioni predefinite utilizzate da Cloud Deploy per l'esecuzione, per eseguire il rendering e il deployment e per archiviare asset come i manifest con rendering:
Posizione di archiviazione predefinita di Cloud Deploy
Questo valore รจ il bucket Cloud Storage in cui Cloud Deploy
memorizza i manifest con rendering. Per impostazione predefinita, Cloud Deploy crea un bucket Cloud Storage nella stessa regione delle risorse Cloud Deploy, nel seguente formato:
Per impostazione predefinita, Cloud Build ha un timeout di 1 ora per le operazioni eseguite per Cloud Deploy. Puoi modificare questo timeout nella
specifica dell'ambiente di esecuzione in
configurazione di destinazione.
Dettagliatezza predefinita per Skaffold, gcloud CLI e kubectl
Per impostazione predefinita, i livelli di log di questi strumenti sono impostati sui rispettivi valori predefiniti, tipicamente warn o l'equivalente. Puoi modificare
questo valore in debug o l'equivalente.
Le sezioni che seguono descrivono le circostanze in cui potresti modificare uno di questi valori e i link alle istruzioni per farlo.
Informazioni sui pool di worker di Cloud Build
L'ambiente di esecuzione di Cloud Deploy puรฒ utilizzare uno dei seguenti elementi:
Il pool di worker predefinito รจ un ambiente ospitato sicuro con accesso alla rete internet pubblica. Le operazioni di rendering, deployment, pre-deployment, post-deployment e verifica vengono eseguite in questo pool, isolate da altri workload.
Un pool privato
I pool di worker privati sono pool privati e dedicati che possono essere personalizzati piรน del pool di worker predefinito. Questa personalizzazione puรฒ includere la possibilitร di accedere alle risorse in una rete privata. Come il pool di worker predefinito, i pool di worker privati sono ospitati
e gestiti completamente da Cloud Build. Questi pool possono essere scalati verso l'alto o verso il basso fino a zero, senza infrastrutture da configurare, eseguire l'upgrade o scalare.
La Panoramica dei pool privati di Cloud Build descrive in modo piรน approfondito i pool di worker predefiniti e i pool di worker privati, inclusa una tabella che ne mette a confronto le funzionalitร .
Modifica dell'ambiente di esecuzione di Cloud Deploy
Puoi modificare l'ambiente di esecuzione di Cloud Deploy nelle seguenti circostanze:
Vuoi eseguire operazioni di rendering, deployment, pre-deployment, post-deployment o verifica o una combinazione delle cinque in un ambiente isolato da altre organizzazioni.
Vuoi che queste operazioni vengano eseguite in un ambiente non collegato alla rete internet pubblica.
Vuoi ambienti separati per il rendering e il deployment.
Vuoi utilizzare un account di servizio dedicato con autorizzazioni piรน specifiche per il tuo utilizzo rispetto a quelle disponibili nell'account di servizio predefinito.
Vuoi archiviare i manifest visualizzati in una posizione diversa dal bucket Cloud Storage predefinito.
La configurazione di tutte e tre le parti dell'ambiente di esecuzione (pool di worker, account servizio e archiviazione) viene eseguita per destinazione, nella configurazione YAML di ogni destinazione.
Passare dal pool predefinito a un pool privato
Configura i pool di worker per target,
in modo che il pool venga utilizzato per RENDER, DEPLOY, PREDEPLOY, POSTDEPLOY o
VERIFY (o una combinazione dei cinque) solo per quel target.
Per utilizzare il pool di worker predefinito sia per le operazioni di rendering sia per quelle di deployment, non devi fare nulla.
Di seguito รจ riportata una configurazione di destinazione di esempio che specifica un pool di worker privato per DEPLOY e il pool di worker predefinito per RENDER, PREDEPLOY,
POSTDEPLOY e VERIFY:
Passaggio dall'account di servizio di esecuzione predefinito a quello personalizzato
Come per il pool di worker, puoi specificare un account di servizio alternativo da utilizzare per il rendering o il deployment (o per entrambi) per destinazione. A tal fine, aggiungi la riga seguente alla configurazione di destinazione dopo l'elemento workerPool:
Modificare il livello di log per Skaffold, gcloud CLI e kubectl
Per modificare il livello di log di Skaffold, dell'interfaccia a riga di comando gcloud e di kubectl dalle rispettive impostazioni predefinite a debug (o l'equivalente), imposta verbose su true nelle configurazioni di esecuzione. Ecco un esempio:
Devi utilizzare un pool di worker privato di Cloud Build per l'ambiente di esecuzione del target, non il pool di worker predefinito.
Il progetto che contiene il pool di worker e il progetto che contiene le risorse Cloud Deploy devono rimanere nello stesso perimetro di sicurezza dei Controlli di servizio VPC.
Qualsiasi cluster GKE in cui esegui il deployment nel perimetro dei Controlli di servizio VPC deve essere un cluster privato.
Per configurare un pool privato per un cluster privato, consulta questo tutorial.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema รจ stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-09-03 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)."]]