Skip to content

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

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

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

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

guessi opened this issue Aug 22, 2024 · 6 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
Copy link
Contributor

github-actions bot commented Dec 4, 2024

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added stale and removed stale labels Dec 4, 2024
Copy link
Contributor

github-actions bot commented Jan 8, 2025

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added stale and removed stale labels Jan 8, 2025
Copy link
Contributor

github-actions bot commented Feb 9, 2025

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added stale and removed stale labels Feb 9, 2025
Copy link
Contributor

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added stale and removed stale labels Mar 12, 2025
Copy link
Contributor

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added stale and removed stale labels Apr 13, 2025
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