Workload Identity Federation for GKE(WIF)は、クラスタのワークロードが Kubernetes サービス アカウントを使って外部クラウド リソースにアクセスするためのメカニズムです。WIF は、GKE 接続クラスタ内で実行されているアプリケーションが Google Cloud サービスにアクセスする場合におすすめの方法です。クラスタを登録すると、GKE 接続クラスタ API が WIF に必要なすべてのインフラストラクチャを作成し、一般公開または限定公開のいずれかの OIDC 発行者を使用するクラスタをサポートします。
Workload Identity Federation for GKE は、Connect やテレメトリー エージェントなど、 Google Cloudに接続するすべての GKE Enterprise サービスで使用されます。
Kubernetes サービス アカウントと Workload Identity Federation for GKE
Pod が実行されると、それは Kubernetes サービス アカウントを使用して、クラスタ内でホストされているリソースへのアクセスを承認します。WIF を使用することで、Pod は同じ Kubernetes サービス アカウント(KSA)を使用して、クラスタの外部でホストされているリソースにアクセスするための有効期間が短いトークンを取得します。
WIF が機能するには、クラスタ内部の OIDC ID プロバイダと Google Cloud IAM などの外部リソース プロバイダの間の信頼関係が必要です。接続クラスタの登録時には、 Google Cloud プロジェクトにバインドされているデフォルトの Workload Identity プールにクラスタの OIDC サービスが追加されることにより、この信頼関係が自動的に作成されます。
この Workload Identity プールは、Google プロジェクトの信頼できる ID プロバイダのプールで、PROJECT_ID.svc.id.goog という名前です。ここで、PROJECT_ID は、接続クラスタに関連付けられている Google プロジェクト ID です。
KSA による Google Cloud サービスへのアクセスは、通常の Google Cloud IAM ポリシーによって制御できます。Kubernetes サービス アカウント プリンシパルは、Workload Identity プール内の KSA を表します。これらの形式は次のとおりです。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["わかりにくい","hardToUnderstand","thumb-down"],["情報またはサンプルコードが不正確","incorrectInformationOrSampleCode","thumb-down"],["必要な情報 / サンプルがない","missingTheInformationSamplesINeed","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-08-30 UTC。"],[],[],null,["Workload Identity Federation for GKE (WIF) is a mechanism that lets your cluster's\nworkloads access external cloud resources with Kubernetes Service Accounts. WIF\nis the recommended way for applications running within GKE attached clusters\nto access Google Cloud services. When you register your cluster, the\nGKE attached clusters API creates all the infrastructure required for WIF, with\nsupport for clusters that use either public or private OIDC issuers.\n\nAll GKE components that connect back to Google Cloud,\nsuch as Connect and telemetry agents, use Workload Identity Federation for GKE.\n\nKubernetes service accounts and Workload Identity Federation for GKE\n\nWhen a Pod runs, it uses a\n[Kubernetes service account](https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/)\nto authorize its access to resources hosted within its cluster. By using\nWIF, the Pod can use the same Kubernetes Service\nAccount (KSA) to obtain a short-lived token to access resources hosted outside\nthe cluster.\n\nWIF requires a trust relationship between the OIDC identity provider inside the\ncluster and the external resource provider, such as Google Cloud IAM. When you register\nan Attached Cluster, the registration process automatically creates this trust\nrelationship by adding your cluster's OIDC service to the default workload\nidentity pool bound to your Google Cloud project.\n\nThis workload identity pool is your Google project's pool of trusted identity\nproviders and is named `PROJECT_ID.svc.id.goog`, where `PROJECT_ID` is the\nGoogle Project ID associated with your attached cluster.\n\nYou can use regular Google Cloud IAM policies to control access by Kubernetes Service\nAccounts to Google Cloud services. Kubernetes Service Account principals are the\nrepresentation of the KSA within the workload identity pool. They're\nformatted as following: \n\n serviceAccount:WORKLOAD_IDENTITY_POOL_NAME[KSA_NAMESPACE/KSA_NAME]\n\nTo grant a role to the Kubernetes service account, use the following command: \n\n gcloud projects add-iam-policy-binding \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e \\\n --member=\"serviceAccount:\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e.svc.id.goog[\u003cvar translate=\"no\"\u003eKSA_NAMESPACE\u003c/var\u003e/\u003cvar translate=\"no\"\u003eKSA_NAME\u003c/var\u003e]\" \\\n --role=\u003cvar translate=\"no\"\u003eIAM_ROLE\u003c/var\u003e\n\nReplace:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: your Google Cloud project ID\n- \u003cvar translate=\"no\"\u003eKSA_NAMESPACE\u003c/var\u003e: the cluster namespace that this service account resides in\n- \u003cvar translate=\"no\"\u003eKSA_NAME\u003c/var\u003e: the name of the Kubernetes service account you want to grant permissions to\n- \u003cvar translate=\"no\"\u003eIAM_ROLE\u003c/var\u003e: the Google Cloud role you want to grant to this KSA"]]