默认情况下k8s 一个node最多起110个pod.
- No more than 110 pods per node
- No more than 5000 nodes
- No more than 150000 total pods
- No more than 300000 total containers
如何修改一个node中起的pod数量呢?
在Node上 设置打开文件/var/lib/kubelet/config.yaml
修改参数maxPods为指定的值:
clusterDomain: cluster.local cpuManagerReconcilePeriod: 0s evictionPressureTransitionPeriod: 0s fileCheckFrequency: 0s healthzBindAddress: 127.0.0.1 healthzPort: 10248 httpCheckFrequency: 0s imageMinimumGCAge: 0s kind: KubeletConfiguration logging: {} nodeStatusReportFrequency: 0s nodeStatusUpdateFrequency: 0s resolvConf: /run/systemd/resolve/resolv.conf rotateCertificates: true runtimeRequestTimeout: 0s shutdownGracePeriod: 0s shutdownGracePeriodCriticalPods: 0s staticPodPath: /etc/kubernetes/manifests streamingConnectionIdleTimeout: 0s syncFrequency: 0s volumeStatsAggPeriod: 0s maxPods: 200 |
node端重启kubelet
sudo systemctl restart kubelet
查询状态:
$ kubectl describe node host07 | grep -i "Capacity\|Allocatable" -A 6 Capacity: cpu: 192 ephemeral-storage: 9298787068Ki hugepages-1Gi: 0 hugepages-2Mi: 0 memory: 1056273036Ki pods: 200 Allocatable: cpu: 192 ephemeral-storage: 8569762147680 hugepages-1Gi: 0 hugepages-2Mi: 0 memory: 1056170636Ki pods: 200 |