Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Le redimensionnement d'un cluster d'utilisateur implique l'ajout ou la suppression de nœuds. L'ajout de nœuds nécessite que des adresses IP soient disponibles pour les nouveaux nœuds. Vous pouvez redimensionner un cluster d'utilisateur en modifiant le nombre d'instances dupliquées du pool de nœuds.
Pour en savoir plus sur les limites maximales et minimales des clusters d'utilisateur, consultez la page Limites de scalabilité.
Vérifier que suffisamment d'adresses IP sont disponibles
Si vous avez l'intention d'avoir N nœuds après le redimensionnement, vous devez disposer de N + 1 adresses IP disponibles.
Avant de redimensionner un cluster, vérifiez que vous disposez de suffisamment d'adresses IP. La procédure de vérification dépend du fait que le cluster utilise un serveur DHCP ou des adresses IP statiques.
DHCP
Si le cluster utilise le protocole DHCP, vérifiez que le serveur DHCP peut fournir suffisamment d'adresses IP. Il doit pouvoir fournir au moins une adresse IP de plus que le nombre de nœuds qui sera dans le cluster après le redimensionnement.
IP statiques
La méthode pour vérifier que vous disposez de suffisamment d'adresses IP statiques varie selon que le cluster est enregistré ou non par l'API GKE On-Prem. Un cluster d'utilisateur est inscrit à l'API GKE On-Prem si l'une des conditions suivantes est remplie:
Le cluster a été créé à l'aide de la console Google Cloud , de Google Cloud CLI (gcloud CLI) ou de Terraform, l'enregistrant automatiquement dans l'API GKE On-Prem. Collectivement, ces applications standards sont appelées clients de l'API GKE On-Prem.
Si l'API GKE On-Prem gère un cluster d'utilisateur, utilisez la console pour compter le nombre d'adresses IP et en ajouter d'autres si nécessaire.
Si le cluster d'utilisateur n'est pas géré par l'API GKE On-Prem, vous pouvez commencer par exécuter gkectl update cluster, qui vérifie que vous avez alloué suffisamment d'adresses IP au cluster. Si ce n'est pas le cas, vous pouvez trouver le nombre requis d'adresses IP supplémentaires dans le message d'erreur.
Ajouter des adresses IP statiques
Si le cluster est géré par l'API GKE On-Prem, utilisez la console pour ajouter d'autres adresses IP. Sinon, utilisez la ligne de commande sur votre poste de travail administrateur.
Console
Dans la console, accédez à la page Vue d'ensemble des clusters Google Kubernetes Engine.
Sélectionnez le Google Cloud projet dans lequel se trouve le cluster d'utilisateur.
Dans la liste des clusters, cliquez sur le nom du cluster puis sur Afficher les détails dans le panneau Détails.
Dans la section Mise en réseau, cliquez sur edit
Modifier.
Dans la boîte de dialogue Ajouter des adresses IP statiques supplémentaires, cliquez sur Ajouter une adresse IP. Saisissez l'adresse IP et, éventuellement, un nom d'hôte.
Répétez l'opération autant de fois que nécessaire. Cliquez ensuite sur OK.
Vérifiez que toutes les adresses IP que vous souhaitez utiliser pour le cluster d'utilisateur sont incluses dans le fichier de blocs d'adresses IP. Le fichier de blocs d'adresses IP doit avoir au moins une adresse IP de plus que le nombre de nœuds qui se trouveront dans le cluster après le redimensionnement.
Pour afficher les adresses réservées pour un cluster d'utilisateur :
Sélectionnez le Google Cloud projet dans lequel se trouve le cluster d'utilisateur.
Dans la liste des clusters, cliquez sur le nom du cluster puis sur Afficher les détails dans le panneau Détails.
Cliquez sur l'onglet Nœuds.
Cliquez sur le nom du pool de nœuds que vous souhaitez redimensionner.
Cliquez sur editRedimensionner.
Dans le champ Nœuds, saisissez le nombre de nœuds souhaité dans le pool de nœuds, puis cliquez sur OK.
Cliquez sur arrow_back pour revenir à la page précédente.
La console affiche État du cluster : modifications en cours. Cliquez sur Afficher les détails pour afficher la Condition d'état de la ressource et les Messages d'état.
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/09/01 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Difficile à comprendre","hardToUnderstand","thumb-down"],["Informations ou exemple de code incorrects","incorrectInformationOrSampleCode","thumb-down"],["Il n'y a pas l'information/les exemples dont j'ai besoin","missingTheInformationSamplesINeed","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/09/01 (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\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\nDHCP\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\nStatic 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\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\nConsole\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\nCommand 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\nConsole\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\nCommand 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\nSee\n[Troubleshooting cluster creation and upgrade](/kubernetes-engine/distributed-cloud/vmware/docs/troubleshooting/create-upgrade)."]]