eksctl icon indicating copy to clipboard operation
eksctl copied to clipboard

fix: duplicate --max-pods arguments in KUBELET_EXTRA_ARGS

Open guessi opened this issue 3 months ago • 0 comments

Description

Fixes #7946 by preventing duplicate --max-pods arguments in KUBELET_EXTRA_ARGS when using the deprecated MaxPodsPerNode setting with AL2 managed nodegroups.

Problem

When MaxPodsPerNode is set, eksctl's makeMaxPodsScript function appends --max-pods to KUBELET_EXTRA_ARGS without checking if it already exists, resulting in:

KUBELET_EXTRA_ARGS=... --max-pods=58 --max-pods=30

Solution

Modified makeMaxPodsScript to:

  • Remove any existing --max-pods=<number> arguments using sed
  • Clean up extra spaces
  • Append the new --max-pods value

Impact

  • AL2 managed nodegroups: Fixed duplicate --max-pods issue
  • AL2023: No impact (uses nodeadm configuration, not bootstrap scripts)
  • Backward compatibility: Maintained

Testing

The fix ensures only one --max-pods argument appears in KUBELET_EXTRA_ARGS, with eksctl's MaxPodsPerNode value taking precedence.

guessi avatar Oct 08 '25 06:10 guessi