From a3d0838373199bcdeff26141cc1237e2a00e226a Mon Sep 17 00:00:00 2001 From: Jason Boxman Date: Wed, 1 Mar 2023 22:11:40 -0500 Subject: [PATCH] OSDOCS-4976: Describe expanding cluster network range - https://issues.redhat.com/browse/OSDOCS-4976 - https://issues.redhat.com/browse/SDN-1658 --- _topic_maps/_topic_map.yml | 2 + modules/nw-cluster-network-range-edit.adoc | 84 +++++++++++++++++++ .../configuring-cluster-network-range.adoc | 27 ++++++ 3 files changed, 113 insertions(+) create mode 100644 modules/nw-cluster-network-range-edit.adoc create mode 100644 networking/configuring-cluster-network-range.adoc diff --git a/_topic_maps/_topic_map.yml b/_topic_maps/_topic_map.yml index 78d4cd83bd..e5e3ff7a14 100644 --- a/_topic_maps/_topic_map.yml +++ b/_topic_maps/_topic_map.yml @@ -1131,6 +1131,8 @@ Topics: File: changing-cluster-network-mtu - Name: Configuring the node port service range File: configuring-node-port-service-range +- Name: Configuring the cluster network IP address range + File: configuring-cluster-network-range - Name: Configuring IP failover File: configuring-ipfailover - Name: Configuring interface-level network sysctls diff --git a/modules/nw-cluster-network-range-edit.adoc b/modules/nw-cluster-network-range-edit.adoc new file mode 100644 index 0000000000..d850af2940 --- /dev/null +++ b/modules/nw-cluster-network-range-edit.adoc @@ -0,0 +1,84 @@ +// Module included in the following assemblies: +// +// * networking/configuring-cluster-network-range.adoc + +:_content-type: PROCEDURE +[id="nw-cluster-network-range-edit_{context}"] += Expanding the cluster network IP address range + +You can expand the IP address range for the cluster network. Because this change requires rolling out a new Operator configuration across the cluster, it can take up to 30 minutes to take effect. + +.Prerequisites + +* Install the OpenShift CLI (`oc`). +* Log in to the cluster with a user with `cluster-admin` privileges. +* Ensure that the cluster uses the OVN-Kubernetes network plugin. + +.Procedure + +. To obtain the cluster network range and host prefix for your cluster, enter the following command: ++ +[source,terminal] +---- +$ oc get network.operator.openshift.io \ + -o jsonpath="{.items[0].spec.clusterNetwork}" +---- ++ +.Example output +[source,text] +---- +[{"cidr":"10.217.0.0/22","hostPrefix":23}] +---- + +. To expand the cluster network IP address range, enter the following command. Use the CIDR IP address range and host prefix returned from the output of the previous command. ++ +[source,terminal] +---- +$ oc patch Network.config.openshift.io cluster --type='merge' --patch \ + '{ + "spec":{ + "clusterNetwork": [ {"cidr":"/","hostPrefix":} ], + "networkType": "OVNKubernetes" + } + }' +---- ++ +-- +where: + +``:: Specifies the network part of the `cidr` field that you obtained from the previous step. You cannot change this value. +``:: Specifies the network prefix length. For example, `14`. Change this value to a smaller number than the value from the output in the previous step to expand the cluster network range. +``:: Specifies the current host prefix for your cluster. This value must be the same value for the `hostPrefix` field that you obtained from the previous step. +-- ++ +.Example command +[source,terminal] +---- +$ oc patch Network.config.openshift.io cluster --type='merge' --patch \ + '{ + "spec":{ + "clusterNetwork": [ {"cidr":"10.217.0.0/14","hostPrefix": 23} ], + "networkType": "OVNKubernetes" + } + }' +---- ++ +.Example output +[source,text] +---- +network.config.openshift.io/cluster patched +---- + +. To confirm that the configuration is active, enter the following command. It can take up to 30 minutes for this change to take effect. ++ +[source,terminal] +---- +$ oc get network.operator.openshift.io \ + -o jsonpath="{.items[0].spec.clusterNetwork}" +---- ++ +.Example output +[source,text] +---- +[{"cidr":"10.217.0.0/14","hostPrefix":23}] +---- diff --git a/networking/configuring-cluster-network-range.adoc b/networking/configuring-cluster-network-range.adoc new file mode 100644 index 0000000000..03582968d1 --- /dev/null +++ b/networking/configuring-cluster-network-range.adoc @@ -0,0 +1,27 @@ +:_content-type: ASSEMBLY +[id="configuring-cluster-network-range"] += Configuring the cluster network range +include::_attributes/common-attributes.adoc[] +:context: configuring-cluster-network-range + +toc::[] + +As a cluster administrator, you can expand the cluster network range after cluster installation. You might want to expand the cluster network range if you need more IP addresses for additional nodes. + +For example, if you deployed a cluster and specified `10.128.0.0/19` as the cluster network range and a host prefix of `23`, you are limited to 16 nodes. You can expand that to 510 nodes by changing the CIDR mask on a cluster to `/14`. + +When expanding the cluster network address range, your cluster must use the xref:../networking/ovn_kubernetes_network_provider/about-ovn-kubernetes.adoc#about-ovn-kubernetes[OVN-Kubernetes network plugin]. Other network plugins are not supported. + +The following limitations apply when modifying the cluster network IP address range: + +- The CIDR mask size specified must always be smaller than the currently configured CIDR mask size, because you can only increase IP space by adding more nodes to an installed cluster +- The host prefix cannot be modified +- Pods that are configured with an overridden default gateway must be recreated after the cluster network expands + +include::modules/nw-cluster-network-range-edit.adoc[leveloffset=+1] + +[role="_additional-resources"] +[id="configuring-cluster-network-range-additional-resources"] +== Additional resources + +* xref:../networking/ovn_kubernetes_network_provider/about-ovn-kubernetes.adoc#about-ovn-kubernetes[About the OVN-Kubernetes network plugin]