Manage node IP addresses

This document gives guidance on the number of IP addresses that are needed for admin clusters and user clusters in Google Distributed Cloud.

DHCP or static

If your network has a DHCP server, you can configure an admin cluster or a user cluster so that it gets its node IP addresses from the DHCP server. In the cluster configuration file, set network.ipMode.type to "dhcp".

If you prefer to specify static IP addresses for a cluster, set network.ipMode.type to "static".

How many IP addresses does an admin cluster need?

An admin cluster needs to have enough IP addresses available for the following:

  • A node to run the control plane for the admin cluster

  • Two nodes to run add-ons for the admin cluster

  • For each associated high availability (HA) user cluster, three nodes to run the control plane for the user cluster

  • For each associated non-HA user cluster, one node to run the control plane for the user cluster

  • A temporary node to be used during upgrade, update, and auto repair

For example, suppose an admin cluster has one associated HA user cluster and one associated non-HA cluster. The admin cluster would need to have eight IP addresses available for nodes.

Now suppose you decide to add an additional HA user cluster. The admin cluster would need to have 11 IP addresses available for nodes. If your DHCP server is not able to provide the additional IP addresses, or if your admin cluster does not have that many static IP addresses available, then you must arrange for more IP addresses to be available before you create the new user cluster.

How many IP addresses does a user cluster need?

A user cluster needs to have one IP address for each node and an additional IP address to be used for a temporary node during upgrade, update, and auto repair.

For example, a user cluster that has five nodes needs to have six IP addresses available for nodes.

Now suppose you want to add two nodes to the user cluster. The user cluster would need to have eight IP addresses available for nodes. If your DHCP server is not able to provide the additional IP addresses, or if your user cluster does not have that many static IP addresses available, then you must arrange for more IP addresses to be available before you add the new nodes.

Static IP addresses for an admin cluster

This section explains how to manage static IP addresses for an admin cluster.

Determine the IP addresses that are available for admin cluster nodes

The IP block file for your admin cluster is listed as the value of network.ipMode.ipBlockFilePath in your admin cluster configuration file. In the IP block file, you can see the IP addresses that are available for nodes in the admin cluster.

For example, here is an IP block file that has five IP addresses:

blocks:
  - netmask: 255.255.255.0
    gateway: 172.16.20.1
    ips:
    - ip: 172.16.20.50
      hostname: admin-vm-1
    - ip: 172.16.20.51
      hostname: admin-vm-2
    - ip: 172.16.20.52
      hostname: admin-vm-3
    - ip: 172.16.20.53
      hostname: admin-vm-4
    - ip: 172.16.20.54
      hostname: admin-vm-5

Add IP addresses to an admin cluster

To make more IP addresses available for nodes in your admin cluster, add addresses to your IP block file, and then run the following command to update your admin cluster:

gkectl update admin --kubeconfig ADMIN_CLUSTER_KUBECONFIG--config ADMIN_CLUSTER_CONFIG

Replace the following:

  • ADMIN_CLUSTER_KUBECONFIG: the path of your admin cluster kubeconfig file

  • ADMIN_CLUSTER_CONFIG: the path of admin user cluster configuration file

Static IP addresses for a user cluster

This section explains how to manage static IP addresses for a user cluster.

Determine the IP addresses that are available for user cluster nodes

The IP block file for your user cluster is listed as the value of network.ipMode.ipBlockFilePath in your user cluster configuration file. In the IP block file, you can see the IP addresses that are available for nodes in the admin cluster.

For example, here is an IP block file that has four IP addresses:

blocks:
  - netmask: 255.255.255.0
    gateway: 172.16.20.1
    ips:
    - ip: 172.16.20.55
      hostname: user-vm-1
    - ip: 172.16.20.56
      hostname: user-vm-2
    - ip: 172.16.20.57
      hostname: user-vm-3
    - ip: 172.16.20.58
      hostname: user-vm-4

Add IP addresses to a user cluster

To make more IP addresses available for nodes in your user cluster, add addresses to your IP block file, and then run the following command to update your user cluster:

gkectl update cluster --kubeconfig ADMIN_CLUSTER_KUBECONFIG--config USER_CLUSTER_CONFIG

Replace the following:

  • ADMIN_CLUSTER_KUBECONFIG: the path of your admin cluster kubeconfig file

  • USER_CLUSTER_CONFIG: the path of your user cluster configuration file