Organízate con las colecciones
Guarda y clasifica el contenido según tus preferencias.
Este documento describe cómo puede conectarse a GKE en AWS como miembro de un grupo de Google .
Usar grupos de Google para otorgar acceso al clúster es más eficiente que crear autorizaciones independientes para usuarios individuales. Por ejemplo, supongamos que desea agregar 50 usuarios al grupo Administrador del clúster, 75 al grupo Editor y 100 al grupo Lector. Para permitir que todos estos usuarios se conecten al clúster, deberá crear reglas RBAC en el archivo de manifiesto de Kubernetes para 225 usuarios. Sin embargo, habilitar el acceso al clúster con grupos de Google le ahorra tiempo, ya que solo necesita crear reglas RBAC para tres grupos de Google.
Antes de empezar
Para conectarse a su clúster como miembro de un grupo de Google, debe cumplir los siguientes requisitos previos:
Asegúrate de tener la última versión de la CLI de Google Cloud. Para obtener información sobre cómo actualizar la CLI de Google Cloud, consulta gcloud components update .
Utilice GKE en AWS versión 1.25 o superior, que es necesaria para acceder kubectl mediante la puerta de enlace de conexión.
Conéctate a tu clúster con grupos de Google
Para autorizar a los grupos de Google a conectarse a GKE en AWS, siga estos pasos:
Habilite las API connectgateway y cloudresourcemanager con el siguiente comando:
Reemplace PROJECT_ID con el ID de su proyecto de AWS.
Crea un grupo llamado gke-security-groups como un grupo en el dominio de tu proyecto si no existe.
Cree uno o más subgrupos dentro del grupo gke-security-groups para la autenticación del clúster.
Agregue usuarios a los subgrupos recién creados.
Para acceder kubectl mediante la puerta de enlace de conexión, debe otorgar roles de IAM a los grupos de Google:
Seleccione un rol adecuado para un grupo. Este rol determina cómo interactúa el grupo con la puerta de enlace de conexión. El rol puede ser uno de los siguientes: roles/gkehub.gatewayAdmin , roles/gkehub.gatewayEditor o roles/gkehub.gatewayReader . (Tenga en cuenta que aquí no se otorgan permisos sobre el clúster; ese paso se describe más adelante. Aquí, simplemente se determina cómo los usuarios del grupo pueden manipular la puerta de enlace de conexión).
Ejecute el siguiente comando para otorgar el rol al grupo:
GROUP_NAME : el nombre del grupo al que se concederá acceso
DOMAIN : su dominio de Google Workspace
GATEWAY_ROLE : el rol seleccionado. Por ejemplo, roles/gkehub.gatewayAdmin , roles/gkehub.gatewayEditor o roles/gkehub.gatewayReader .
En un manifiesto de Kubernetes, defina los permisos que cada grupo de Google tiene en el clúster. Por ejemplo, el siguiente manifiesto otorga al grupo de Google cluster-admin-team el rol de administrador del clúster:
Guarde el manifiesto en un archivo y aplíquelo al clúster ejecutando el siguiente comando:
kubectlapply-kubeconfig=KUBECONFIG_PATH-fFILENAME
Reemplace lo siguiente:
KUBECONFIG_PATH : la ruta a su archivo kubeconfig .
FILENAME : el nombre del archivo de manifiesto que usted creó.
Una vez realizados estos pasos, los usuarios de ciertos grupos de Google podrán conectarse al clúster. En el ejemplo, los usuarios del grupo de Google cluster-admin-team pueden conectarse al clúster como administradores.
[[["Es fácil de entender","easyToUnderstand","thumb-up"],["Me ofreció una solución al problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Es difícil de entender","hardToUnderstand","thumb-down"],["La información o el código de muestra no son correctos","incorrectInformationOrSampleCode","thumb-down"],["Me faltan las muestras o la información que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-06-12 (UTC)."],[],[],null,["# Connect Google groups to GKE on AWS\n\nThis document describes how you can connect to GKE on AWS as a member of a\n[Google group](/iam/docs/groups-in-cloud-console).\n\nUsing Google groups to grant cluster access is more efficient than creating\nseparate authorizations for individual users. For example, let's say you want\nto add 50 users to the cluster Administrator group, 75 users to an Editor group,\nand 100 users to a Reader group. Enabling all these users to connect to your\ncluster would require you to create RBAC rules in the Kubernetes manifest file\nfor 225 users. Enabling access to your cluster with Google groups, however\nsaves you time because you only need to create RBAC rules for three Google\ngroups.\n\nBefore you begin\n----------------\n\nTo connect to your cluster as a member of a Google group, you need to satisfy\nthe following prerequisites:\n\n1. Ensure that you have the latest version of the Google Cloud CLI. For\n information on updating gcloud CLI, see\n [`gcloud components update`](/sdk/gcloud/reference/components/update).\n\n2. Use GKE on AWS version 1.25 or above, which is required for `kubectl`\n access using connect gateway.\n\nConnect to your cluster with Google groups\n------------------------------------------\n\nTo authorize Google groups to connect to GKE on AWS, follow these\nsteps:\n\n1. Enable the `connectgateway` and `cloudresourcemanager` APIs\n with the following command:\n\n gcloud services enable --project=\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e \\\n connectgateway.googleapis.com \\\n cloudresourcemanager.googleapis.com\n\n Replace \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e with the ID of your\n AWS project.\n2. Create a group called `gke-security-groups` as a group in your project's\n domain if it doesn't exist.\n\n3. Create one or more sub-groups within the `gke-security-groups` group for\n cluster authentication.\n\n4. Add users to the newly created sub-groups.\n\n5. For `kubectl` access using connect gateway, you need to grant\n IAM roles to Google groups:\n\n 1. Select an appropriate role for a group. This role determines how the\n group interacts with the connect gateway. The role can be\n one of the following: `roles/gkehub.gatewayAdmin`,\n `roles/gkehub.gatewayEditor`, `roles/gkehub.gatewayReader`.\n (Note that you're not granting\n permissions over the cluster here - that step comes later.\n Here, you're just determining how users of the group can manipulate\n the connect gateway.)\n\n 2. Run the following command to grant the role to the group:\n\n gcloud projects add-iam-policy-binding \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e \\\n --member=group:\u003cvar translate=\"no\"\u003eGROUP_NAME\u003c/var\u003e@\u003cvar translate=\"no\"\u003eDOMAIN\u003c/var\u003e \\\n --role=\u003cvar translate=\"no\"\u003eGATEWAY_ROLE\u003c/var\u003e\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: your Google project ID\n - \u003cvar translate=\"no\"\u003eGROUP_NAME\u003c/var\u003e: the name of the group to grant access to\n - \u003cvar translate=\"no\"\u003eDOMAIN\u003c/var\u003e: your Google Workspace domain\n - \u003cvar translate=\"no\"\u003eGATEWAY_ROLE\u003c/var\u003e: the selected role. For example `roles/gkehub.gatewayAdmin`, `roles/gkehub.gatewayEditor`, or `roles/gkehub.gatewayReader`.\n\n | **Note:** To grant `kubectl` access through a private endpoint, follow the preceding steps, but grant `roles/gkemulticloud.viewer` to the Google groups instead.\n6. In a Kubernetes manifest, define the permissions each Google group\n has on the cluster. For example, the following manifest grants the Google\n Group `cluster-admin-team` the role of cluster administrator:\n\n apiVersion: rbac.authorization.k8s.io/v1\n kind: ClusterRoleBinding\n metadata:\n name: gateway-cluster-admin-group\n subjects:\n - kind: Group\n name: cluster-admin-team@example.com\n roleRef:\n kind: ClusterRole\n name: cluster-admin\n apiGroup: rbac.authorization.k8s.io\n\n7. Save the manifest to a file and apply it to the cluster by running the\n following command:\n\n kubectl apply -kubeconfig=\u003cvar translate=\"no\"\u003eKUBECONFIG_PATH\u003c/var\u003e -f \u003cvar translate=\"no\"\u003eFILENAME\u003c/var\u003e\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eKUBECONFIG_PATH\u003c/var\u003e: the path to your `kubeconfig` file.\n - \u003cvar translate=\"no\"\u003eFILENAME\u003c/var\u003e: the name of the manifest file you created.\n\nOnce you've performed these steps, users belonging to certain Google groups can\nconnect to the cluster. In the given example, users belonging to the Google\ngroup `cluster-admin-team` can connect to the cluster as administrators."]]