-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
What were you trying to accomplish?
--max-pods
for KUBELET_EXTRA_ARGS
should have exactly one but not two when MaxPodsPerNode
is assigned.
What happened?
While deprecated MaxPodsPerNode
set
eksctl/pkg/nodebootstrap/assets/scripts/bootstrap.helper.sh
Lines 26 to 27 in c9afc42
# --max-pods as a CLI argument is deprecated, this is a workaround until we deprecate support for maxPodsPerNode | |
[[ -n "${MAX_PODS}" ]] && KUBELET_ARGS+=("--max-pods=${MAX_PODS}") |
it would invoke makeMaxPodsScript
with append()
eksctl/pkg/nodebootstrap/managed_al2.go
Lines 51 to 55 in c9afc42
if ng.OverrideBootstrapCommand != nil { | |
scripts = append(scripts, *ng.OverrideBootstrapCommand) | |
} else if ng.MaxPodsPerNode != 0 { | |
scripts = append(scripts, makeMaxPodsScript(ng.MaxPodsPerNode)) | |
} |
However, the original KUBELET_EXTRA_ARGS
already have --max-pods
flag set, after sed -i
it would have two --max-pods
flags assigned, which is confusing (although the actual result is okay),
eksctl/pkg/nodebootstrap/managed_al2.go
Lines 97 to 103 in c9afc42
func makeMaxPodsScript(maxPods int) string { | |
script := `#!/bin/sh | |
set -ex | |
` | |
script += fmt.Sprintf(`sed -i 's/KUBELET_EXTRA_ARGS=$2/KUBELET_EXTRA_ARGS="$2 --max-pods=%d"/' /etc/eks/bootstrap.sh`, maxPods) | |
return script | |
} |
How to reproduce it?
Create Managed Node Group with MaxPodsPerNode
set.
Logs
Actual result:
[root@ip-192-168-100-200 ~]# cat /etc/systemd/system/kubelet.service.d/30-kubelet-extra-args.conf
[Service]
Environment='KUBELET_EXTRA_ARGS=... --max-pods=58 --max-pods=30' # <------------------- having double --max-pods passed.
Anything else we need to know?
n/a
Versions
$ eksctl info
eksctl version: 0.189.0
kubectl version: v1.31.0
OS: darwin