Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
A versão predecessora dos clusters anexados ao GKE é conhecida como clusters anexados ao GKE (geração anterior). A migração da versão anterior dos clusters anexados ao GKE para a geração atual dá acesso a essa funcionalidade, incluindo o gerenciamento do ciclo de vida e o registro da frota. A migração é uma operação unidirecional: após a migração para a geração atual de clusters anexados ao GKE, não há como retornar aos clusters anexados ao GKE (geração anterior).
Política de numeração de versão
Estes documentos referem-se à versão dos clusters anexados ao GKE como a versão da plataforma, para diferenciá-la da versão do Kubernetes. Os clusters anexados ao GKE usam a mesma convenção de numeração de versão do GKE — por exemplo, 1.21.5-gke.1. Ao anexar ou atualizar seu cluster, você deve escolher uma versão da plataforma cuja versão secundária seja igual ou um nível abaixo da versão do Kubernetes do seu cluster. Por exemplo, você pode anexar um cluster executando o Kubernetes v1.22.* com a versão da plataforma 1.21.* ou 1.22.* dos clusters anexados ao GKE.
Isso permite que você atualize seu cluster para a próxima versão secundária antes de atualizar os clusters conectados ao GKE.
Garantir que a Identidade da Carga de Trabalho esteja habilitada
Os clusters existentes de clusters conectados ao GKE (geração anterior) devem ter a Identidade da carga de trabalho ativada antes de serem migrados para a geração atual de clusters conectados ao GKE.
Para determinar se o WI está habilitado, execute o seguinte comando e verifique a saída para qualquer campo Identidade da Carga de Trabalho:
Execute o seguinte comando para migrar seu cluster para a geração atual de clusters conectados ao GKE. Este comando extrai os detalhes relevantes da configuração do seu cluster, registra-o no Google Fleet Management e instala ou atualiza qualquer software necessário, como o agente de ciclo de vida, no cluster.
GOOGLE_CLOUD_REGION : a Google Cloud local de onde seu cluster é administrado
FLEET_MEMBERSHIP : o designador de associação totalmente qualificado do seu cluster registrado (veja abaixo)
PLATFORM_VERSION : a versão dos clusters anexados ao GKE para os quais você deseja migrar (exemplo: v1.22.0-gke.1)
CLUSTER_DISTRIBUTION : o tipo de cluster - eks para o Elastic Kubernetes Service da AWS, aks para o Azure Kubernetes Service ou generic para qualquer outra distribuição
KUBECONFIG_CONTEXT : o nome do contexto em seu kubeconfig para conectar-se ao seu cluster
KUBECONFIG_PATH : o local do seu arquivo kubeconfig . Se não for especificado, o padrão é ~/.kube/config
O designador de associação é uma sequência de caracteres que identifica exclusivamente o cluster anexado e tem o formato projects/ PROJECT_NUMBER /locations/global/memberships/ MEMBERSHIP_ID , onde
PROJECT_NUMBER é o número do projeto do host da sua frota. Você deve especificar o mesmo número de projeto daquele ao qual seu cluster pertence atualmente.
MEMBERSHIP_ID : este deve ser o ID de associação da frota do seu cluster existente. Os clusters conectados ao GKE usarão este valor como nome do cluster.
[[["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 2025-06-12 UTC."],[],[],null,["# Migrate your EKS attached cluster\n\nThe predecessor version of GKE attached clusters is known as GKE attached clusters\n(previous generation). Migrating from the earlier\nversion of GKE attached clusters to the current generation gives you access to this\nfunctionality, including lifecycle management and Fleet registration. Migration\nis a one-way operation: once you have migrated to the current generation of\nGKE attached clusters, there is no way to return to GKE attached clusters (previous generation).\n\nVersion numbering policy\n------------------------\n\nThese documents refer to the GKE attached clusters version as the platform version,\nto distinguish it from the Kubernetes version. GKE attached clusters uses the same\nversion numbering convention as GKE - for example, 1.21.5-gke.1. When attaching\nor updating your cluster, you must choose a platform version whose minor version\nis the same as or one level below the Kubernetes version of your cluster. For\nexample, you can attach a cluster running Kubernetes v1.22.\\* with\nGKE attached clusters platform version 1.21.\\* or 1.22.\\*.\n\nThis lets you upgrade your cluster to the next minor version before upgrading\nGKE attached clusters.\n\nEnsure Workload Identity is enabled\n-----------------------------------\n\nExisting clusters from GKE attached clusters (previous generation) must have Workload\nIdentity enabled before being migrated to the current generation of GKE attached clusters.\n\nTo determine whether WI is enabled, run the following command and check\nthe output for any Workload Identity field: \n\n gcloud container hub memberships describe \u003cvar translate=\"no\"\u003eMEMBERSHIP_NAME\u003c/var\u003e\n\nIf Workload Identity is not enabled, the membership must be updated to enable it.\n\n1. Retrieve your cluster's OIDC issuer URL with the following command:\n\n aws eks describe-cluster \\\n --region \u003cvar translate=\"no\"\u003eAWS_REGION\u003c/var\u003e \\\n --name \u003cvar translate=\"no\"\u003eCLUSTER_NAME\u003c/var\u003e \\\n --query \"cluster.identity.oidc.issuer\" \\\n --output text\n\n The output of this command will be the URL of your OIDC issuer. Save this value\n for use later.\n2. Update the membership:\n\n gcloud container fleet memberships register \u003cvar translate=\"no\"\u003eMEMBERSHIP_NAME\u003c/var\u003e \\\n --context=\u003cvar translate=\"no\"\u003eKUBECONFIG_CONTEXT\u003c/var\u003e \\\n --kubeconfig=\u003cvar translate=\"no\"\u003eKUBECONFIG_PATH\u003c/var\u003e \\\n --enable-workload-identity \\\n --public-issuer-url=\u003cvar translate=\"no\"\u003eOIDC_URL\u003c/var\u003e\n\n Replace:\n - \u003cvar translate=\"no\"\u003eMEMBERSHIP_NAME\u003c/var\u003e: the membership name of your cluster\n - \u003cvar translate=\"no\"\u003eKUBECONFIG_CONTEXT\u003c/var\u003e: context in the kubeconfig for accessing the EKS cluster\n - \u003cvar translate=\"no\"\u003eKUBECONFIG_PATH\u003c/var\u003e: path to your kubeconfig file\n - \u003cvar translate=\"no\"\u003eOIDC_URL\u003c/var\u003e: the OIDC URL retrieved earlier\n\nMigrate your cluster\n--------------------\n\nTo migrate your cluster from GKE attached clusters (previous generation) to GKE attached clusters:\n\n1. Extract your cluster's kubeconfig context and store it in the\n KUBECONFIG_CONTEXT environment variable:\n\n KUBECONFIG_CONTEXT=$(kubectl config current-context)\n\n2. Run the following command to migrate your cluster to the current generation\n of GKE attached clusters. This command extracts the relevant details of your cluster's\n configuration and registers your cluster with Google Fleet Management, and\n installs or upgrades any necessary software, such as the lifecycle agent, on\n your cluster.\n\n gcloud container attached clusters import \\\n --location=\u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003eGOOGLE_CLOUD_REGION\u003c/span\u003e\u003c/var\u003e \\\n --fleet-membership=\u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003eFLEET_MEMBERSHIP\u003c/span\u003e\u003c/var\u003e \\\n --platform-version=\u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003ePLATFORM_VERSION\u003c/span\u003e\u003c/var\u003e \\\n --distribution=\u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003eCLUSTER_DISTRIBUTION\u003c/span\u003e\u003c/var\u003e \\\n --context=\u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003eKUBECONFIG_CONTEXT\u003c/span\u003e\u003c/var\u003e \\\n [--kubeconfig=\u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003eKUBECONFIG_PATH\u003c/span\u003e\u003c/var\u003e]\n\n Replace:\n - \u003cvar translate=\"no\"\u003eGOOGLE_CLOUD_REGION\u003c/var\u003e: the Google Cloud location from which your cluster is administered\n - \u003cvar translate=\"no\"\u003eFLEET_MEMBERSHIP\u003c/var\u003e: the fully qualified membership designator of your registered cluster (see below)\n - \u003cvar translate=\"no\"\u003ePLATFORM_VERSION\u003c/var\u003e: the version of GKE attached clusters that you want to migrate to (example: v1.22.0-gke.1)\n - \u003cvar translate=\"no\"\u003eCLUSTER_DISTRIBUTION\u003c/var\u003e: the cluster type - `eks` for AWS's Elastic Kubernetes Service, `aks` for Azure Kubernetes Service, or `generic` for any other distribution\n - \u003cvar translate=\"no\"\u003eKUBECONFIG_CONTEXT\u003c/var\u003e: the name of the context in your `kubeconfig` to connect to your cluster with\n - \u003cvar translate=\"no\"\u003eKUBECONFIG_PATH\u003c/var\u003e: the location of your `kubeconfig` file. If not specified, the default is `~/.kube/config`\n\n The membership designator is a string that uniquely identifies your attached\n cluster and has the form\n `projects/`\u003cvar translate=\"no\"\u003ePROJECT_NUMBER\u003c/var\u003e`/locations/global/memberships/`\u003cvar translate=\"no\"\u003eMEMBERSHIP_ID\u003c/var\u003e,\n where\n - \u003cvar translate=\"no\"\u003ePROJECT_NUMBER\u003c/var\u003e is your Fleet host project number. You must\n specify the same project number as one your cluster currently belongs to\n\n - \u003cvar translate=\"no\"\u003eMEMBERSHIP_ID\u003c/var\u003e: this must be the fleet membership ID of\n your existing cluster. GKE attached clusters will use this value as your\n cluster name."]]