Stay organized with collections
Save and categorize content based on your preferences.
Set up clusters for GKE Identity Service with SAML
This document is for cluster administrators or application operators who want to set up GKE Identity Service on individual clusters, allowing developers and other users to log in to the clusters using their existing identity details from a Security Assertion Markup Language (SAML) provider. The guide assumes that you have read the GKE Identity Service overview.
The instructions in this document assume that GKE Identity Service has already been registered with your identity provider as a client application.
Ensure that you have the following command line tools installed:
Use the 466.0.0 version of the Google Cloud CLI or higher, which includes gcloud, the command line tool for interacting with Google Cloud. If you need to install the Google Cloud CLI, see the installation guide.
kubectl for running commands against Kubernetes clusters. If you need to install kubectl, follow these instructions.
If you are using Cloud Shell as your shell environment for interacting with Google Cloud, these tools are installed for you.
Ensure that you have initialized the gcloud CLI for use with the project where the clusters are registered.
Configure the cluster
GKE Identity Service uses a special Kubernetes custom resource type (CRD)
to configure your clusters called ClientConfig, with fields for information about
the identity provider and the parameters it needs to return user information.
kubectl
To edit your default ClientConfig, make sure you can connect to your cluster
using kubectl, and run the following command:
Replace KUBECONFIG_PATH with the path to your
cluster's kubeconfig file—for example $HOME/.kube/config.
A text editor loads your cluster's ClientConfig resource. Add the saml
object as indicated in the snippet.
apiVersion:authentication.gke.io/v2alpha1kind:ClientConfigmetadata:name:defaultnamespace:kube-publicspec:authentication:-name:NAMEsaml:idpEntityID:ENTITY_IDidpSingleSignOnURI:SIGN_ON_URIidpCertificateDataList:IDP_CA_CERTuserAttribute:USER_ATTRIBUTEgroupsAttribute:{'<varname="userattribute">GROUPS_ATTRIBUTE</var>'}}userPrefix:USER_PREFIXgroupPrefix:GROUP_PREFIXattributeMapping:ATTRIBUTE_KEY_1 :ATTRIBUTE_CEL_EXPRESSION_1ATTRIBUTE_KEY_2 :ATTRIBUTE_CEL_EXPRESSION_2certificateAuthorityData:CERTIFICATE_STRINGpreferredAuthentication:PREFERRED_AUTHENTICATIONserver:<>
# Rest of the resource is managed by Google. DO NOT MODIFY....
You can configure multiple identity providers in your ClientConfig according to your requirements. This streamlines management and provides flexibility, letting you configure diverse authentication methods within a unified configuration resource. The following example ClientConfig defines multiple identity providers in the required order of authentication precedence.
The following table describes the fields of the ClientConfig saml object. The
fields you need to add depend on your identity provider and the setup options
chosen by your platform administrator when configuring the provider for GKE Identity Service.
Field
Required
Description
Format
name
Yes
The name you want to use to identify this configuration, typically the identity provider name. A configuration name must start with a letter followed by up to 39 lowercase letters, numbers, or hyphens, and cannot end with a hyphen.
String
idpEntityID
Yes
The SAML entity ID for the SAML provider, specified in a URI format. For example: https://www.idp.com/saml.
URL String
idpSingleSignOnURI
yes
The SAML provider SSO endpoint, specified in a URI format. For example: https://www.idp.com/saml/sso.
URL String
idpCertificateDataList
Yes
Corresponds to the identity provider certificates used to verify the SAML response.
These certificates must be standard base64 encoded and PEM formatted. Only a
maximum of two certificates are supported to facilitate identity provider
certificate rotation.
String
userAttribute
No
Name of the attribute in the SAML response that holds the username.
String
groupsAttribute
No
Name of the attribute in the SAML response that holds the user's group information.
String
userPrefix
No
The prefix you want to prepend to user claims to prevent clashes with
existing names, if you don't want to use the default prefix.
String
groupPrefix
No
The prefix you want to prepend to security group names. This is to avoid
clashes with existing names in your access control rules if you have
configurations for multiple identity providers (typically the provider name).
String
attributeMapping
No
The mapping of additional user attributes.
String
certificateAuthorityData
No
If provided by your platform administrator, this is a PEM-encoded certificate
string for the identity provider. Include the resulting string in certificateAuthorityData as a single line.
String
preferredAuthentication
No
Name of the preferred authentication method configured in the cluster.
String
After you complete your ClientConfig, save the file, which updates the
ClientConfig on your cluster. If you've made any syntax errors, you are
prompted to re-edit the configuration to fix them.
[[["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-08-28 UTC."],[],[],null,["# Set up clusters for GKE Identity Service with SAML\n==================================================\n\nThis document is for **cluster administrators** or application operators who want to set up GKE Identity Service on individual clusters, allowing developers and other users to log in to the clusters using their existing identity details from a [Security Assertion Markup Language (SAML)](https://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html) provider. The guide assumes that you have read the GKE Identity Service [overview](/kubernetes-engine/enterprise/identity).\nThe instructions in this document assume that GKE Identity Service has already been [registered with your identity provider](/kubernetes-engine/enterprise/identity/setup/saml-provider) as a client application.\n\nBefore you begin\n----------------\n\n- Ensure that your platform administrator has given you all the necessary information from [Register GKE Identity Service with your provider](/kubernetes-engine/enterprise/identity/setup/saml-provider) before you start setup.\n- Ensure that you have the following command line tools installed:\n\n - Use the 466.0.0 version of the Google Cloud CLI or higher, which includes `gcloud`, the command line tool for interacting with Google Cloud. If you need to install the Google Cloud CLI, see the [installation guide](/sdk/docs/install).\n - `kubectl` for running commands against Kubernetes clusters. If you need to install `kubectl`, follow these [instructions](/kubernetes-engine/fleet-management/docs/before-you-begin#install-kubectl).\n\n If you are using Cloud Shell as your shell environment for interacting with Google Cloud, these tools are installed for you.\n- Ensure that you have [initialized](/sdk/docs/install-sdk#initializing_the) the gcloud CLI for use with the project where the clusters are registered.\n\nConfigure the cluster\n---------------------\n\nGKE Identity Service uses a special Kubernetes custom resource type (CRD)\nto configure your clusters called ClientConfig, with fields for information about\nthe identity provider and the parameters it needs to return user information. \n\n### kubectl\n\nTo edit your default ClientConfig, make sure you can connect to your cluster\nusing `kubectl`, and run the following command: \n\n kubectl --kubeconfig=\u003cvar translate=\"no\"\u003eKUBECONFIG_PATH\u003c/var\u003e edit ClientConfigs default -n kube-public\n\nReplace \u003cvar translate=\"no\"\u003eKUBECONFIG_PATH\u003c/var\u003e with the path to your\ncluster's kubeconfig file---for example `$HOME/.kube/config`.\n\nA text editor loads your cluster's ClientConfig resource. Add the `saml`\nobject as indicated in the snippet. \n\n apiVersion: authentication.gke.io/v2alpha1\n kind: ClientConfig\n metadata:\n name: default\n namespace: kube-public\n spec:\n authentication:\n - name: \u003cvar name=\"name\" translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eNAME\u003c/span\u003e\u003c/var\u003e\n saml:\n idpEntityID: \u003cvar name=\"entity id\" translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eENTITY_ID\u003c/span\u003e\u003c/var\u003e\n idpSingleSignOnURI: \u003cvar name=\"sign on uri\" translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eSIGN_ON_URI\u003c/span\u003e\u003c/var\u003e\n idpCertificateDataList: \u003cvar name=\"idp ca cert\" translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eIDP_CA_CERT\u003c/span\u003e\u003c/var\u003e\n userAttribute: \u003cvar name=\"user attribute\" translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eUSER_ATTRIBUTE\u003c/span\u003e\u003c/var\u003e\n groupsAttribute: {'\u003cvar name=\"user attribute\"\u003eGROUPS_ATTRIBUTE\u003c/var\u003e'}}\n userPrefix: \u003cvar name=\"user prefix\" translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eUSER_PREFIX\u003c/span\u003e\u003c/var\u003e\n groupPrefix: \u003cvar name=\"group prefix\" translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eGROUP_PREFIX\u003c/span\u003e\u003c/var\u003e\n attributeMapping:\n ATTRIBUTE_KEY_1 : \u003cvar name=\"attribute cel expression 1\" translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eATTRIBUTE_CEL_EXPRESSION_1\u003c/span\u003e\u003c/var\u003e\n ATTRIBUTE_KEY_2 : \u003cvar name=\"attribute cel expression 2\" translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eATTRIBUTE_CEL_EXPRESSION_2\u003c/span\u003e\u003c/var\u003e\n certificateAuthorityData: \u003cvar name=\"cert string\" translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eCERTIFICATE_STRING\u003c/span\u003e\u003c/var\u003e\n preferredAuthentication: \u003cvar name=\"auth string\" translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003ePREFERRED_AUTHENTICATION\u003c/span\u003e\u003c/var\u003e\n server: \u003c\u003e\n\n # Rest of the resource is managed by Google. DO NOT MODIFY.\n ...\n\n| **Tip:** GKE Identity Service lets you configure multiple OIDC, LDAP, and SAML identity provider configurations in a single `ClientConfig` custom resource (CRD) for client authentication. GKE Identity Service attempts authentication with each CRD in the order they are defined, and stops after the first successful authentication.\n\nYou can configure multiple identity providers in your `ClientConfig` according to your requirements. This streamlines management and provides flexibility, letting you configure diverse authentication methods within a unified configuration resource. The following example `ClientConfig` defines multiple identity providers in the required order of authentication precedence. \n\n apiVersion: v1\n items:\n - apiVersion: authentication.gke.io/v2alpha1\n kind: ClientConfig\n ...\n spec:\n authentication:\n - aws:\n region: us-west-2\n name: AWS Login\n - ldap:\n ...\n - saml:\n ...\n - azureAD:\n ...\n - oidc:\n name: Okta OIDC\n ...\n -oidc:\n name: Google OIDC\n ...\n\nThe following table describes the fields of the ClientConfig `saml` object. The\nfields you need to add depend on your identity provider and the setup options\nchosen by your platform administrator when configuring the provider for GKE Identity Service.\n\nAfter you complete your ClientConfig, save the file, which updates the\nClientConfig on your cluster. If you've made any syntax errors, you are\nprompted to re-edit the configuration to fix them.\n\nWhat's next?\n------------\n\nAfter the configuration is applied, continue to [set up user access to clusters](/kubernetes-engine/enterprise/identity/setup/user-access)."]]