A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://cloud.google.com/kubernetes-engine/docs/how-to/multi-pod-cidr below:

Adding Pod IPv4 address ranges | GKE networking

This page shows you how to configure additional Pod IPv4 address ranges for a VPC-native cluster and how to specify custom Pod IPv4 address ranges for node pools of a VPC-native cluster.

Pod IPv4 address ranges in VPC-native clusters always come from subnet secondary IPv4 address ranges. When you create a new cluster, you assign the cluster a default Pod IPv4 address range.

Before you begin

Before you start, make sure that you have performed the following tasks:

Create a new subnet secondary IPv4 address range

To create a new subnet secondary IPv4 address range, use either the Google Cloud console or the Google Cloud CLI. Each subnet supports up to 30 secondary IPv4 address ranges. For more information, see Edit secondary IPv4 ranges in the VPC documentation.

Console
  1. Go to the VPC networks page in the Google Cloud console.

    Go to VPC networks

  2. In the VPC networks list, select the network that you want to expand.

  3. In the Subnets list, select the subnet that you want.

  4. Click Edit.

  5. Click Add IP range.

  6. For Subnet range name, enter the name of the new subnet secondary IPv4 address range. For example, pod-range-2.

  7. For Secondary IP range, enter the IPv4 address range in CIDR format. For example, 10.2.204.0/22.

  8. Click Save.

gcloud
gcloud compute networks subnets update SUBNET_NAME \
    --region=REGION \
    --add-secondary-ranges=SECONDARY_RANGE_NAME=SECONDARY_RANGE_CIDR

Replace the following:

You can add two or more new subnet secondary IPv4 address ranges by specifying additional SECONDARY_RANGE_NAME=SECONDARY_RANGE_CIDR pairs, separated by commas, after the --add-secondary-ranges flag.

Assign additional Pod IPv4 ranges to a cluster

You can assign additional Pod IPv4 address ranges at the cluster level, applicable to new nodes created in new node pools you create in the cluster. To assign additional Pod IPv4 address ranges to a cluster, you must first create a new subnet secondary IPv4 address range.

Assigning additional Pod IPv4 address ranges to a cluster is supported by:

Console
  1. Go to the Google Kubernetes Engine page in the Google Cloud console.

    Go to Google Kubernetes Engine

  2. Next to the cluster you want to edit, click more_vert Actions, then click edit Edit.

  3. In the Networking section, next to Cluster Pod IPv4 ranges (additional), click edit Edit.

  4. In the Edit additional Cluster Pod IPv4 ranges dialog, click Pod secondary CIDR ranges and select the name(s) of one or more existing subnet secondary IPv4 address ranges in the cluster's subnet. If no additional subnet secondary IPv4 address ranges are available, first Create a new subnet secondary IPv4 address range then repeat these steps.

  5. Click Save Changes.

gcloud
  1. Update your cluster using the --additional-pod-ipv4-ranges flag:

    gcloud container clusters update CLUSTER_NAME \
        --additional-pod-ipv4-ranges=SECONDARY_RANGE_NAME \
        --location=COMPUTE_LOCATION
    

    Replace the following:

Look up cluster Pod IPv4 ranges

To look up the default Pod IPv4 address range of a cluster and any additional Pod IPv4 address ranges that have been assigned to the cluster, use the following command:

gcloud container clusters describe CLUSTER_NAME \
    --location=COMPUTE_LOCATION

Replace the following:

The output is similar to the following, which includes the cluster's IPAllocationPolicy:

ipAllocationPolicy:
  clusterSecondaryRangeName: cluster-pods
  clusterIpv4CidrBlock: 10.10.0.0/23
  additionalPodRangesConfig:
    podRangeNames:
      - pod-range-1
      - pod-range-2

where:

Note: The ipAllocationPolicy output also includes the deprecated clusterIpv4Cidr attribute. Refer to the clusterIpv4CidrBlock attribute in the output instead. Node pool custom Pod IPv4 address ranges

For Standard clusters running GKE 1.20.4-gke.500 or later, you can assign a custom Pod IPv4 range to a new node pool using one of following methods:

A node pool's custom Pod IPv4 address range overrides all Pod IPv4 address ranges defined at the cluster level, including additional Pod IPv4 address ranges assigned to the cluster. Custom Pod IPv4 address ranges assigned to node pools are also called discontiguous multi-Pod CIDR.

Node pool custom Pod IPv4 address range example

The following diagram shows a VPC-native cluster with user-managed Pod IPv4 address ranges:

Diagram: Node pool custom Pod IPv4 address range example

In the preceding diagram:

Node pool custom Pod IPv4 address range managed by GKE

To create a node pool with a custom Pod IPv4 address range managed by GKE, use gcloud CLI or GKE API as follows:

gcloud
gcloud container node-pools create POOL_NAME \
  --cluster=CLUSTER_NAME \
  --location=COMPUTE_LOCATION \
  --create-pod-ipv4-range=name=SECONDARY_RANGE_NAME,range=CIDR_OR_NETMASK

Replace the following:

Note: You can use "" as the value for the --create-pod-ipv4-range flag. When you do that, GKE attempts to create a new /14 subnet secondary IPv4 address range that doesn't conflict with existing subnet IPv4 address ranges in the VPC network that contains the cluster's subnet. GKE generates the name of the new subnet secondary IPv4 address range automatically. For more information, see the gcloud container node-pools create documentation. API
"nodePool": {
  "name": "POOL_NAME",
  ...
  "networkConfig": {
    "createPodRange": true,
    "podRange": "SECONDARY_RANGE_NAME",
    "podIpv4CidrBlock": "CIDR_OR_NETMASK"
    }
}

Replace the following:

User-managed node pool custom Pod IPv4 address range

To create a node pool with a user-managed custom Pod IPv4 address range, use gcloud CLI or GKE API as follows:

gcloud
gcloud container node-pools create POOL_NAME \
    --cluster=CLUSTER_NAME \
    --location=COMPUTE_LOCATION \
    --pod-ipv4-range SECONDARY_RANGE_NAME

Replace the following:

API
"nodePool": {
  "name": "POOL_NAME",
  ...
  "networkConfig": {
    "createPodRange": false,
    "podRange": "SECONDARY_RANGE_NAME"
    }
}

Replace the following:

Look up node pool Pod IPv4 ranges

To look up the Pod IPv4 address range of a node pool, use the following command:

gcloud container node-pools describe POOL_NAME \
    --cluster=CLUSTER_NAME \
    --location=COMPUTE_LOCATION

Replace the following:

The output is similar to the following, which includes the node pool's NodeNetworkConfig:

  networkConfig:
    podRange: podrange
    podIpv4CidrBlock: 192.168.0.0/18

where:

If the node pool is using a custom Pod IPv4 address range, the podRange and podIpv4CidrBlock values are different from the cluster's default Pod IPv4 address range.

Follow-up steps

After you have assigned additional Pod IPv4 address ranges to a cluster or configured node pool custom Pod IPv4 address ranges, GKE updates the automatically-created gke-[cluster-name]-[cluster-hash]-all VPC firewall rule so that its source range includes all Pod IPv4 addresses.

You might also need to:

What's next

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4