Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Duplicate --max-pods attribute passed to KUBELET_EXTRA_ARGS #7946

Open
guessi opened this issue Aug 22, 2024 · 0 comments
Open

[Bug] Duplicate --max-pods attribute passed to KUBELET_EXTRA_ARGS #7946

guessi opened this issue Aug 22, 2024 · 0 comments
Labels

Comments

@guessi
Copy link
Contributor

guessi commented Aug 22, 2024

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?

When MaxPodsPerNode is assigned, it would invoke makeMaxPodsScript with append()

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),

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant