Can Hostnames be used Instead of IP Addresses for Kubernetes Nodes in the Cluster?

Problem

For BareOS clusters, traditionally, nodes within a PMK cluster displays IP addresses instead of the hostname in the NAME column.

Is there an option to use hostnames instead of IP Addresses?

NAME          STATUS  ROLES   AGE   VERSION
10.200.17.10  Ready   worker  191d  v1.17.9
10.200.17.11  Ready   worker  191d  v1.17.9
10.200.17.50  Ready   master  191d  v1.17.9
10.200.17.51  Ready   master  191d  v1.17.9
10.200.17.52  Ready   master  191d  v1.17.9

Environment

  • Platform9 Managed Kubernetes - v5.2, K8s v1.20 and above

Answer

  • Starting v5.2 and K8s v1.20, users building BareOS clusters within IPv4 environments that have DNS Resolution configured for all nodes can now opt to create clusters using the Node's Hostname or IP address via U/I.

  • From an API perspective, the useHostname API field has been added to the cluster creation specification. Setting useHostname to true when creating a cluster will cause all nodes in the cluster to be registered using their hostname instead of IP address.

NAME          STATUS   ROLES    AGE    VERSION
ddu-master1   Ready    master   131d   v1.21.3
ddu-master2   Ready    master   131d   v1.21.3
ddu-master3   Ready    master   131d   v1.21.3
ddu-worker1   Ready    worker   131d   v1.21.3
ddu-worker2   Ready    worker   131d   v1.21.3
circle-info

Info

This parameter is ignored when deploying clusters on public clouds - AWS, Azure, and when deploying BareOS IPv6 clusters.

circle-exclamation

Last updated