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

Support kubeletExtraConfig in managed node groups #4459

Closed
janeklb opened this issue Nov 15, 2021 · 12 comments
Closed

Support kubeletExtraConfig in managed node groups #4459

janeklb opened this issue Nov 15, 2021 · 12 comments
Assignees
Labels
area/managed-nodegroup EKS Managed Nodegroups blocked/aws kind/feature New feature or request priority/backlog Not staffed at the moment. Help wanted.

Comments

@janeklb
Copy link

janeklb commented Nov 15, 2021

What feature/behaviour/change do you want?

Support kubeletExtraConfig in managed node groups

Why do you want this feature?

In order to specify extra kubelet configuration features, you need to use overrideBootstrap and use --kubelet-extra-args etc. This is rather cumbersome and so it would be preferable to use something like node groups' kubeletExtraConfig field for managed node groups.

Summary

  • We want to improve the UX by unifying the behaviour for both managed and unmanaged nodegroup as suggested here
    "I guess we could make something like, if it's defined, we set override, and pass in the necessary config. That could work, and would bring together the way we handle extra configure in eksctl with nodegroups."
  • MNGs have override settings that allow us to pass through, so we need to parse the config and set these overrides
  • We also need to do some work around the bootstrapping script so we allow these overrides passed to the kubelet
  • First Spike this to understand how much work involved so we can make a decision to go for this feature
  • Timebox : 1-2 days
@janeklb janeklb added the kind/feature New feature or request label Nov 15, 2021
@cPu1 cPu1 added the area/managed-nodegroup EKS Managed Nodegroups label Nov 16, 2021
@aclevername
Copy link
Contributor

Thanks for opening the issue @janeklb. For future folks who didn't realise we already have this for unmanaged nodegroups atm 😅 https://eksctl.io/usage/schema/#nodeGroups-kubeletExtraConfig. The feature sounds reasonable to me 👍

@github-actions
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 the stale label Dec 17, 2021
@Skarlso
Copy link
Contributor

Skarlso commented Dec 17, 2021

We have this in our doc:

- Full control over the node bootstrapping process and customization of the kubelet are not supported. This includes the
following fields: `classicLoadBalancerNames`, `targetGroupARNs`, `clusterDNS` and `kubeletExtraConfig`.

I think there is a reason for that because managed nodegroups don't allow for this to be passed in?

@Skarlso
Copy link
Contributor

Skarlso commented Dec 17, 2021

I guess we could make something like, if it's defined, we set override, and pass in the necessary config. That could work, and would bring together the way we handle extra configure in eksctl with nodegroups.

@Skarlso Skarlso added priority/important-longterm Important over the long term, but may not be currently staffed and/or may require multiple releases and removed stale labels Dec 17, 2021
@janeklb
Copy link
Author

janeklb commented Dec 23, 2021

I guess we could make something like, if it's defined, we set override, and pass in the necessary config. That could work, and would bring together the way we handle extra configure in eksctl with nodegroups.

That would make kubelet config management (for managed node groups) a lot easier!

@Skarlso Skarlso self-assigned this Feb 25, 2022
@Skarlso
Copy link
Contributor

Skarlso commented Feb 28, 2022

The only that will be required however, is that a custom AMI is set. I can't do anything unless that is done, because only then will the Managed Nodegroups not merge all the user data. @janeklb

@Skarlso
Copy link
Contributor

Skarlso commented Feb 28, 2022

Okay, so after rummaging in the code, the following will be done:

  • if kubeletExtraConfig is provided together with ami, we automatically attach the following ovveride script:
    overrideBootstrapCommand: |
      #!/bin/bash
      /etc/eks/bootstrap.sh my-cluster-name \
        --kubelet-extra-args <parsedargshere> \
  • if kubeletExtraConfig is provided together with ami AND overrideBootstrapCommand kubeletExtraConfig will be ignored. If you are already providing overrideBootstrapCommand might as well add kubelet-extra-args. :)
  • if kubeletExtraConfig is provided without ami we will error. That's invalid as per my previous comment

@Skarlso
Copy link
Contributor

Skarlso commented Mar 1, 2022

So... I can't make this work without awslabs/amazon-eks-ami#873 being a thing in the bootstrap.sh of a managed nodegroup. Without that, anything I would do with the extra config is just overwritten. I tried doing something like this:

#!/bin/sh
set -ex
KUBELET_CONFIG=/etc/kubernetes/kubelet/kubelet-config.json

TMP_KUBE_CONF='/tmp/kubelet-conf-temp.json'
KUBELET_CONFIG_EXTRA='/tmp/kubelet-conf-extra.json'
echo '%s' > ${KUBELET_CONFIG_EXTRA}

echo "eksctl: merging user options into kubelet-config.json"
trap 'rm -f ${TMP_KUBE_CONF} ${KUBELET_CONFIG_EXTRA}' EXIT
jq -s '.[0] + .[1]' "${KUBELET_CONFIG}" "${KUBELET_CONFIG_EXTRA}" > "${TMP_KUBE_CONF}"
mv "${TMP_KUBE_CONF}" "${KUBELET_CONFIG}"
/etc/eks/bootstrap.sh %s

As a userdata script. Which works very well actually. Where %s is the passed in kube config. It does merge the two configs. But... when you call bootstrap at the end, they configure a few things automatically and overwrite some values in the configuration file which makes this thing obsolete.

I could have parsed the config flag and then translate each and every json value to a --flag option and pass that in, but that's simply just not feasible in the long run. eksctl would have to constantly keep this translation list up to date with values and kubelet flags as they change and evolve which leads to more headache then we care to take on.

If AWS deems this a nice feature to have, we can come back to this issue. Until then, sadly, this is blocked.

@Skarlso
Copy link
Contributor

Skarlso commented Mar 2, 2022

FWIW I submitted the necessary modification to the bootstrap script as a PR here.

@Himangini Himangini added priority/backlog Not staffed at the moment. Help wanted. and removed priority/important-longterm Important over the long term, but may not be currently staffed and/or may require multiple releases labels Sep 28, 2022
@github-actions
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 the stale label Oct 29, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Nov 3, 2022

This issue was closed because it has been stalled for 5 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 3, 2022
@TiberiuGC TiberiuGC reopened this Nov 3, 2022
@github-actions github-actions bot removed the stale label Nov 4, 2022
@MartinEmrich
Copy link

Yep, we also could use kubeletExtraConfigs for managed nodegroups, to work around aws/containers-roadmap#1847

@Himangini Himangini closed this as not planned Won't fix, can't repro, duplicate, stale Nov 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/managed-nodegroup EKS Managed Nodegroups blocked/aws kind/feature New feature or request priority/backlog Not staffed at the moment. Help wanted.
Projects
None yet
Development

No branches or pull requests

7 participants