フラットモード ネットワーク モデルでは、Pod にクラスタ間で一意の IP アドレスがあります。割り振られた Pod の CIDR が一意であり、他のサブネットと重複していないことを確認します。たとえば、IP アドレスは他のクラスタでノードや他の Pod の CIDR に使用される IP アドレスと重複してはいけません。これらの IP アドレスには外部からアクセスできるため、どのノードの Pod でも他のすべてのノードのすべての Pod と通信できます。Pod から外部 IP アドレスへの通信にネットワーク アドレス変換(NAT)は必要ありません。フラットモード ネットワーク モデルと、デフォルトのアイランド ネットワーク モデルとの比較については、フラットモードとアイランド モードのネットワーク モデルをご覧ください。
IP アドレス空間が大きく、クラスタに固有の Pod CIDR を割り振れる場合は、フラットモード ネットワーク モデルを使用します。ClusterCIDRConfig を使用して、Pod CIDR を動的に構成できます。ClusterCIDRConfig は、クラスタの作成後に追加または削除できます。ClusterCIDRConfig の詳細と使用例については、ClusterCIDRConfig カスタム リソースについてをご覧ください。
IPv4 の静的フラット ネットワーク モードでは、Pod IP アドレスのネットワーク到達性は、Address Resolution Protocol(ARP)パケットに基づいています。したがって、Pod の IP アドレスは、Pod が同じレイヤ 2 ドメイン内にある場合にのみ到達可能です。ノードは同じレイヤ 2 ドメインに属している必要があります。Pod に指定する IP アドレス(ClusterCIDRConfig を使用)は、クラスタノードと同じサブネット内に存在する必要があります。構成した Pod CIDR は、ノードのサブネットからのものである必要があります。たとえば、222.1.0.0/16 サブネットがクラスタ内のノードで使用されると、そのサブネット内でより小さいサブネット(222.1.2.0/24)を Pod に選択します。クラスタ内の他のリソースが、Pod に割り振られた範囲の IP アドレスを使用していないことを確認します。
Google Distributed Cloud の静的フラットモード ネットワークには、次の制限があります。
フラットモード ネットワークを使用する Pod は、単一のレイヤ 2 ドメイン内で到達可能になります。クラスタ内でなくても、レイヤ 2 ドメインにある他のマシンも Pod に到達できます。デュアルスタック クラスタが作成される場合や、IPv6 が BGP なしのフラットモードにある場合、この制限は IPv6 にも適用されます。詳細については、Pod IP アドレスのネットワーク到達性についてをご覧ください。
Google Distributed Cloud IPAM コントローラは、構成された Pod CIDR 内の IP アドレスの可用性を追跡します。他のデバイスですでに使用されている IP は追跡されません。したがって、レイヤ 2 ドメイン内の他の IP は、Pod CIDR と干渉しないようにする必要があります。詳細については、Pod 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,["Overview\n\nFlat-mode network models are of two types: static mode network and dynamic mode\nnetwork (using Border Gateway Protocol). Static flat-mode can be used when nodes\nspan a single Layer 2 domain. For nodes spanning across multiple Layer 2\ndomains, use flat IP mode with BGP.\n\nIn a flat-mode network model, pods have unique IP addresses across clusters.\nEnsure that the pod CIDRs assigned are unique and don't overlap with any other\nsubnets. For example, IP addresses can't overlap with IP addresses used for the\nnodes or the other pod CIDRs in other clusters. These IP addresses can be\naccessed externally and hence pods on any node can communicate with all pods on\nall other nodes. Communication from the pod to any external IP address doesn't\nrequire network address translation (NAT). For more information about the flat\nmode network model and how it compares with the default, island network model,\nsee\n[Flat vs island mode network models](/kubernetes-engine/distributed-cloud/bare-metal/docs/reference/flat-vs-island-network).\n\nUse a flat-mode network model when you have a large IP address space and you can\nassign a unique pod CIDR for a cluster. You can configure the pod CIDRs using\nthe ClusterCIDRConfigs dynamically. You can add or delete ClusterCIDRConfigs\nafter the cluster is created. For more information on ClusterCIDRConfig and examples on\nusing it, see [Understand the ClusterCIDRConfig custom resource](/kubernetes-engine/distributed-cloud/bare-metal/docs/reference/cluster-cidr-config).\n\nFor more information on flat-mode with BGP, see\n[Implement flat-mode network model with BGP support](/kubernetes-engine/distributed-cloud/bare-metal/docs/how-to/flat-bgp-network).\n\nUnderstanding the Pod IP address reachability\n\nIn static flat network mode for IPv4, Pod IP address reachability is based on\nAddress Resolution Protocol (ARP) packets. Therefore, Pods IP addresses are\nreachable only when the Pods are in the same Layer 2 domain. The nodes must\nbelong to the same Layer 2 domain. The IP addresses you specify for your Pods\n(using ClusterCIDRConfigs) must be in the same subnet as the cluster nodes.\nPods CIDRs configured must be from the nodes' subnet. For example, 222.1.0.0/16\nsubnet is used by the nodes in a cluster then select a smaller subnet within the\nsubnet for the pods, 222.1.2.0/24. Ensure that no other resource in your cluster\nis using an IP address from the range allocated for your pods.\n\nFollowing section describes the configuration for flat-mode networks for IPv4.\n\nHow to implement a static flat-mode network\n\nBy default, Google Distributed Cloud cluster is created in island-mode networking. This\nsection describes how to set up flat-mode networking for your cluster.\n\nTo deploy a cluster with a flat-mode network model, make the following changes\nto the cluster configuration file:\n\nFlat-mode networking can be enabled for a cluster during cluster creation only.\nTo create a new cluster with flat-mode networking, use the following steps:\n\n1. Edit the cluster configuration file to add `clusterNetwork.flatIPv4` and set\n it to `true`.\n\n When you enable flat-mode networking, the pod CIDR specified in the cluster\n configuration file (`clusterNetwork.pods.cidrBlocks`) is ignored.\n2. Append a ClusterCIDRConfig manifest to the cluster configuration file.\n\n In the ClusterCIDRConfig manifest, include the following information:\n - `metadata.namespace`: the namespace of your cluster.\n\n - `spec.ipv4.cidr`: the range of IP addresses in CIDR block format to use\n for Pods in your cluster. This range must come from the same subnet as\n the cluster nodes.\n\n - `perNodeMaskSize`: Cluster creation preflight checks verify that the\n `perNodeMaskSize` value is sufficient to provision the number of pods\n specified in `maxPodsPerNode`.\n\n - `nodeSelector`: If no node labels match the `nodeSelector` value, the\n node reconciliation remains pending and cluster creation doesn't\n complete.\n\nThe following excerpt of a cluster configuration file shows how to implement\nflat-mode networking without BGP support. The CIDRs that appear in this excerpt\nare only examples and you will need to replace them with your own CIDRs. When\nreplacing the CIDRs with your own, ensure that they satisfy the criteria for pod\nreachability as specified in\n[Understanding the pod IP address reachability](#understanding_the_pod_ip_address_reachability). \n\n ---\n apiVersion: baremetal.cluster.gke.io/v1\n kind: Cluster\n metadata:\n name: flat-mode\n namespace: cluster-flat-mode\n spec:\n ... (other cluster config omitted)\n\n ...\n # Cluster networking configuration\n clusterNetwork:\n flatIPv4: true\n services:\n cidrBlocks:\n - 10.96.0.0/12\n ... (other cluster config omitted)\n\n ...\n ---\n apiVersion: baremetal.cluster.gke.io/v1alpha1\n kind: ClusterCIDRConfig\n metadata:\n name: cluster-wide-1\n namespace: cluster-flat-mode\n spec:\n ipv4:\n cidr: \"222.1.0.0/16\"\n perNodeMaskSize: 24\n\nLimitations\n\nThe static flat-mode network for Google Distributed Cloud comes with the following\nlimitations:\n\n- Pods using flat-mode networks would be reachable within the single Layer 2\n domain. Any other machine which is not in the cluster, but in the same Layer\n 2 domain can also reach the Pods. This limitation exists for IPv6 as well\n when dualstack clusters are created and when IPv6 is in flat-mode without\n BGP.\n For more information, see\n [Understanding the pod IP address reachability](#understanding_the_pod_ip_address_reachability).\n\n- The Google Distributed Cloud IPAM controller tracks the IP address availability\n within the configured pod CIDRs. It does not track the IPs already in use by\n other devices. Hence, any other IPs in the Layer 2 domain must not interfere\n with the POD CIDRs. For more information, see\n [Understanding the pod IP address reachability](#understanding_the_pod_ip_address_reachability)."]]