If the ClientConfig is not present in the cluster, then install and configure
GKE Identity Service on the cluster. For more information on cluster
setup options, seeSetup options for clusters.
gcloud anthos create-login-configfails because of duplicate cluster name
This issue occurs if you attempt to create login configuration for a cluster
into a file that already contains a login configuration for this cluster.
Error message
error merging with fileFILENAMEbecauseFILENAMEcontains a
cluster with the same name as the one read fromKUBECONFIG.
Solution
To resolve this issue, use the--outputflag to specify a new destination file.
If you do not provide--output, this login configuration data is written to a
file namedkubectl-anthos-config.yamlin the current directory.
This issue occurs when there is an error in thehttps_proxyorHTTPS_PROXYenvironment variable configurations. If there's anhttps://specified in the
environment variables, then the GoLang HTTP client libraries might fail if the
proxy is configured to handle HTTPS connections using other protocols such as
SOCK5.
Error message
proxyconnect tcp: tls: first record does not look like a TLS handshake
Solution
To resolve this issue, modify thehttps_proxyandHTTPS_PROXYenvironment
variables to omit thehttps:// prefix. On Windows, modify the system
environment variables.
For example, change the value of thehttps_proxyenvironment variable fromhttps://webproxy.example.com:8000towebproxy.example.com:8000.
Cluster access fails when using kubeconfig generated bygcloud anthos auth login
This issue occurs when the Kubernetes API server is unable to authorize the
user for one of the following reasons:
There is an error in the configuration used to login with thegcloud anthos auth logincommand.
The necessary RBAC policies are incorrect or missing for the user.
Error message
Unauthorized
Solution
To resolve this issue, do the following:
Verify configuration used to login.
OIDC configuration
Theauthentication.oidcsection in the user cluster configuration file hasgroupandusernamefields that are used to set the--oidc-group-claimand--oidc-username-claimflags in the Kubernetes API server. When the API
server is presented with a user's identity token, it forwards the token to
GKE Identity Service, which returns the extractedgroup-claimandusername-claimback to the API server. The API server uses the response to
verify that the corresponding group or user has the correct permissions.
Verify that the claims set forgroupanduserin theauthentication.oidcsection of the cluster configuration file are present in the ID token.
After you rungcloud anthos auth logincommand to initiate theOIDC authentication flow, the ID Token is stored in thekubeconfigfile in theid-tokenfield. Usejwt.ioto decode the ID token and verify if it contains the group information of the user as expected.
If ID token does not have group information of the user, then correctly configure the OIDC provider to return the group information as per the documentation of your OIDC provider. For example, if you're using OIDC configuration of the Okta Identity provider, then follow the documentation of the Okta Identity provider to configure groups in the ID token.
If the ID token has group information, then verify if the group information key in the ID token matches thegroupsClaimfield configured under theoidcsection.
For example, if the ID token contains group information in thegroupskey:
"groups" : ["group1", "group2" ...]
then the value of thegroupsClaimfield should begroupsin theoidcsection.
If you have problems using OIDC or LDAP with your GKE cluster, follow the
steps in this section to troubleshoot GKE Identity Service and help
determine if there's an issue with your identity provider configuration.
Enable the GKE Identity Service debug log
To help troubleshoot identity-related issues in your cluster, enable the
GKE Identity Service debug log.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-10-24 UTC."],[],[]]