CODE/2022-10-22

Changing the Kubernetes NodePort Range

Kubernetes typically allocates NodePort Service ports from 30000–32767. Cluster administrators can configure a different range on the API server when network policy requires it.

Plan the change

Check for collisions with host services and firewall rules, and inventory existing NodePort Services. Choose a range that accommodates existing allocations and operational requirements. Changing control-plane configuration can interrupt API availability; use a maintenance plan and a tested backup.

Configure a kubeadm control plane

For a self-managed kubeadm cluster, the API server is normally a static Pod with a manifest at /etc/kubernetes/manifests/kube-apiserver.yaml. Its command can include an argument such as:
plain text_snippet
Plain Text · 1 line|
--service-node-port-range=20000-22767
Use a range appropriate to your cluster, and ensure the effective configuration is consistent across all API servers. Follow your cluster's supported configuration and upgrade process; changes to static Pod manifests cause kubelet to recreate the affected API server. In an HA cluster, roll changes one control-plane node at a time and verify health after each change. Managed services may not expose this setting.

Verify

Inspect the effective API server configuration and create a test Service in the intended range using your normal deployment workflow. Check existing Services and connectivity afterward. Do not delete and recreate existing Services without first assessing allocation, downtime, and client impact.
COMPANION ESSAYS / 思想脉络与互照篇目
同卷深读2026-05-22 ·

Installing Python 3 Alongside System Python on CentOS 7

同属「系统工程卷」脉络衍生思考与工程推演推演阅读 →
跨界互照2026-08-22 ·

我的书架:03|金融经管:经济运行、金融体系与企业治理

我的书架:03|金融经管:经济运行、金融体系与企业治理

跨领域对照思辨 · 从「思想随笔」视界互为印证推演阅读 →
RELATED INDEX / 相关阅读索引
柯航hang.ke·© 2014—2026
CC BY-NC 4.0·