Workload identity using cli
-
Enable Workload Identity on the GKE cluster:
-
To enable Workload Identity Federation for GKE on an existing cluster, run the following command:
Replace the following:Text Only - CLUSTER_NAME: the name of your new cluster.
- LOCATION: the Compute Engine location for the cluster.
- PROJECT_ID: your Google Cloud project ID.
-
To modify an existing node pool to use Workload Identity Federation for GKE, run the following command:
Replace the following:Text Only - NODEPOOL_NAME: the name of the new node pool.
- CLUSTER_NAME: the name of the existing cluster with Workload Identity Federation for GKE enabled.
- REGION: the region where the cluster is located.
-
-
Create an IAM policy that allows the Kubernetes ServiceAccount to impersonate the IAM service account::
- Run the following command to add the IAM policy binding: Replace the following:
Text Only - PROJECT_ID: your Google Cloud project ID.
- NAMESPACE: the Kubernetes namespace name.
- KSA_NAME: the Kubernetes ServiceAccount name Eg.
connector-<CONNECTOR-NAME>-<INSTANCE-NAME>-privacera-sa
. - IAM_SA_NAME: the IAM service account name.
- Run the following command to add the IAM policy binding:
Note
If you don't have an existing cluster in your GCP project, please follow the instructions at this link Refer to create a new cluster and node pool.