O produto descrito nesta documentação, os clusters do Anthos na AWS (geração anterior), agora está no modo de manutenção. Todas as novas instalações precisam usar o produto de geração atual Clusters do Anthos na AWS.
Depois de atualizar a configuração, o GKE na AWS coloca o cluster ou
o pool de nós no estado Updating. Quando a atualização é concluída, o cluster ou pool de nós é retornado ao estado Provisioned.
Antes de começar
Para modificar os clusters de usuário, o cluster e o pool de nós precisam executar o Kubernetes versão 1.20 ou superior. Se o cluster não estiver executando o Kubernetes 1.20,
faça upgrade do cluster de usuário primeiro.
Para modificar os grupos de segurança do cluster, o papel do IAM da AWS (definido como
spec.authentication.awsIAM.adminIdentityARNs em anthos-gke.yaml) que
gerencia os clusters de usuários do GKE na AWS precisa ter a
permissão ec2:ModifyNetworkInterfaceAttribute.
Atualizar grupos de segurança
Nesta seção, você atualizará os grupos de segurança de um cluster e pool de nós.
Para atualizar os grupos de segurança, execute as seguintes etapas:
No diretório anthos-aws, use
anthos-gke para alternar o contexto para o serviço de gerenciamento.
cd anthos-aws
anthos-gke aws management get-credentials
Abra o arquivo YAML que criou o AWSCluster em um editor de texto.
Se você não tiver o arquivo YAML inicial, poderá usar kubectl edit.
Editar YAML
Se você tiver seguido as instruções em
Como criar um cluster de usuário, seu arquivo YAML será chamado
de cluster-0.yaml. Abra esse arquivo em um editor de texto.
kubectl edit
Para usar kubectl edit para editar seu AWSCluster, execute o seguinte
comando:
Substitua SECURITY_GROUP_ID pelo ID do novo grupo de segurança.
Para incluir vários grupos de segurança, inclua valores adicionais à matriz em spec.controlPlane.securityGroupIDs.
O exemplo a seguir inclui os grupos de segurança sg-12345678ab e
sg-abcdef1234:
Salve o arquivo. Se você estiver usando kubectl edit, kubectl aplicará as alterações automaticamente. Se você estiver editando o arquivo YAML, aplique-o ao serviço de gerenciamento com o seguinte comando:
Verifique o status da atualização com kubectl. Quando a atualização é concluída, o estado do objeto muda de Updating para Provisioned.
env HTTPS_PROXY=http://localhost:8118 \
kubectl get AWSClusters,AWSNodePools
Por exemplo, enquanto o cluster está no estado de atualização, a saída é semelhante a esta:
NAME STATE AGE VERSION ENDPOINT
cluster-0 Updating 10m41s 1.25.5-gke.2100 gke-xyz.elb.us-east-1.amazonaws.com
NAME CLUSTER STATE AGE VERSION
cluster-0-pool-0 cluster-0 Updating 10m40s 1.25.5-gke.2100
Atualizar tipos de instância
Nesta seção, você atualizará os tipos de instância de um cluster e um pool de nós.
Para atualizar os tipos de instância, siga estas etapas:
No diretório anthos-aws, use
anthos-gke para alternar o contexto para o serviço de gerenciamento.
cd anthos-aws
anthos-gke aws management get-credentials
Abra o arquivo YAML que criou o AWSCluster em um editor de texto.
Se você não tiver o arquivo YAML inicial, poderá usar kubectl edit.
Editar YAML
Se você tiver seguido as instruções em
Como criar um cluster de usuário, seu arquivo YAML será chamado
de cluster-0.yaml. Abra esse arquivo em um editor de texto.
kubectl edit
Para usar kubectl edit para editar seu AWSCluster, execute o seguinte
comando:
Salve o arquivo. Se você estiver usando kubectl edit, kubectl aplicará as alterações automaticamente. Se você estiver editando o arquivo YAML, aplique-o ao serviço de gerenciamento com o seguinte comando:
Verifique o status da atualização com kubectl. Quando a atualização é concluída, o estado do objeto muda de Updating para Provisioned.
env HTTPS_PROXY=http://localhost:8118 \
kubectl get AWSClusters,AWSNodePools
Por exemplo, enquanto o cluster está no estado de atualização, a saída é semelhante a esta:
NAME STATE AGE VERSION ENDPOINT
cluster-0 Updating 10m41s 1.25.5-gke.2100 gke-xyz.elb.us-east-1.amazonaws.com
NAME CLUSTER STATE AGE VERSION
cluster-0-pool-0 cluster-0 Updating 10m40s 1.25.5-gke.2100
[[["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-06-26 UTC."],[],[],null,["# Updating user clusters\n\nThis topic describes how to update the configuration of an existing user\ncluster.\n\nOverview\n--------\n\nWith user clusters running Kubernetes version 1.20 and higher, you can modify\nthe following attributes:\n\n- A user cluster's security groups, described in this topic.\n- Cluster and node pool versions. For more information, seee [Upgrading GKE on AWS](/kubernetes-engine/multi-cloud/docs/aws/previous-generation/how-to/upgrading).\n- Proxy settings. For more information, see [Changing proxy settings](/kubernetes-engine/multi-cloud/docs/aws/previous-generation/how-to/changing-proxy-settings).\n- The size of a node pool. For more information, see [Resize a node pool](/kubernetes-engine/multi-cloud/docs/aws/previous-generation/how-to/scaling-user-cluster#resize_a_node_pool).\n\nWith Kubernetes 1.22 and higher, you can update EC2 instance types.\n\nTo update these resources, you edit the\n[AWSCluster](/kubernetes-engine/multi-cloud/docs/aws/previous-generation/reference/awscluster) and\n[AWSNodePool](/kubernetes-engine/multi-cloud/docs/aws/previous-generation/reference/awsnodepools) resources.\n\nAfter you update the configuration, GKE on AWS places the cluster or\nnode pool into the `Updating` state. When the update is complete, the cluster or\nnode pool is returned to the `Provisioned` state.\n| **Note:** When you update an AWSNodePool, GKE on AWS gracefully drains all nodes. Pods receives a `SIGTERM` then, after a grace period, a `SIGKILL`. Once the pods stop, the update will proceed to the next node.\n\nBefore you begin\n----------------\n\nTo modify your user clusters, the cluster and node pool must run Kubernetes\nversion 1.20 or higher. If your cluster is not running Kubernetes 1.20,\n[Upgrade your user cluster](/kubernetes-engine/multi-cloud/docs/aws/previous-generation/how-to/upgrading#awscluster) first.\n\nTo modify your cluster's security groups, the AWS IAM role (set as\n`spec.authentication.awsIAM.adminIdentityARNs` in `anthos-gke.yaml`) that\nmanages your GKE on AWS user clusters, must have the\n`ec2:ModifyNetworkInterfaceAttribute` permission.\n\nUpdate security groups\n----------------------\n\nIn this section, you update the security groups for a cluster and node pool.\nTo update the security groups, perform the following steps:\n\n1. From your `anthos-aws` directory, use\n `anthos-gke` to switch context to your management service.\n\n ```sh\n cd anthos-aws\n anthos-gke aws management get-credentials\n ```\n | **Note:** `anthos-gke` uses the credentials you specified when you ran `aws configure`.\n\n \u003cbr /\u003e\n\n2. Open the YAML file that created your AWSCluster in a text editor.\n If you do not have your initial YAML file, you can use `kubectl edit`.\n\n ### Edit YAML\n\n If you followed the instructions in\n [Creating a user cluster](/kubernetes-engine/multi-cloud/docs/aws/previous-generation/how-to/creating-user-cluster), your YAML file is named\n `cluster-0.yaml`. Open this file in a text editor.\n\n ### kubectl edit\n\n To use `kubectl edit` to edit your AWSCluster, run the following\n command: \n\n env HTTPS_PROXY=http://localhost:8118 \\\n kubectl edit awscluster \u003cvar translate=\"no\"\u003ecluster-name\u003c/var\u003e\n\n Replace \u003cvar translate=\"no\"\u003ecluster-name\u003c/var\u003e with your AWSCluster. For\n example, to edit the default cluster, `cluster-0`, run the following\n command: \n\n env HTTPS_PROXY=http://localhost:8118 \\\n kubectl edit awscluster cluster-0\n\n3. Edit the `spec.controlPlane.securityGroupIDs` field of your `AWSCluster`.\n\n apiVersion: multicloud.cluster.gke.io/v1\n kind: AWSCluster\n ...\n spec:\n controlPlane:\n securityGroupIDs:\n - \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eSECURITY_GROUP_ID\u003c/span\u003e\u003c/var\u003e\n ...\n\n Replace \u003cvar translate=\"no\"\u003eSECURITY_GROUP_ID\u003c/var\u003e with the ID of the new security group.\n To add multiple security groups, add additional values to the array\n under `spec.controlPlane.securityGroupIDs`.\n\n The following example includes the security groups `sg-12345678ab` and\n `sg-abcdef1234`: \n\n apiVersion: multicloud.cluster.gke.io/v1\n kind: AWSCluster\n spec:\n controlPlane:\n securityGroupIDs:\n - sg-12345678ab\n - sg-abcdef1234\n ...\n\n4. Edit the `spec.securityGroupIDs` field of your `AWSNodePool` resources.\n\n apiVersion: multicloud.cluster.gke.io/v1\n kind: AWSNodePool\n spec:\n securityGroupIDs:\n - \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eSECURITY_GROUP_ID\u003c/span\u003e\u003c/var\u003e\n ...\n\n5. Save the file. If you are using `kubectl edit`, `kubectl` applies the\n changes automatically. If you are editing the YAML file, apply it to your\n management service with the following command:\n\n env HTTPS_PROXY=http://localhost:8118 \\\n kubectl apply -f cluster-0.yaml\n\n6. Check the update status with `kubectl`. When the update is finished the\n object's state changes from `Updating` to `Provisioned`.\n\n env HTTPS_PROXY=http://localhost:8118 \\\n kubectl get AWSClusters,AWSNodePools\n\n For example, while the cluster is in the updating state, the output\n resembles the following: \n\n NAME STATE AGE VERSION ENDPOINT\n cluster-0 Updating 10m41s 1.25.5-gke.2100 gke-xyz.elb.us-east-1.amazonaws.com\n\n NAME CLUSTER STATE AGE VERSION\n cluster-0-pool-0 cluster-0 Updating 10m40s 1.25.5-gke.2100\n\nUpdate instance types\n---------------------\n\nIn this section, you update the instance types for a cluster and node pool.\nTo update the instance types, perform the following steps:\n\n1. From your `anthos-aws` directory, use\n `anthos-gke` to switch context to your management service.\n\n ```sh\n cd anthos-aws\n anthos-gke aws management get-credentials\n ```\n | **Note:** `anthos-gke` uses the credentials you specified when you ran `aws configure`.\n\n \u003cbr /\u003e\n\n2. Open the YAML file that created your AWSCluster in a text editor.\n If you do not have your initial YAML file, you can use `kubectl edit`.\n\n ### Edit YAML\n\n If you followed the instructions in\n [Creating a user cluster](/kubernetes-engine/multi-cloud/docs/aws/previous-generation/how-to/creating-user-cluster), your YAML file is named\n `cluster-0.yaml`. Open this file in a text editor.\n\n ### kubectl edit\n\n To use `kubectl edit` to edit your AWSCluster, run the following\n command: \n\n env HTTPS_PROXY=http://localhost:8118 \\\n kubectl edit awscluster \u003cvar translate=\"no\"\u003ecluster-name\u003c/var\u003e\n\n Replace \u003cvar translate=\"no\"\u003ecluster-name\u003c/var\u003e with your AWSCluster. For\n example, to edit the default cluster, `cluster-0`, run the following\n command: \n\n env HTTPS_PROXY=http://localhost:8118 \\\n kubectl edit awscluster cluster-0\n\n3. Edit the `spec.controlPlane.instanceType` field of your `AWSCluster`.\n\n apiVersion: multicloud.cluster.gke.io/v1\n kind: AWSCluster\n ...\n spec:\n controlPlane:\n instanceType: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eAWS_INSTANCE_TYPE\u003c/span\u003e\u003c/var\u003e\n ...\n\n Replace \u003cvar translate=\"no\"\u003eAWS_INSTANCE_TYPE\u003c/var\u003e with the new instance type.\n For more information, see\n [Supported instance types](/kubernetes-engine/multi-cloud/docs/aws/previous-generation/reference/instance-types).\n4. Edit the `spec.instanceType` field of your `AWSNodePool` resources.\n\n apiVersion: multicloud.cluster.gke.io/v1\n kind: AWSNodePool\n spec:\n instanceType: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eAWS_INSTANCE_TYPE\u003c/span\u003e\u003c/var\u003e\n ...\n\n5. Save the file. If you are using `kubectl edit`, `kubectl` applies the\n changes automatically. If you are editing the YAML file, apply it to your\n management service with the following command:\n\n env HTTPS_PROXY=http://localhost:8118 \\\n kubectl apply -f cluster-0.yaml\n\n6. Check the update status with `kubectl`. When the update is finished the\n object's state changes from `Updating` to `Provisioned`.\n\n env HTTPS_PROXY=http://localhost:8118 \\\n kubectl get AWSClusters,AWSNodePools\n\n For example, while the cluster is in the updating state, the output\n resembles the following: \n\n NAME STATE AGE VERSION ENDPOINT\n cluster-0 Updating 10m41s 1.25.5-gke.2100 gke-xyz.elb.us-east-1.amazonaws.com\n\n NAME CLUSTER STATE AGE VERSION\n cluster-0-pool-0 cluster-0 Updating 10m40s 1.25.5-gke.2100\n\nWhat's next\n-----------\n\n- For more information on upgrading a user cluster, see [Upgrading GKE on AWS](/kubernetes-engine/multi-cloud/docs/aws/previous-generation/how-to/upgrading)."]]