Limit the number of pods per node

前端 未结 2 839
北恋
北恋 2021-01-19 03:46

I\'m trying to limit the number of pods per each node from my cluster. I managed to add a global limit per node from kubeadm init with config file:

apiVersio         


        
相关标签:
2条回答
  • 2021-01-19 04:00

    You can also set the maximum number of pods per node with the kubelet --max-pods option.

    0 讨论(0)
  • 2021-01-19 04:15

    There is a config.yaml file at /var/lib/kubelet. This config file is generated from kubelet config map in kube-system namespace when you run kubeadm join.Partial content of the file is as below.

    apiVersion: kubelet.config.k8s.io/v1beta1
    authentication:
      anonymous:
        enabled: false
      webhook:
        cacheTTL: 0s
        enabled: true
      x509:
        clientCAFile: /etc/kubernetes/pki/ca.crt
    authorization:
      mode: Webhook
      webhook:
        cacheAuthorizedTTL: 0s
        cacheUnauthorizedTTL: 0s
    clusterDNS:
    - 10.96.0.10
    maxPods: 10
    

    You can change that file and add maxPods parameter and then restart kubelet on the node.

    sudo systemctl restart kubelet 
    

    Currently in kubeadm join there is no way to pass a kubelet config file.

    0 讨论(0)
提交回复
热议问题