Gerenciar identidade com o serviço de identidade do GKE
Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
O GKE na AWS é compatível com o
OpenID Connect (OIDC)
e o
AWS IAM como um
mecanismo de autenticação para interagir com a API Kubernetes de um cluster. 101}usando o serviço de identidade do GKE. O serviço de identidade do GKE é um serviço de autenticação que permite trazer as soluções de identidade existentes para
autenticação em vários ambientes. Os usuários podem fazer login e
usar os clusters do GKE na linha de comando ou no console do
Google Cloud. Tudo isso usando o provedor de identidade atual.
Se você já usa ou quer usar as identidades do Google para fazer login
nos clusters do GKE, recomendamos usar o
comando gcloud containers aws clusters get-credentials para autenticação. Saiba mais
em
Conectar e autenticar seu cluster.
Para autenticar pelo Console do Google Cloud, você precisa
registrar cada cluster
que quer configurar com sua frota de projeto. Para o GKE na AWS,
isso será automático depois que você criar um pool de nós.
Para permitir que os usuários se autentiquem pelo Console do Google Cloud, verifique se todos
os clusters que você quer configurar estão
registrados com a frota do projeto.
Para o GKE na AWS, isso será automático depois que você criar um pool de nós.
Depois de configurar o GKE Identity Service em um cluster, os usuários podem fazer login
em clusters usando a linha de comando ou o console do Google Cloud.
Para usar a autenticação do IAM da AWS, os usuários precisam ser capazes de se conectar ao plano de controle do
cluster. Consulte Conectar-se ao plano de controle do cluster.
Processo de configuração e opções
Para configurar o cluster para permitir a autenticação do IAM da AWS em uma determinada região da AWS,
faça o seguinte:
Substitua KUBECONFIG_PATH pelo caminho para o
arquivo kuneconfig do cluster, por exemplo, $HOME/.kube/config.
Um editor de texto carrega o recurso ClientConfig do cluster. Adicione o objeto spec.authentication.aws conforme mostrado abaixo. Não modifique nenhum
dado padrão que já tenha sido gravado.
NAME: um nome arbitrário desse método de autenticação (por exemplo, "aws-iam").
AWS_REGION: a região da AWS em que as informações do usuário são
recuperadas. Ele precisa corresponder à região configurada na CLI da AWS dos usuários.
Depois de configurar o GKE Identity Service em um cluster, os usuários podem fazer login
em clusters usando a linha de comando ou o console do Google Cloud.
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2024-07-01 UTC."],[],[],null,["# Manage identity with GKE Identity Service\n\nGKE on AWS supports\n[OpenID Connect (OIDC)](https://openid.net/connect/)\nand\n[AWS IAM](https://aws.amazon.com/iam/) as an\nauthentication mechanism for interacting with a cluster's Kubernetes API\nserver, using GKE Identity Service. GKE Identity Service is an\nauthentication service that lets you bring your existing identity solutions for\nauthentication to multiple environments. Users can log in to and\nuse your GKE clusters from the command line or from the\nGoogle Cloud console, all using your existing identity provider.\n\nFor an overview of how GKE Identity Service works, see\n[Introducing GKE Identity Service](/anthos/identity).\n\nIf you already use or want to use Google identities to log in to your\nGKE clusters, we recommend using the\n`gcloud containers aws clusters get-credentials` command for authentication. Find out\nmore in\n[Connect and authenticate to your cluster](/kubernetes-engine/multi-cloud/docs/aws/how-to/connect-and-authenticate-to-your-cluster#google-identity).\n\nOpenID Connect authentication\n-----------------------------\n\n### Before you begin\n\n1. To use OIDC authentication, users must be able to connect to the cluster's control\n plane. See\n [Connect to your cluster's control plane](/kubernetes-engine/multi-cloud/docs/aws/how-to/connect-and-authenticate-to-your-cluster#connect-to-vpn).\n\n2. To authenticate through the Google Cloud console, you must\n [register each cluster](/anthos/multicluster-management/connect/registering-a-cluster)\n that you want to configure with your project fleet. For GKE on AWS,\n this is automatic once you have created a node pool.\n\n3. To allow users to authenticate through the Google Cloud console, ensure that all\n clusters you want to configure are\n [registered with your project fleet](/anthos/multicluster-management/connect/registering-a-cluster).\n For GKE on AWS, this is automatic once you have created a node pool.\n\n### Setup process and options\n\n1. Register GKE Identity Service as a client with your OIDC provider\n following the instructions in\n [Configuring providers for GKE Identity Service](/anthos/identity/setup/provider).\n\n2. Choose from the following cluster configuration options:\n\n - Configure your clusters at the fleet-level following the instructions in\n [Configuring clusters for fleet-level GKE Identity Service](/anthos/identity/setup/fleet-cluster).\n With this option, your authentication configuration is centrally managed by\n Google Cloud.\n\n - Configure your clusters individually following the instructions in\n [Configuring clusters for GKE Identity Service with OIDC](/anthos/identity/setup/per-cluster).\n\n3. Set up user access to your clusters, including role-based access control\n (RBAC), following the instructions in\n [Setting up user access for GKE Identity Service](/anthos/identity/setup/user-access).\n\n### Accessing clusters\n\nAfter GKE Identity Service has been set up on a cluster, users can log in\nto clusters using either the command line or the Google Cloud console.\n\n- Learn how to log in to registered clusters with your OIDC ID in [Accessing clusters using GKE Identity Service](/anthos/identity/accessing).\n- Learn how to log in to clusters from the Google Cloud console in [Logging in to a cluster from the Google Cloud console](/anthos/multicluster-management/console/logging-in).\n\nAWS IAM authentication\n----------------------\n\nThe AWS IAM support on GKE on AWS uses\n[GKE Identity Service](/anthos/identity).\n\n### Before you begin\n\nTo use AWS IAM authentication, users must be able to connect to the cluster's control\nplane. See\n[Connect to your cluster's control plane](/kubernetes-engine/multi-cloud/docs/aws/how-to/connect-and-authenticate-to-your-cluster#connect-to-vpn).\n\n### Setup process and options\n\nTo configure your cluster to allow AWS IAM authentication for a particular AWS region,\ndo the following:\n\n1. Edit the `ClientConfig` resource on your cluster:\n\n kubectl --kubeconfig=\u003cvar translate=\"no\"\u003eKUBECONFIG_PATH\u003c/var\u003e edit ClientConfigs default -n kube-public\n\n Replace \u003cvar translate=\"no\"\u003eKUBECONFIG_PATH\u003c/var\u003e with the path to your\n cluster's kubeconfig file---for example `$HOME/.kube/config`.\n\n Your text editor loads your cluster's ClientConfig resource. Add the\n `spec.authentication.aws` object as shown below. Do not modify any\n default data that has already been written. \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 aws:\n region: \u003cvar name=\"aws region\" translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eAWS_REGION\u003c/span\u003e\u003c/var\u003e\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eNAME\u003c/var\u003e: an arbitrary name of this authentication method. e.g. \"aws-iam\".\n - \u003cvar translate=\"no\"\u003eAWS_REGION\u003c/var\u003e: the AWS region where the user info is retrieved. It needs to match the region configured on your users' AWS CLI.\n2. To enable your cluster users to use AWS IAM, follow\n [Setting up user access for GKE Identity Service](/anthos/identity/setup/user-access).\n\n### Accessing clusters\n\nAfter GKE Identity Service has been set up on a cluster, users can log in\nto clusters using either the command line or the Google Cloud console.\n\nTo learn how to log in to registered clusters with your AWS IAM identity, see\n[Accessing clusters using GKE Identity Service](/anthos/identity/accessing)."]]