编辑 kube-apiserver.yaml文件
vim /etc/kubernetes/manifests/kube-apiserver.yaml
找到 –service-cluster-ip-range 这一行,在这一行的下一行增加 如下内容
--service-node-port-range=80-30000
实际 案例内容如
apiVersion: v1
kind: Pod
metadata:
creationTimestamp: null
labels:
component: kube-apiserver
tier: control-plane
name: kube-apiserver
namespace: kube-system
spec:
containers:
- command:
- kube-apiserver
- --advertise-address=192.168.0.254
- --allow-privileged=true
......省略n行.......... - --service-node-port-range=80-30000
最后 重启 kubelet
systemctl daemon-reload && systemctl restart kubelet
标签:service,kubernetes,--,端口,apiserver,range,nodeport,kube From: https://www.cnblogs.com/wszzn/p/18140642