Extending kubeadm nodeport range

If you need more space for NodePort range, you need to scale up the range (default is from 30000-32767). This tutorial is tested in single master kubernetes cluster build with kubeadm.

In the master node, edit the following config file

nano /etc/kubernetes/manifests/kube-apiserver.yaml

add the following configuration into the file, for example I want to extend the port from 30000 into 50000

  - command:
    - kube-apiserver
    - --service-node-port-range=30000-50000

restart kubelet

systemctl restart kubelet
btech@zu-master:~$ kubectl get svc
NAME                                                     TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)                                        AGE
onos-external                                            NodePort    <none>        8181:49000/TCP                                 9d


Comments are closed.