--master_port=**29501**
时间: 2024-08-15 19:10:02 浏览: 33
`master_port=**29501**` 是配置参数的一部分,通常用于设置 Kubernetes 集群中的 Master 节点上Kube-Scheduler 或 Kubelet 进程监听的服务端口。这个端口是用于协调器节点(Master)与工作节点之间的通信,比如调度决策。
具体来说,在Kubernetes集群中,`master_port` 指定了ServiceAccount Token Webhook (如果启用) 或 API Server Service 的TCP端口。当工作节点上的 pods 请求访问API资源时,会通过这个端口进行身份验证。
示例配置可能出现在 `kube-scheduler` 或 `kubelet` 的启动命令行选项中,如:
```yaml
# kube-scheduler配置
kubectl create -f - <<EOF
apiVersion: v1
kind: ConfigMap
metadata:
name: kube-scheduler-config
data:
scheduler.config: |
apiVersion: kubescheduler.k8s.io/v1beta1
kind: KubeSchedulerConfiguration
masterUrl: https://<master-ip>:29501
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: kube-scheduler
spec:
template:
spec:
containers:
- name: kube-scheduler
image: gcr.io/google_containers/kube-scheduler-amd64:v1.21.0
command: ["./kube-scheduler", "--config=/etc/kubernetes/scheduler.conf"]
ports:
- containerPort: 29501
EOF
# kubelet配置示例
kubectl edit pod <pod-name> -n kube-system \
--patch '{"spec":{"containers":[{"command":["./kubelet", "--container-runtime=docker", "--bootstrap-kubeconfig=/var/lib/kubelet/kubeconfig", "--kubeconfig=/var/lib/kubelet/kubeconfig", "--cgroup-driver=cgroupfs", "--allow-privileged=true", "--eviction-hard=memory.available%<10","--eviction-message='Memory limit exceeded'", "--feature-gates=AllAlpha", "--hostname-override=<node-name>", "--kube-api-burst=10", "--kube-api-qps=5", "--max-pods-per-node=110", "--register-node=true", "--address=0.0.0.0", "--alsologtostderr", "--v=4", "--cloud-provider=aws", "--cluster-dns=<dns-server>", "--cluster-domain=<cluster-domain>", "--cri-api-version=v1", "--runtime-request-timeout=1m", "--cgroups-per-qos=true", "--enforce-resource-quotas=true", "--eviction-hard=memory.available<10Mi,nodefs.available<10%,nodefs.inodesFree<5%", "--eviction-message='Kubelet has insufficent resources to schedule new pods.'", "--feature-gates=PodPidsLimit=true", "--network-plugin=cni", "--pod-infra-container-image=k8s.gcr.io/pause:3.2", "--proxy-mode=none", "--root-dir=/var/lib/kubelet", "--service-cluster-ip-range=<service-cluster-ip-range>", "--streaming-ports=10250,10255,10258", "--volumes-plugin=emptydir", "--v=2", "--master-url=https://<master-ip>:29501'}],"restartPolicy":"Always"}}'
```
相关推荐
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)