
In OpenShift, a node's IP address is crucial for communication between nodes in a cluster.
A node's IP address is used for internal communication, and it's not accessible from outside the cluster.
You can configure a node's IP address in OpenShift using the `node-IP` parameter in the `cluster-network` configuration file.
This parameter specifies the IP address of the node, which is used for internal communication.
OpenShift Node Configuration
You can configure bonding while creating an OpenShift cluster by selecting the Static IP, bridges, and bonds option while adding a node.
To specify a Static network configuration, you'll need to switch to the YAML view, which allows for more advanced configurations.
The YAML must be written using the Nmstate syntax, a declarative network manager for Linux hosts.
Nmstate integrates with the Kubernetes NMState Operator to simplify network management within Kubernetes environments.
In our case, we wanted to tell the new node to use two of its interfaces and retrieve the IP via DHCP.
The two ports to be used are defined in the bottom form and have to match your machine's MAC addresses.
Additional reading: Kubernetes Vs. Openshift
Bonding Config for Node Addition
You can specify complex network configurations during the installation phase of adding a new node to your OpenShift cluster.
Select the Static IP, bridges, and bonds option while adding a node.
In the next step, you'll be asked to specify a Static network configuration, which can be done using the YAML view.
The YAML view requires using the Nmstate syntax, which is a declarative network manager for Linux hosts.
Nmstate integrates through the Kubernetes NMState Operator, allowing users to manage and automate network configurations on cluster nodes.
To create a new interface of type bond, you need to specify the ipv4 address being provided via DHCP.
In the link-aggregation section, you specify which interfaces to aggregate.
You have to match your machine's MAC addresses in the bottom form.
A problem we found is that the copy-mac-from option is not accepted by the Cluster Manager, so you need to specify a MAC address identical to one of the two NICs.
If everything works properly, you'll see the bond plus the two NICs in the Cluster Manager once you boot with the generated ISO.
EgressIP Prerequisites
To configure egress IP in OpenShift, you need to set up a scenario to debug and trace workloads' source IPs and the flow between pods/containers and external resources.
You'll need to install an Httpd web server on a Bastion or external VM to simulate external resources being requested from workloads inside the OpenShift cluster.
The Httpd server should have a minimal index.html page to check the response when hit from different pods.
You'll also need to open the firewall in the public zone using a specific port, such as 8080.
Check the different nodes and their HOST_IPs, which are the IPs assigned to the master and workers that are part of the OpenShift cluster running RHCoreOS.
These HOST_IPs are within the CIDR range of 192.168.126.0/24, as defined in the cluster_install.yaml used during the OCP installation.
Here are the different nodes and their HOST_IPs:
- Master: 192.168.126.1
- Worker0: 192.168.126.53
- Worker1: 192.168.126.54
In the Bouvier namespace, pods are located in specific workers with the following PodIPs and HOST_IPs:
- PodIP: 10.128.3.139
- HOST_IP: 192.168.126.53
In the simpson namespace, pods are running in workers with the following PodIPs and HOST_IPs:
- PodIP: 10.128.3.138
- HOST_IP: 192.168.126.53
When executing a curl inside the OpenShift Cluster, requesting the IP of the external resource (web server), you need to execute it first from the Bouvier namespace pods.
Frequently Asked Questions
What is node IP vs pod IP vs clusterIP?
Node IP, Pod IP, and Cluster IP are three distinct IP addresses in a Kubernetes (k8s) cluster, each serving a unique purpose: Node IP identifies the server, Pod IP identifies the containerized application, and Cluster IP enables communication between services
Sources
- https://miminar.fedorapeople.org/_preview/openshift-enterprise/registry-redeploy/dev_guide/expose_service/expose_internal_ip_nodeport.html
- https://ibm.github.io/waiops-tech-jam/blog/single-node-openshift-deployment-with-static-ip/
- https://www.neteye-blog.com/2024/07/bonding-configuration-while-adding-an-openshift-node/
- https://rcarrata.com/openshift/egress-ip-ovn/
- https://kenmoini.com/post/2021/11/sno-at-the-edge/
Featured Images: pexels.com