Skip to content

Instantly share code, notes, and snippets.

@dwojciec
Last active June 5, 2020 13:13
Show Gist options
  • Save dwojciec/97f25964b6f4e2c2dba783ae49b1742c to your computer and use it in GitHub Desktop.
Save dwojciec/97f25964b6f4e2c2dba783ae49b1742c to your computer and use it in GitHub Desktop.
Openshift 4 - How to change the default value of servicesNodePortRange
$ oc project
Using project "openshift-kube-apiserver" on server "https://api.cluster-montpel-4ceb.montpel-4ceb.example.opentlc.com:6443".
$ oc edit kubeapiservers.operator.openshift.io/cluster
find /unsupportedConfigOverrides
and add this line servicesNodePortRange: 30000-32999 like :
```
storageConfig:
urls:
- https://10.0.141.13:2379
- https://10.0.157.246:2379
- https://10.0.162.43:2379
- https://localhost:2379
operatorLogLevel: ""
unsupportedConfigOverrides:
servicesNodePortRange: 30000-32999
```
$ oc get pod | grep kube
kube-apiserver-ip-10-0-141-13.eu-central-1.compute.internal 4/4 Running 4 5m14s
kube-apiserver-ip-10-0-157-246.eu-central-1.compute.internal 4/4 Running 4 7m26s
kube-apiserver-ip-10-0-162-43.eu-central-1.compute.internal 4/4 Running 4 2m47s
To verify it was applied :
$ oc exec -it kube-apiserver-ip-10-0-141-13.eu-central-1.compute.internal /bin/sh
sh-4.2# vi /etc/kubernetes/static-pod-resources/configmaps/config/config.yaml
Check the value of servicesNodePortRange
or
# oc describe kubeapiservers.operator.openshift.io/cluster | grep -i "Port Range"
Services Node Port Range: 30000-32999
or by using jid (https://github.com/fiatjaf/jiq) - Brew install jiq on MACOS
$ oc get kubeapiservers.operator.openshift.io/cluster -o json | jid -q | pbcopy
[Filter]> .spec.unsupportedConfigOverrides
{
"servicesNodePortRange": "30000-32999"
}
see https://access.redhat.com/solutions/4728621 for more information.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment