|
| 1 | +// Module included in the following assemblies: |
| 2 | +// |
| 3 | +// * networking/configuring-cluster-network-range.adoc |
| 4 | + |
| 5 | +:_content-type: PROCEDURE |
| 6 | +[id="nw-cluster-network-range-edit_{context}"] |
| 7 | += Expanding the cluster network IP address range |
| 8 | + |
| 9 | +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. |
| 10 | + |
| 11 | +.Prerequisites |
| 12 | + |
| 13 | +* Install the OpenShift CLI (`oc`). |
| 14 | +* Log in to the cluster with a user with `cluster-admin` privileges. |
| 15 | +* Ensure that the cluster uses the OVN-Kubernetes network plugin. |
| 16 | +
|
| 17 | +.Procedure |
| 18 | + |
| 19 | +. To obtain the cluster network range and host prefix for your cluster, enter the following command: |
| 20 | ++ |
| 21 | +[source,terminal] |
| 22 | +---- |
| 23 | +$ oc get network.operator.openshift.io \ |
| 24 | + -o jsonpath="{.items[0].spec.clusterNetwork}" |
| 25 | +---- |
| 26 | ++ |
| 27 | +.Example output |
| 28 | +[source,text] |
| 29 | +---- |
| 30 | +[{"cidr":"10.217.0.0/22","hostPrefix":23}] |
| 31 | +---- |
| 32 | + |
| 33 | +. 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. |
| 34 | ++ |
| 35 | +[source,terminal] |
| 36 | +---- |
| 37 | +$ oc patch Network.config.openshift.io cluster --type='merge' --patch \ |
| 38 | + '{ |
| 39 | + "spec":{ |
| 40 | + "clusterNetwork": [ {"cidr":"<network>/<cidr>","hostPrefix":<prefix>} ], |
| 41 | + "networkType": "OVNKubernetes" |
| 42 | + } |
| 43 | + }' |
| 44 | +---- |
| 45 | ++ |
| 46 | +-- |
| 47 | +where: |
| 48 | + |
| 49 | +`<network>`:: Specifies the network part of the `cidr` field that you obtained from the previous step. You cannot change this value. |
| 50 | +`<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. |
| 51 | +`<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. |
| 52 | +-- |
| 53 | ++ |
| 54 | +.Example command |
| 55 | +[source,terminal] |
| 56 | +---- |
| 57 | +$ oc patch Network.config.openshift.io cluster --type='merge' --patch \ |
| 58 | + '{ |
| 59 | + "spec":{ |
| 60 | + "clusterNetwork": [ {"cidr":"10.217.0.0/14","hostPrefix": 23} ], |
| 61 | + "networkType": "OVNKubernetes" |
| 62 | + } |
| 63 | + }' |
| 64 | +---- |
| 65 | ++ |
| 66 | +.Example output |
| 67 | +[source,text] |
| 68 | +---- |
| 69 | +network.config.openshift.io/cluster patched |
| 70 | +---- |
| 71 | + |
| 72 | +. To confirm that the configuration is active, enter the following command. It can take up to 30 minutes for this change to take effect. |
| 73 | ++ |
| 74 | +[source,terminal] |
| 75 | +---- |
| 76 | +$ oc get network.operator.openshift.io \ |
| 77 | + -o jsonpath="{.items[0].spec.clusterNetwork}" |
| 78 | +---- |
| 79 | ++ |
| 80 | +.Example output |
| 81 | +[source,text] |
| 82 | +---- |
| 83 | +[{"cidr":"10.217.0.0/14","hostPrefix":23}] |
| 84 | +---- |
0 commit comments