このページでは、Google Kubernetes Engine(GKE)クラスタで自動 IP アドレス管理(自動 IPAM)を有効にする方法について説明します。自動 IPAM を有効にすると、GKE はクラスタにサブネットを自動的に作成し、ノードと Pod の IP アドレスを管理します。Service の場合、GKE はデフォルトで GKE が管理する範囲から IP アドレスを割り当てます。
このページは、クラウド リソースのプロビジョニングと構成、アプリとサービスのデプロイ、クラウド デプロイのネットワーキングの管理を行うオペレーター、クラウド アーキテクト、デベロッパー、ネットワーク エンジニアを対象としています。 Google Cloudのコンテンツで使用されている一般的なロールとタスクの例の詳細については、一般的な GKE Enterprise ユーザーロールとタスクをご覧ください。
概要
従来、GKE クラスタを作成するときは、ノード IP アドレスのプライマリ範囲と Pod と Service の IP アドレスの 2 つのセカンダリ範囲を使用して、サブネットを手動で構成します。Pod IP アドレス範囲を手動で構成する場合、設定する IP アドレス範囲の正確なサイズを把握することは困難です。十分な IP アドレスを割り当てないと、クラスタのスケーリングと新しい Pod の作成が制限される可能性があります。逆に、IP アドレスを過剰に割り当てると、他のリソースが使用できる貴重な IP アドレス空間が無駄になる可能性があります。
GKE 自動 IPAM はこの問題を解決し、次の利点があります。
複雑さの軽減: 自動 IPAM は、サブネットを自動的に作成し、そのサブネットに適切な IP アドレス範囲を割り当てることで、IP アドレス割り当ての複雑さを軽減します。
IP アドレス範囲の自動調整: 自動 IPAM を有効にすると、GKE はノードと Pod の小さな IP アドレス範囲から開始します。クラスタのスケールアップまたはスケールダウンが行われると、GKE は、クラスタレベルで定義された重複しない複数の IP アドレス範囲を使用して、追加の IP アドレス範囲を動的に追加または削除します。この自動化されたアプローチにより、GKE クラスタのライフサイクル全体で IP アドレスの健全性と効率が最適化されます。
IP アドレス管理の簡素化: 自動 IPAM により、GKE クラスタの IP アドレス割り振りを綿密に計画して管理する必要がなくなります。
自動 IPAM は、既存のノードプールがスケールアップまたはスケールダウンされたときに、これらのノードプールにすでに割り当てられている IP アドレス範囲を追加または削除しません。クラスタ内の IP アドレス空間が不足している新しいノードプールを作成すると、自動 IPAM によって追加のサブネットと IP アドレス範囲が作成されます。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["わかりにくい","hardToUnderstand","thumb-down"],["情報またはサンプルコードが不正確","incorrectInformationOrSampleCode","thumb-down"],["必要な情報 / サンプルがない","missingTheInformationSamplesINeed","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-09-01 UTC。"],[],[],null,["# Use auto IP address management\n\n[Autopilot](/kubernetes-engine/docs/concepts/autopilot-overview) [Standard](/kubernetes-engine/docs/concepts/choose-cluster-mode)\n\n*** ** * ** ***\n\n|\n| **Preview**\n|\n|\n| This feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| Pre-GA features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n\nThis page explains how to enable automatic IP address management (auto IPAM) on\na Google Kubernetes Engine (GKE) cluster. When you enable auto IPAM,\nGKE automatically creates subnets in the cluster and manages IP\naddresses for nodes and Pods. For Services, GKE assigns IP\naddresses from a [GKE-managed\nrange](/kubernetes-engine/docs/concepts/alias-ips#cluster_sizing) by default.\n\nThis page is for Operators, Cloud architects, Developers,\nand Network engineers who provision and configure cloud resources, deploy\napps and services, and manage networking for their cloud deployments. To learn\nmore about common roles and example tasks referenced in Google Cloud\ncontent, see\n[Common GKE Enterprise user roles and tasks](/kubernetes-engine/enterprise/docs/concepts/roles-tasks).\n\nOverview\n--------\n\nTraditionally, when you create a GKE cluster, you manually\nconfigure a subnet with a primary range for node IP addresses and two secondary\nranges for Pod and Service IP addresses. When you manually configure the Pod IP\naddress range, it can be difficult to know the exact size of the IP address\nrange to set. If you don't allocate enough IP addresses, you might restrict\ncluster scaling and the creation of new Pods. Conversely, if you over-allocate\nIP addresses, you risk wasting valuable IP address space that other resources\ncould utilize.\n\nGKE auto IPAM resolves this issue and has the following\nadvantages:\n\n**Reduced complexity**: auto IPAM reduces the complexity of IP address\nallocation by automatically creating a subnet and assigning an appropriate IP\naddress range to that subnet.\n\n**Automatic adjustment of IP address ranges**: when you enable auto IPAM,\nGKE begins with a smaller IP address range for nodes and Pods. As\nthe cluster scales up or down, GKE dynamically adds or removes\nadditional IP address ranges by using multiple IP address ranges that don't\noverlap and are defined at the cluster level. This automated approach optimizes\nIP address health and efficiency throughout the entire GKE\ncluster lifecycle.\n\n**Simplified IP address management**: auto IPAM reduces the need for you to\nmeticulously plan and manage IP address allocation for your GKE\nclusters.\n\nAuto IPAM doesn't add or remove IP address ranges that are already assigned to\n*existing* node pools when these node pools are scaled up or down. When you\ncreate *new* node pools with insufficient IP address space in the cluster, auto\nIPAM creates additional subnets and IP address ranges.\n\nYou can enable auto IPAM when you create a new cluster. You can also enable or\ndisable auto IPAM for existing clusters.\n\nBefore you begin\n----------------\n\nBefore you start, make sure that you have performed the following tasks:\n\n- Enable the Google Kubernetes Engine API.\n[Enable Google Kubernetes Engine API](https://console.cloud.google.com/flows/enableapi?apiid=container.googleapis.com)\n- If you want to use the Google Cloud CLI for this task, [install](/sdk/docs/install) and then [initialize](/sdk/docs/initializing) the gcloud CLI. If you previously installed the gcloud CLI, get the latest version by running `gcloud components update`. **Note:** For existing gcloud CLI installations, make sure to set the `compute/region` [property](/sdk/docs/properties#setting_properties). If you use primarily zonal clusters, set the `compute/zone` instead. By setting a default location, you can avoid errors in the gcloud CLI like the following: `One of [--zone, --region] must be supplied: Please specify location`. You might need to specify the location in certain commands if the location of your cluster differs from the default that you set.\n\n### Restrictions and limitations\n\nWhen you use auto IPAM in your GKE cluster, understand the\nfollowing restrictions and limitations:\n\n- Your cluster must be a VPC-native cluster. Routes-based clusters don't support auto IPAM.\n- You can't use Auto IPAM in a cluster with [Shared VPC](/kubernetes-engine/docs/how-to/cluster-shared-vpc).\n- You can enable auto IPAM in a cluster that has [multi-network\n capabilities](/kubernetes-engine/docs/concepts/about-multinetwork-support-for-pods). However, auto IPAM won't work when you create a new node pool with multiple network interfaces. To use auto IPAM, you must disable multi-networking capabilities in your node pool.\n- If your cluster has [IPv4/IPv6 dual-stack networking](/kubernetes-engine/docs/concepts/alias-ips#dual_stack_network), auto IPAM will allocate and manage only the IPv4 addresses in your cluster.\n- When you enable auto IPAM, the default maximum node size for any node pool, including the default node pool, is 252 nodes with a CIDR block of /24.\n- By default, GKE allows up to 48 Pods per node in a cluster with auto IPAM.\n- You can't overprovision a Pod CIDR range in clusters that use auto IPAM.\n\n| **Caution:** Don't use subnets that are created with auto IPAM (identified with the prefix `gke-auto`) for resources that are *not* managed by GKE. GKE automatically deletes and recycles these subnets when they are no longer in use by a GKE cluster, which can lead to unexpected service disruptions. You also won't be able to delete your GKE cluster or node pool if the `gke-auto` subnet is used by other resources.\n\nCreate a cluster with auto IPAM\n-------------------------------\n\nWhen you create a new cluster and enable auto IPAM, you can either have\nGKE create a new subnet, or you can specify an existing subnet to\nuse. If you specify an existing subnet, make sure that there are enough\nsecondary IP address ranges available for the cluster. You don't have to specify\nany IP address ranges when you create a cluster and enable auto IPAM.\n\n1. To create a cluster with auto IPAM and have GKE create a new\n subnet, run the following command:\n\n gcloud container clusters create \u003cvar translate=\"no\"\u003eCLUSTER_NAME\u003c/var\u003e \\\n --enable-auto-ipam \\\\\n\n Replace \u003cvar translate=\"no\"\u003eCLUSTER_NAME\u003c/var\u003e with the name of your cluster.\n\n GKE does the following:\n - Creates a new subnet for the cluster.\n - Sets up an initial IP address allocation for the cluster and automatically allocates new node and Pod IP addresses to the new node pool.\n - Monitors the use of subnets and secondary IP address ranges.\n2. To create a cluster with auto IPAM and specify your own subnet, follow the\n instructions in the [Create a cluster in an existing\n subnet](/kubernetes-engine/docs/how-to/alias-ips#creating_cluster) section and use\n the `--enable-auto-ipam` flag in the command. For example:\n\n gcloud container clusters create \u003cvar translate=\"no\"\u003eCLUSTER_NAME\u003c/var\u003e \\\n --enable-auto-ipam \\\\\n --subnetwork=\u003cvar translate=\"no\"\u003eSUBNET_NAME\u003c/var\u003e \\\n\n Replace the following values:\n - \u003cvar translate=\"no\"\u003eCLUSTER_NAME\u003c/var\u003e: the name of your cluster.\n - \u003cvar translate=\"no\"\u003eSUBNET_NAME\u003c/var\u003e: the name of an existing subnet. The subnet's primary IP address range is used for nodes. The subnet must exist in the same region as the one used by the cluster.\n\nUpdate an existing cluster\n--------------------------\n\nYou can enable or disable auto IPAM on an existing cluster.\n\n### Enable auto IPAM\n\nTo enable auto IPAM on an existing cluster, run the following command: \n\n gcloud container clusters update \u003cvar translate=\"no\"\u003eCLUSTER_NAME\u003c/var\u003e \\\n --enable-auto-ipam\n\nAfter you run this command, when you create a new node pool without sufficient\nIP address space, GKE creates and manages a new IP\naddress range in your cluster.\n\n### Disable auto IPAM\n\nTo disable auto IPAM on an existing cluster, run the following command: \n\n gcloud container clusters update \u003cvar translate=\"no\"\u003eCLUSTER_NAME\u003c/var\u003e \\\n --disable-auto-ipam\n\nReplace \u003cvar translate=\"no\"\u003eCLUSTER_NAME\u003c/var\u003e with the name of your cluster.\n\nAfter you disable auto IPAM in your cluster:\n\n- GKE will retain ownership of any subnets and secondary IP address ranges that were created with auto IPAM. These resources are deleted when you delete the GKE cluster.\n- When you create new node pools, GKE automatically assigns the default subnet and the associated secondary IP address range.\n\nWhat's next\n-----------\n\n- Learn about [IP address allocation in GKE](/kubernetes-engine/docs/concepts/network-overview#ip-allocation).\n- Learn how to [create VPC-native clusters](/kubernetes-engine/docs/how-to/alias-ips#create_a_cluster)."]]