Workload identity using console
-
Enable Workload Identity on the GKE cluster:
-
To enable Workload Identity Federation for GKE on an existing cluster:
- Navigate to Kubernetes Engine > Clusters.
- Select the cluster name.
- In the Workload Identity section, Click Edit, select the Enable Workload Identity checkbox.
- Click Save.
-
To modify an existing node pool to use Workload Identity Federation for GKE, perform the following steps:
- Navigate to Kubernetes Engine > Clusters.
- Click on the cluster name.
- Click on the Node tab.
- Click on the node pool name you want to modify.
- Click Edit.
- In the Security section, select the Enable GKE Metadata Server checkbox.
- Click Save.
-
-
Create an IAM allow policy that grants the Kubernetes ServiceAccount permission to impersonate the IAM service account:
-
Go to the IAM & Admin page in the Google Cloud Console.
- Click on Service accounts in the sidebar.
- Find and select your service account.
- Go to the Permissions tab.
- Click Grant Access, and in the role section, search for workload identity user.
- In Principal name add
<PROJECT-ID>.svc.id.goog[<NAMESPACE-NAME>/<KSA_NAME>]
.- PROJECT_ID: your Google Cloud project ID.
- Namespace-name: the Kubernetes namespace name.
- KSA_NAME: the Kubernetes ServiceAccount name Eg.
connector-<connector-name>-<Instance-Name>-privacera-sa
.
- Click Save.
Note
If you don’t have an existing cluster in your GCP project, follow the instructions at this link Refer to create a new cluster and node pool.