Limit the number of pods per node

前端 未结 2 840
北恋
北恋 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: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.

提交回复
热议问题