mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-05 12:46:18 +01:00
80 lines
2.4 KiB
Plaintext
80 lines
2.4 KiB
Plaintext
// Module included in the following assemblies:
|
|
//
|
|
// * networking/configuring-node-port-service-range.adoc
|
|
|
|
:_mod-docs-content-type: PROCEDURE
|
|
[id="nw-nodeport-service-range-edit_{context}"]
|
|
= Expanding the node port range
|
|
|
|
[role="_abstract"]
|
|
To expand the node port range for your {product-title} cluster after installation, you can use the `oc patch` command to update the `serviceNodePortRange` parameter. You can expand the range on either side, but you cannot shrink it after installation.
|
|
|
|
[IMPORTANT]
|
|
====
|
|
Red{nbsp}Hat has not performed testing outside the default port range of `30000-32768`. For ranges outside the default port range, ensure that you test to verify that expanding your node port range does not impact your cluster. If you expanded the range and a port allocation issue occurs, create a new cluster and set the required range for it.
|
|
====
|
|
|
|
.Prerequisites
|
|
|
|
* Installed the {oc-first}.
|
|
* Logged in to the cluster as a user with `cluster-admin` privileges.
|
|
* You ensured that your cluster infrastructure allows access to the ports that exist in the extended range. For example, if you expand the node port range to `30000-32900`, your firewall or packet filtering configuration must allow the inclusive port range of `30000-32900`.
|
|
|
|
.Procedure
|
|
|
|
* To expand the range for the `serviceNodePortRange` parameter in the `network.config.openshift.io` object that your cluster uses to manage traffic for pods, enter the following command:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc patch network.config.openshift.io cluster --type=merge -p \
|
|
'{
|
|
"spec":
|
|
{ "serviceNodePortRange": "<port_range>" }
|
|
}'
|
|
----
|
|
+
|
|
--
|
|
where:
|
|
|
|
`<port_range>`:: Specifies the expanded range, such as `30000-32900`.
|
|
--
|
|
+
|
|
[TIP]
|
|
====
|
|
You can also apply the following YAML to update the node port range:
|
|
|
|
[source,yaml]
|
|
----
|
|
apiVersion: config.openshift.io/v1
|
|
kind: Network
|
|
metadata:
|
|
name: cluster
|
|
spec:
|
|
serviceNodePortRange: "<port_range>"
|
|
# ...
|
|
----
|
|
====
|
|
+
|
|
.Example output
|
|
[source,terminal]
|
|
----
|
|
network.config.openshift.io/cluster patched
|
|
----
|
|
|
|
.Verification
|
|
|
|
* To confirm that the updated configuration is active, enter the following command. The update can take several minutes to apply.
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc get configmaps -n openshift-kube-apiserver config \
|
|
-o jsonpath="{.data['config\.yaml']}" | \
|
|
grep -Eo '"service-node-port-range":["[[:digit:]]+-[[:digit:]]+"]'
|
|
----
|
|
+
|
|
.Example output
|
|
[source,terminal]
|
|
----
|
|
"service-node-port-range":["30000-32900"]
|
|
----
|