Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Panoramica di Workload Identity
Workload Identity ti consente di assegnare identità e autorizzazioni distinte e granulari per ogni applicazione nel tuo cluster. Workload Identity è il metodo consigliato per consentire alle applicazioni in esecuzione in GKE su Azure di accedere ai servizi Google Cloud e Azure.
In tutti i cluster GKE è abilitata l'identità del carico di lavoro.
Service account Kubernetes
Workload Identity implementa la federazione delle identità o la delega della attendibilità o dei ruoli a un provider esterno. Ogni cluster ha un provider OpenID Connect (OIDC) integrato. Quando un pod viene eseguito nel cluster, viene eseguito utilizzando un
account di servizio Kubernetes.
Il pod può essere configurato per ottenere un token con credenziali di breve durata per il suo account di servizio Kubernetes utilizzando un volume di token account di servizio vincolato.
Provider OpenID Connect
Ogni cluster può fungere da provider OpenID Connect (OIDC). Con questo provider, puoi fornire le credenziali dell'account di servizio Kubernetes ai servizi che supportano la federazione delle identità utilizzando OIDC.
L'URI dell'emittente di questo provider funge anche da endpoint di rilevamento OIDC. I servizi possono utilizzare questo endpoint di discovery per ottenere l'insieme di chiavi web JSON (JWKS), che fornisce informazioni sulle chiavi pubbliche che consentono di verificare le credenziali dell'account servizio Kubernetes.
Google Cloud Provider e pool di identità IAM
Google Cloud IAM supporta la federazione delle identità tramite OIDC.
Tutti i cluster GKE sono configurati come provider di identità nel
pool di identità del workload PROJECT_ID.svc.id.goog.
Esistono metodi alternativi per accedere ai servizi da GKE su Azure.
Non consigliamo i seguenti metodi a causa di complicazioni.
Esporta le credenziali e archiviale come secret di Kubernetes. In questo caso,
devi ruotare manualmente le credenziali archiviate sia in Azure IAM sia
nel tuo cluster. Inoltre, se un utente malintenzionato ruba le credenziali, può
esploitarle.
Collega le credenziali alle istanze sottostanti dei pool di nodi. In questo caso, tutti i workload in esecuzione sullo stesso nodo condividono le credenziali, il che può comportare un insieme di autorizzazioni maggiore di quello necessario per i workload. Per bloccare l'accesso alle autorizzazioni di un'istanza, i cluster GKE bloccano l'accesso da un pod al servizio di metadati dell'istanza.
[[["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-04 UTC."],[],[],null,["# Workload identity overview\n==========================\n\n*Workload identity* enables you to assign distinct, fine-grained identities and\nauthorization for each application in your cluster. Workload identity is the\nrecommended way for applications running within GKE on Azure to access\nAzure and Google Cloud services.\n\nAll GKE clusters have workload identity enabled.\n\nKubernetes service accounts\n---------------------------\n\nWorkload identity implements *identity federation* , or delegating trust or roles\nto an external provider. Each cluster has a built-in OpenID Connect (OIDC)\nprovider. When a Pod runs in the cluster, it runs using a\n[Kubernetes service account](https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/).\nThe Pod can be configured to obtain a token with short-lived credentials for\nits Kubernetes service account using a\n[Bound Service Account Token Volume](https://kubernetes.io/docs/reference/access-authn-authz/service-accounts-admin/#bound-service-account-token-volume).\n\nOpenID Connect providers\n------------------------\n\nEach cluster can act as an\n[OpenID Connect (OIDC)](https://openid.net/connect/) provider. With\nthis provider, you can provide Kubernetes service account credentials to\nservices that support identity federation using OIDC.\n\nThis provider's issuer URI also serves as an OIDC discovery endpoint. Services\ncan use this discovery endpoint to obtain the JSON Web Key Set (JWKS), which\nprovides public key information that allows them to verify Kubernetes service\naccount credentials.\n\nGoogle Cloud IAM identity pools and providers\n---------------------------------------------\n\nGoogle Cloud IAM supports\n[identity federation using OIDC](https://cloud.google.com/iam/docs/workload-identity-federation).\nAll GKE clusters are configured as identity providers in the\nworkload identity pool \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e`.svc.id.goog`.\n\nTo get the name of your workload identity pool and providers, see\n[Use workload identity with Google Cloud](/kubernetes-engine/multi-cloud/docs/azure/how-to/use-workload-identity-google#determine_the_workload_identity_pool_for_your_cluster).\n\nAlternatives to workload identity\n---------------------------------\n\nThere are alternative methods to access services from GKE on Azure.\nWe don't recommended the following methods due to complications.\n\n1. Export credentials and store them as Kubernetes Secrets. In this case,\n you must rotate stored credentials manually in both Azure IAM and\n in your cluster. Additionally, if an attacker steals credentials, they can\n exploit them.\n\n2. Attach credentials to the node pools's underlying instances. In this case,\n all workloads running on the same node share the credentials,\n which can result in a greater set of permissions than workloads might\n need. To block access to an instance's permissions, GKE clusters\n blocks access from a Pod to the instance metadata service.\n\nWhat's next\n-----------\n\n- [Using workload identity with Google Cloud services](/kubernetes-engine/multi-cloud/docs/azure/how-to/use-workload-identity-google)\n- Learn more about [Workload identity federation](/iam/docs/workload-identity-federation#pools)"]]