This page describes the fields in an IP block file, which is used in the setup of Google Distributed Cloud.
You use an IP block file to describe a set of node machines and the network that
the machines are connected to. You create a separate IP block file for each
cluster. Both the admin and user cluster configuration files have a field called
network.ipMode.ipBlockFilePath
. You specify the absolute or relative path
of the IP block in this field.
Use an IP block file to list the IP addresses and optionally the hostnames in the following cases:
User clusters:
If
network.ipMode.type
is set to"static"
in the user cluster configuration file, list the IP addresses for worker nodes in the user cluster IP block file.If
infraConfigFilePath
is configured in the admin cluster configuration file (which enables topology domains), list the IP addresses for the control-plane nodes in the user cluster IP block file. The IP addresses for control-plane nodes are always static IP addresses even if worker nodes use DHCP.
Admin clusters:
If
infraConfigFilePath
is configured in the admin cluster configuration file (which enables topology domains), list the IP addresses for the control-plane nodes in the admin cluster IP block file.1.16 and lower non-HA admin cluster: list the IP addresses for the control-plane node and add-on nodes in the admin cluster IP block file.
1.16 and lower HA admin cluster: list the IP addresses for add-on nodes in an IP block file.
1.29 and lower kubeception user clusters: list the IP addresses for the user cluster control-plane nodes in the admin cluster IP block file.
Template
Filling in the fields in an IP block file
This section describes the fields in an IP block file.
blocks
An array of objects, each of which describes a set of hosts.
blocks[i].netmask
String. The subnet mask for the set of hosts. For example:
blocks: - netmask: "255.255.252.0"
blocks[i].gateway
String. The address of the default gateway for the set of hosts. For example:
blocks: - netmask: "255.255.252.0" gateway: "172.16.23.254"
blocks[i].ips
An array of objects. Each object has an individual IP address or a CIDR block of IP addresses.
If the object has an individual IP address, optionally, it can also have a hostname.
If you set
ip
to a CIDR block, don't specify a value forhostname
.When you don't specify a value for
hostname
, Google Distributed Cloud uses the VM's name from vSphere as the hostname.
blocks[i].isControlPlane
If infraConfigFilePath
is configured in the admin cluster configuration file,
and if the IP address is for a control-plane node, include
isControlPlane: true
. For user cluster worker nodes, specify
false
or omit the field because the default value is false
.
Example configuration files
The section provides some configurations with examples values filled in.
Example 1
This example specifies six IP addresses: two individual addresses and a CIDR block of four addresses.
blocks: - netmask: "255.255.252.0" gateway: "203.0.113.1" ips: - ip: 198.51.100.10 hostname: worker-node1 - ip: 198.51.100.11 hostname: worker-node2 - ip: 198.51.100.12/30 # 198.51.100.12 - 198.51.100.15
Example 2
This example shows an IP block file configured for topology domains.
blocks: - netmask: 255.255.255.0 gateway: 100.115.222.254 ips: - ip: 100.115.222.204 hostname: worker-1 - ip: 100.115.222.205 hostname: cp-1 isControlPlane: true - ip: 100.115.222.206 hostname: cp-2 isControlPlane: true - ip: 100.115.222.207 hostname: cp-3 isControlPlane: true - ip: 100.115.222.220/28 # 100.115.222.208 - 100.115.222.223 - netmask: 255.255.255.0 gateway: 100.115.223.254 ips: - ip: 100.115.223.206 hostname: worker-2 - ip: 100.115.223.220/28 # 100.115.223.208 - 100.115.223.223 - netmask: 255.255.255.0 gateway: 100.115.224.254 ips: - ip: 100.115.224.206 hostname: worker-3 - ip: 100.115.224.220/28 # 100.115.224.208 - 100.115.224.223
This example IP block file reserved IP addresses from three subnets, and each
subnet is represented as blocks[i]
. The blocks[i].gateway
is important, as
it works as the identification of the IP block. You add the same IP address to
topologyDomains[i].network.gateway
in the VSphereInfraConfig
custom resource
inside the
vSphere Infrastructure Configuration File.
There are three IPs configured with isControlPlane: true
, which indicates that
these IP addresses are reserved for control-plane nodes only. In the
IP block file of the admin cluster or user cluster, there must be three IP
addresses reserved for control-plane nodes. Reserve them in the target subnet
according to the applicable topology of the cluster.
Because the control-plane nodes must be in a single topology domain, the IP addresses for the control-plane nodes must be in the same IP block.