This page explains how to configure static IPs for use with GKE On-Prem clusters.
During installation, you generate a GKE On-Prem configuration file.
The configuration file you generate includes two
ipblockfilepath accepts the path to a YAML file containing a
configuration, described below.
If you want to use static IPs, you need to create two YAML files in your admin
workstation, one containing a
hostconfig to be used by your admin
cluster and another to be used by your user clusters.
Before you begin
- You need a minimum of N + 4 IP/hostname pairs in the admin cluster IP configuration, where N is the number of user clusters you plan to create.
- You can choose to create a high availability user cluster. A HA user cluster uses three user control planes. Each VM that runs a user control plane requires its own static IP.
The following is an example of a
hostconfig file with three hosts. Your file
might look different depending on your environment. For example, you might
ips array with more
hostconfig: dns: 18.104.22.168 # IPv4 address of DNS server used by nodes tod: 22.214.171.124 # IPv4 address of the NTP server used by the nodes blocks: - netmask: 255.255.252.0 gateway: 126.96.36.199 ips: - ip: 10.116.232.23 hostname: host1.enterprise.net # will be trimmed to host1 - ip: 10.116.232.65 hostname: host2.enterprise.net # will be trimmed to host2 - ip: 10.116.232.66 hostname: host3.enterprise.net # will be trimmed to host3
The YAML file contains two sections,
hostconfig contains networking parameters that apply statically to
all of your user cluster's nodes.
hostconfig configures two values:
dns: IP address of DNS server to use for nodes.
tod: the time server's IP address.
blocks contains an array of static IP addresses blocks. Currently,
GKE On-Prem only considers the first block for IP allocation.
Each block represents a network and its IP addresses within it.
gateway represent the network mask and default gateway to
use for nodes.
blocks: - netmask: 255.255.252.0 gateway: 188.8.131.52
ips array lists the IPs you've allocated. Each object in the array
contains an IPv4 address and its
blocks: ... ips: - ip: [IPV4_ADDRESS] hostname: [HOSTNAME] - ip: [IPV4_ADDRESS] hostname: [HOSTNAME] - ip: [IPV4_ADDRESS] hostname: [HOSTNAME] ...
GKE On-Prem keeps tracks of free and assigned IP addresses within this block, and allocates one available IP address to each node in a user cluster. Ensure that the number of IP addresses in the array is strictly greater than the number of nodes in the user cluster, and that each IP address is unique to your environment's network.
hostname, interpreted as the local hostname without its domain. If you
specify a fully-qualified domain name (FQDN), the domain name is trimmed. For
hostname values must be
To create the
hostconfig files from your admin workstation:
Copy the following template to a YAML file:
hostconfig: dns: tod: blocks: - netmask: gateway: ips: - ip: hostname: - ip: hostname: - ip: hostname:
Save the files by different names, like
During installation, modify the configuration file's
usercluster.ipblockfilepathfields with the appropriate files.
For more information, refer to Troubleshooting.