Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Redimensionar um cluster de usuário significa adicionar ou remover nós. A adição de nós
exige que os endereços IP estejam disponíveis para os novos nós. Para redimensionar um
cluster de usuário, altere o número de réplicas no pool de nós.
Para informações sobre limites máximos e mínimos para clusters de usuários, consulte
Cotas e limites.
Verificar se há endereços IP suficientes disponíveis
Se você pretende ter N nós após o redimensionamento, precisará ter N + 1 endereços
IP disponíveis.
Antes de redimensionar um cluster, verifique se você tem endereços IP suficientes. A maneira de fazer a verificação depende
do cluster usar um servidor DHCP ou endereços IP estáticos.
DHCP
Se o cluster usar o DHCP, verifique se o servidor DHCP pode fornecer endereços IP
suficientes. É necessário que seja possível fornecer pelo menos mais um endereço IP do que
o número de nós que estarão no cluster após o redimensionamento.
IPs estáticos
A maneira de verificar se você tem endereços IP estáticos suficientes depende de o
cluster ser registrado pela API GKE On-Prem. Um cluster de usuário será registrado na API GKE On-Prem se uma das seguintes condições for verdadeira:
O cluster foi criado usando o console do Google Cloud, a CLI do Google Cloud (gcloud CLI) ou Terraform, que registra automaticamente o
cluster na API GKE On-Prem. Coletivamente, esses aplicativos padrão são chamados de clientes da API GKE On-Prem.
Se a API GKE On-Prem estiver gerenciando um cluster de usuário, use o
Console para contar o número de IPs e adicionar mais IPs, se necessário.
Se o cluster de usuário não for gerenciado pela API GKE On-Prem, será possível executar
gkectl update cluster primeiro, o que verifica se você alocou
endereços IP suficientes no cluster. Caso contrário, você encontrará
na mensagem de erro o número necessário de endereços IP extras.
Adicionar IPs estáticos
Se o cluster for gerenciado pela API GKE On-Prem, use o
Console para adicionar mais endereços IP. Caso contrário, use a linha de
comando na estação de trabalho de administrador.
Console
No console, acesse a página Visão geral dos clusters do Google Kubernetes
Engine.
Selecione o projeto do Cloud em que o cluster de usuário está.
Na lista de clusters, clique no nome dele e em Mais detalhes no painel Detalhes.
Na seção Rede, clique em edit
Editar.
Na caixa de diálogo Adicionar outros endereços IP estáticos, clique em Adicionar endereço IP. Digite o endereço IP e, opcionalmente, um nome do host.
Repita quantas vezes forem necessárias. Quando terminar, clique em Concluir.
Verifique se todos os endereços IP que você pretende usar para o cluster de usuário
estão incluídos no arquivo de bloco de IPs. O arquivo de bloco IP precisa ter pelo menos
mais um endereço IP do que o número de nós que estarão no cluster
após o redimensionamento.
Para ver os endereços reservados para um cluster de usuário:
Selecione o projeto do Cloud em que o cluster de usuário está.
Na lista de clusters, clique no nome dele e em Mais detalhes no painel Detalhes.
Clique na guia Nós.
Clique no nome do pool de nós que você quer redimensionar.
Clique em editRedimensionar.
No campo Nós, insira o número de nós que você quer no
pool de nós e clique em Concluído.
Clique em arrow_back para voltar à
página anterior.
O Console exibe Status do cluster: alterações em
andamento. Clique em Mostrar detalhes para ver a Condição do status
do recurso e as Mensagens de status.
[[["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-11-21 UTC."],[],[],null,["# Resizing a user cluster means adding or removing nodes. Adding nodes\nrequires that IP addresses are available for the new nodes. You resize a user\ncluster by changing the number of replicas in the node pool.\n\nFor information on maximum and minimum limits for user clusters, see\n[Scalability limits](/kubernetes-engine/distributed-cloud/vmware/docs/concepts/scalability#limits).\n\nFor information on managing node pools, see\n[creating and managing node pools](/kubernetes-engine/distributed-cloud/vmware/docs/how-to/managing-node-pools).\n\nVerify that enough IP addresses are available\n---------------------------------------------\n\nIf you intend to have N nodes after the resizing, then you must have N + 1 IP\naddresses available.\n\nBefore resizing a cluster, verify that you have enough IP addresses. How you do\nthe verification depends on whether the cluster uses a DHCP server or static IP\naddresses. \n\n### DHCP\n\nIf the cluster uses DHCP, check that the DHCP server can provide enough IP\naddresses. It must be able to provide at least one more IP address than the\nnumber of nodes that will be in the cluster after the resizing.\n\n### Static IPs\n\nHow you verify that you have enough static IP addresses depends on whether the\ncluster is enrolled in the GKE On-Prem API. A user cluster is enrolled in\nthe GKE On-Prem API if one of the following is true:\n\n- The cluster was created by using the Google Cloud console, the Google Cloud CLI\n (gcloud CLI), or Terraform, which automatically enrolls the\n cluster in the GKE On-Prem API. Collectively, these standard applications are\n referred to as GKE On-Prem API clients.\n\n- The command `gkectl enroll cluster` was run on a user cluster, which\n [configures it to be managed by the GKE On-Prem API](/kubernetes-engine/distributed-cloud/vmware/docs/how-to/enroll-cluster).\n\nIf the GKE On-Prem API is managing a user cluster, use the\nconsole to count the number of IPs and add more IPs if needed.\nIf the user cluster isn't managed by the GKE On-Prem API, you can run\n`gkectl update cluster` first, which verifies whether you've allocated enough\nIP addresses in the cluster. If not, you can find the number of extra IP\naddresses needed in the error message.\n\nAdd static IPs\n--------------\n\nIf the cluster is managed by the GKE On-Prem API, use the\nconsole to add more IP addresses. Otherwise, use the command\nline on your admin workstation. \n\n### Console\n\n1. In the console, go to the **Google Kubernetes Engine clusters overview**\n page.\n\n [Go to GKE clusters](https://console.cloud.google.com/kubernetes/list/overview)\n2. Select the Google Cloud project that the user cluster is in.\n\n3. In the cluster list, click the name of the cluster, and then click\n **More details** in the **Details** panel.\n\n4. In the **Networking** section, click edit **Edit**.\n\n5. In the **Add additional static IP addresses** dialog box, click\n **Add IP Address** . Enter the IP address and optionally, a hostname.\n Repeat as needed. When finished, click **Done**.\n\n### Command line\n\n1. Open the user cluster's [IP block file](/kubernetes-engine/distributed-cloud/vmware/docs/how-to/ip-block-file)\n for editing.\n\n2. Verify that all of the IP addresses you intend to use for the user cluster\n are included in the IP block file. The IP block file should have at least\n one more IP address than the number of nodes that will be in the cluster\n after the resizing.\n\n3. To view the addresses reserved for a user cluster:\n\n ```bash\n kubectl get cluster --kubeconfig ADMIN_CLUSTER_KUBECONFIG \\\n --namespace USER_CLUSTER_NAME USER_CLUSTER_NAME --output yaml\n ```\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eADMIN_CLUSTER_KUBECONFIG\u003c/var\u003e: the path of the admin cluster kubeconfig file\n - \u003cvar translate=\"no\"\u003eUSER_CLUSTER_NAME\u003c/var\u003e: the name of the user cluster\n4. Add as many additional static IP addresses to the corresponding block as required, and then\n run `gkectl update cluster`.\n\nHere is an example of an IP block file that has four IP addresses and the\ncorresponding hostnames:\n\n```\nhostconfig:\ndns: 172.16.255.1\ntod: 216.239.35.0\nblocks:\n- netmask: 255.255.248.0\n gateway: 21.0.135.254\n ips:\n - ip: 21.0.133.41\n hostname: user-node-1\n - ip: 21.0.133.50\n hostname: user-node-2\n - ip: 21.0.133.56\n hostname: user-node-3\n - ip: 21.0.133.47\n hostname: user-node-4\n```\n\nResize the cluster\n------------------\n\n### Console\n\n1. In the console, go to the **Google Kubernetes Engine clusters overview**\n page.\n\n [Go to GKE clusters](https://console.cloud.google.com/kubernetes/list/overview)\n2. Select the Google Cloud project that the user cluster is in.\n\n3. In the cluster list, click the name of the cluster, and then click\n **More details** in the **Details** panel.\n\n4. Click the **Nodes** tab.\n\n5. Click the name of the node pool that you want to resize.\n\n6. Click edit **Resize**.\n\n7. In the **Nodes** field, enter the number of nodes that you want in\n the node pool, and then click **Done**.\n\n8. Click arrow_back to go back to the\n previous page.\n\n9. The console displays **Cluster status: changes in\n progress** . Click **Show Details** to view the **Resource status\n condition** and **Status messages**.\n\n### Command line\n\nIn the\n[user cluster configuration file](/kubernetes-engine/distributed-cloud/vmware/docs/how-to/user-cluster-configuration-file-latest#nodepool-replicas-field),\nupdate the value of the `replicas` field in one or more of the `nodePools`\nelements.\n\nResize the cluster:\n\n```\ngkectl update cluster --kubeconfig ADMIN_CLUSTER_KUBECONFIG --config USER_CLUSTER_CONFIG\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eADMIN_CLUSTER_KUBECONFIG\u003c/var\u003e: the path of the admin cluster kubeconfig file\n\n- \u003cvar translate=\"no\"\u003eUSER_CLUSTER_CONFIG\u003c/var\u003e: the path of the user cluster configuration file\n\nVerify that the resizing succeeded:\n\n- If [advanced cluster](/kubernetes-engine/distributed-cloud/vmware/docs/how-to/admin-cluster-configuration-file-latest#enable-advanced-cluster-field) isn't enabled:\n\n ```bash\n kubectl --kubeconfig USER_CLUSTER_KUBECONFIG get nodes\n\n kubectl --kubeconfig USER_CLUSTER_KUBECONFIG describe machinedeployments NODE_POOL_NAME | grep Replicas\n ```\n- If [advanced cluster](/kubernetes-engine/distributed-cloud/vmware/docs/how-to/admin-cluster-configuration-file-latest#enable-advanced-cluster-field) is enabled\n\n ```bash\n kubectl --kubeconfig USER_CLUSTER_KUBECONFIG get nodes\n\n kubectl --kubeconfig ADMIN_CLUSTER_KUBECONFIG describe nodepoolclaim -n USER_CLUSTER_NAMESPACE NODE_POOL_NAME | grep \"Node Count\"\n ```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eADMIN_CLUSTER_KUBECONFIG\u003c/var\u003e: the path of the admin cluster\n kubeconfig file\n\n- \u003cvar translate=\"no\"\u003eUSER_CLUSTER_KUBECONFIG\u003c/var\u003e: the path of the user cluster\n kubeconfig file\n\n- \u003cvar translate=\"no\"\u003eNODE_POOL_NAME\u003c/var\u003e: the name of the node pool that you\n resized.\n\n- \u003cvar translate=\"no\"\u003eUSER_CLUSTER_NAMESPACE\u003c/var\u003e: the namespace of the user cluster that you\n resized.\n\nTroubleshooting\n---------------\n\nSee\n[Troubleshooting cluster creation and upgrade](/kubernetes-engine/distributed-cloud/vmware/docs/troubleshooting/create-upgrade)."]]