1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00
Files
openshift-docs/modules/nw-cluster-network-range-edit.adoc
2023-10-30 10:13:25 -04:00

85 lines
2.5 KiB
Plaintext

// Module included in the following assemblies:
//
// * networking/configuring-cluster-network-range.adoc
:_mod-docs-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":"<network>/<cidr>","hostPrefix":<prefix>} ],
"networkType": "OVNKubernetes"
}
}'
----
+
--
where:
`<network>`:: Specifies the network part of the `cidr` field that you obtained from the previous step. You cannot change this value.
`<cidr>`:: 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.
`<prefix>`:: 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}]
----