[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2024-10-02。"],[],[],null,["This document gives guidance on the number of IP addresses that are needed\nfor admin clusters and user clusters in Google Distributed Cloud.\n\nDHCP or static\n\nIf your network has a DHCP server, you can configure an admin cluster or a user\ncluster so that it gets the IP addresses for its worker nodes from the DHCP\nserver. In the cluster configuration file, set\n[network.ipMode.type](/kubernetes-engine/distributed-cloud/vmware/docs/how-to/admin-cluster-configuration-file-latest#network-ipmode-type-field)\nto `\"dhcp\"`.\n\nIf you prefer to specify static IP addresses for a cluster, set\n`network.ipMode.type` to \"static\".\n\nHow many IP addresses does an admin cluster need?\n\nA high availability (HA) admin cluster needs to have three IP addresses\navailable for control plane nodes.\n\nAn admin cluster manages one or more user clusters. If Controlplane V2 is\nenabled for a user cluster, the user cluster control plane nodes run in the user\ncluster. User clusters with Controlplane V2 enabled don't affect the number of\nIP addresses that an admin cluster needs.\n\nIf Controlplane V2 *isn't* enabled for a user cluster, the control plane for\nthe user cluster runs on one or more nodes in the admin cluster (kubeception).\nIn the kubeception case, the admin cluster also needs IP addresses for the\nfollowing:\n\n- For each HA user cluster, the admin cluster needs three nodes to run the\n control plane for the user cluster\n\n- For each non-HA user cluster, the admin cluster needs one node to run the\n control plane for the user cluster\n\n Before adding a user cluster when Controlplane V2 isn't enabled, make sure\n you have enough IP addresses available to the admin cluster for the user\n cluster control plane node(s). If you're using DHCP, make sure your DHCP\n server is capable of providing the additional IP addresses.\n\n**Examples:**\n\n| Description | Number of IP addresses |\n|-------------------------------------------------------------------------------------------------------------------------|------------------------|\n| HA admin cluster that manages a Controlplane V2 user cluster 3 control plane nodes | 3 |\n| HA admin cluster that manages an HA kubeception user cluster 3 control plane nodes + 3 user cluster control plane nodes | 6 |\n\nHow many IP addresses does a user cluster need?\n\n- If Controlplane V2 is enabled (which it is by default), one or three nodes to\n run the control plane on the user cluster:\n\n - One node for a non-High Availability (non-HA) user cluster\n\n - Three nodes for a HA user cluster\n\n- One IP address for each worker node (nodes that run your workloads)\n\n- An additional IP address to be used as a temporary node during upgrade,\n update, and auto repair.\n\nBefore adding more worker nodes to a user cluster when Controlplane V2 is\nenabled, make sure you have enough IP addresses available to the user cluster\nfor the control plane nodes. If you're using DHCP, make sure your DHCP server is\ncapable of providing the additional IP addresses.\n\n**Examples:**\n\n| Description | Number of IP addresses |\n|-------------------------------------------------------------------------------------------|------------------------|\n| Non-HA user cluster, Controlplane V2 3 worker nodes + 1 control plane node + 1 extra node | 5 |\n| HA user cluster, Controlplane V2 3 worker nodes + 3 control plane nodes + 1 extra node | 7 |\n| User cluster, kubeception 3 worker nodes + 1 extra node | 4 |\n\nStatic IP addresses for an admin cluster\n\nThis section explains how to manage static IP addresses for an admin cluster.\n\nYou must specify three IP addresses for the admin cluster control-plane nodes.\nSpecify these addresses in the\n[network.controlPlaneIPBlock](/kubernetes-engine/distributed-cloud/vmware/docs/how-to/admin-cluster-configuration-file-latest#network-controlplaneipblock-section).\nsection of the admin cluster configuration file.\n\nIf you intend to create\n[kubeception user clusters](/kubernetes-engine/distributed-cloud/vmware/docs/how-to/create-user-cluster).\nthen you must specify IP addresses to be used for the control-plane nodes of the\nuser clusters. Specify these addresses in an\n[IP block file](/kubernetes-engine/distributed-cloud/vmware/docs/how-to/ip-block-file).\nThen in your admin cluster configuration file, provide the path of the IP block\nfile in the\n[network.ipMode.ipBlockFilePath](/kubernetes-engine/distributed-cloud/vmware/docs/how-to/admin-cluster-configuration-file-latest#network-ipmode.ipblockfilepath-field)\nfield.\n\nFor example, suppose you intend to create two kubeception user clusters: one\nHA and one non-HA. The HA user cluster will have three control-plane nodes in\nthe admin cluster, and the non-HA user cluster will have one control-plane node\nin the admin cluster. So you need to specify four IP addresses plus an extra\nIP address to be used during updates.\n\nHere is an example of an IP block file that has five IP addresses:\n\n```yaml\nblocks:\n - netmask: 255.255.255.0\n gateway: 172.16.20.1\n ips:\n - ip: 172.16.20.50\n hostname: admin-vm-1\n - ip: 172.16.20.51\n hostname: admin-vm-2\n - ip: 172.16.20.52\n hostname: admin-vm-3\n - ip: 172.16.20.53\n hostname: admin-vm-4\n - ip: 172.16.20.54\n hostname: admin-vm-5\n```\n\nAdd IP addresses to an admin cluster\n\nTo make more IP addresses available for nodes in your admin cluster, add\naddresses to your IP block file, and then run the following command to update\nyour admin cluster:\n\n```\ngkectl update admin --kubeconfig ADMIN_CLUSTER_KUBECONFIG--config ADMIN_CLUSTER_CONFIG\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eADMIN_CLUSTER_KUBECONFIG\u003c/var\u003e: the path of your admin cluster kubeconfig file\n\n- \u003cvar translate=\"no\"\u003eADMIN_CLUSTER_CONFIG\u003c/var\u003e: the path of admin user cluster configuration file\n\nStatic IP addresses for a user cluster\n\nThis section explains how to manage static IP addresses for a user cluster.\n\nDetermine the IP addresses that are available for user cluster nodes\n\nThe\n[IP block file](/kubernetes-engine/distributed-cloud/vmware/docs/how-to/ip-block-file)\nfor your user cluster is listed as the value of\n[network.ipMode.ipBlockFilePath](/kubernetes-engine/distributed-cloud/vmware/docs/how-to/user-cluster-configuration-file-latest#network-ipmode-ipblockfilepath-ipblockfilepath)\nin your user cluster configuration file. In the IP block file, you can see the\nIP addresses that are available for worker nodes in the user cluster.\n\nFor example, here is an IP block file that has four IP addresses:\n\n```\nblocks:\n - netmask: 255.255.255.0\n gateway: 172.16.20.1\n ips:\n - ip: 172.16.20.55\n hostname: user-vm-1\n - ip: 172.16.20.56\n hostname: user-vm-2\n - ip: 172.16.20.57\n hostname: user-vm-3\n - ip: 172.16.20.58\n hostname: user-vm-4\n```\n\nThe IP block file does not contain addresses for the control-plane node(s) of\nthe user cluster. If the user cluster has\n[Controlplane V2](/kubernetes-engine/distributed-cloud/vmware/docs/how-to/user-cluster-configuration-file-latest#enablecontrolplanev2-field)\nenabled, then the IP addresses for the control-plane nodes are in the\n[network.controlPlaneIPBlock](/kubernetes-engine/distributed-cloud/vmware/docs/how-to/user-cluster-configuration-file-latest#network-controlplaneipblock-section)\nsection of the user cluster configuration file. Otherwise, the IP addresses for\nthe control-plane nodes of the user cluster are in the IP block file of the\nadmin cluster.\n\nAdd IP addresses to a user cluster\n\nTo make more IP addresses available for nodes in your user cluster, add\naddresses to your IP block file, and then run the following command to update\nyour user 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 your admin cluster kubeconfig file\n\n- \u003cvar translate=\"no\"\u003eUSER_CLUSTER_CONFIG\u003c/var\u003e: the path of your user cluster configuration file\n\nRelated documents\n\n- [Set up minimal infrastructure](/kubernetes-engine/distributed-cloud/vmware/docs/how-to/minimal-infrastructure)\n- [Plan your IP addresses](/kubernetes-engine/distributed-cloud/vmware/docs/how-to/plan-ip-addresses)\n- [Create an admin cluster](/kubernetes-engine/distributed-cloud/vmware/docs/how-to/create-admin-cluster)\n- [Create a user cluster](/kubernetes-engine/distributed-cloud/vmware/docs/how-to/create-user-cluster)"]]