Skip to content

feat(nodeadm): enable configuring maxPods with an adjustable offset #2276

@vflaux

Description

@vflaux

What would you like to be added:
I would like to have an option in the node config to adjust the number of maximum pods base on the calculated value.
Example:

apiVersion: node.eks.aws/v1alpha1
kind: NodeConfig
spec:
  kubelet:
    config:
      maxPodsOffset: 1

This would increase the calculated maxPods by 1.

Why is this needed:

When you deploy daemonsets using host network, this do not consume a new IP on nodes. We may want to account for this and increase the maximum number of pods allowed on a node, since the limit is typically based on the number of available IPs on the instance.
You can't simply set the maxPods value because you don't always know in advance which instance type will be launched (for example, when using Karpenter).

additional info
We currently do this using a userData script:

#!/bin/sh -e
cd /etc/kubernetes/kubelet/config.json.d
jq <00-nodeadm.conf >10-maxpods.conf '{"apiVersion": "kubelet.config.k8s.io/v1beta1", "kind": "KubeletConfiguration", "maxPods": (.maxPods+1)}'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions