设置k8s node最大pod数量

默认情况下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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值