eksctl
eksctl copied to clipboard
fix: duplicate --max-pods arguments in KUBELET_EXTRA_ARGS
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-podsvalue
Impact
- AL2 managed nodegroups: Fixed duplicate
--max-podsissue - 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.