nginx-ingress-controller results in the error message: "provided port is not in the valid range. The range of valid ports is 30000-32767".Tanzu Kubernetes Grid Integrated Edition
nginx-ingress-controller with http or https controller.service.nodePorts outside of the default --service-node-port-range of the kube-apiserver, this error (or similar) can occur.$ helm install --name nginx-ingress stable/nginx-ingress --set controller.service.type=NodePort --set controller.service.nodePorts.http=17080 --set controller.service.nodePorts.https=17443 --namespace default Error: release nginx-ingress failed: Service "nginx-ingress-controller" is invalid: spec.ports[0].nodePort: Invalid value: 17080: provided port is not in the valid range. The range of valid ports is 30000-32767In the above case, the
kube-apiserver has the --service-node-port-range flag set to its default portRange of 30000-32767.kube-apiserver --service-node-port-range parameter to reflect this.PKS deploys Kubernetes clusters using the BOSH release of OSS CFCR (Cloud Foundry Container Runtime), which is also known as Kubo release. For a BOSH managed deployment or object, here are the steps:
1. First, if using multi-master HA cluster, follow this knowledge article to identify the current master leader and take action on the leader:
How to identify the LEADER for Kubernetes Master endpoints in a Multi-Master Cluster configuration in PKS
2. If using single master cluster, then simply continue with these steps:
sudo -i
cd /var/vcap/jobs/kube-apiserver/config
bpm.yml file. Add the entire following line:- "--service-node-port-range=17080-17443"
kube-apiserver:monit restart kube-apiserver
running" state with:watch monit summary
nginx-ingress install:helm del --purge nginx-ingress
nginx-ingress-controller.nginx-ingress-controller helm chart:helm install --name nginx-ingress stable/nginx-ingress --set controller.service.type=NodePort --set controller.service.nodePorts.http=17080 --set controller.service.nodePorts.https=17443 --namespace default
NOTE: Manual modifications to the kube-apiserver parameters will not survive cluster upgrades or VM recreation. However, customers could use the TKGI Kubernetes Profiles feature to have the kube-apiserver set a specific node port range to use. See the TKGI doc Using Kubernetes Profiles for more information.