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

Environment variables is not be set with overrideBootstrapCommand on non managed nodegroup #4055

Closed
cw-sakamoto opened this issue Aug 6, 2021 · 3 comments
Labels
kind/help Request for help

Comments

@cw-sakamoto
Copy link
Contributor

What help do you need?

If I use overrideBootstrapCommand on non managed nodegroup, /etc/eksctl/kubelet.env and so on are not generated and it seems difficult to set environment variables, is this a specification?

At point https://github.com/weaveworks/eksctl/blob/main/pkg/nodebootstrap/userdata.go#L118-L133, if overrideBootstrapCommand is specified, some of the processing is skipped.

I want to change only bootstrap.al2.sh with overrideBootstrapCommand to change kubelet container runtime to containerd. In this case, I cannot set the necessary environment variables(MAX_PODS,NODE_TAINTS, etc), making it difficult to start.

eksctl version: 0.59.0
eks: 1.21

@cw-sakamoto cw-sakamoto added the kind/help Request for help label Aug 6, 2021
@Callisto13
Copy link
Contributor

Callisto13 commented Aug 6, 2021

Hi @cw-sakamoto thanks for asking.

The purpose of overrideBootstrapCommand is to completely cancel any bootstrapping set up by eksctl in order to handle the entire thing yourself. This includes any environment variables. We don't have a concept of "partially override the bootstrap".

Having said that, I could see the value in setting up the vars file anyway so that those values are available to the user if they wish to use them. I will bring it up with the team 👍 .

I want to change only bootstrap.al2.sh with overrideBootstrapCommand

You will not be able to change that script, as it will not have been loaded onto the AMI with userdata. When you use overrideBootstrapCommand you have to call /etc/eks/bootstrap.sh directly. Eg. Basically whatever script you set in overrideBootstrapCommand becomes bootstrap.al2.sh: this is the intended purpose of the option.

I cannot set the necessary environment variables

You should be able to set anything you want in your overrideBootstrapCommand, eg:

  overrideBootstrapCommand: |
    #!/bin/bash
    export FOO=etc # set some env vars
    # edit some files maybe etc
    /etc/eks/bootstrap.sh <cluster-name> --kubelet-extra-args '--node-labels=etc --register-with-taints=etc' $FOO --container-runtime containerd

If you really want to edit bootstrap.al2.sh, you can use a preBootstrapCommand to sed the file to have the container runtime flag. This will leave all eksctl's bootstrapping in place, and simply update the file as you wish.

Lastly, we are about to merge #4051, so in the next release there will be a config option in eksctl to set containerd easily.

@cw-sakamoto
Copy link
Contributor Author

@Callisto13 Thanks for your reply.

Having said that, I could see the value in setting up the vars file anyway so that those values are available to the user if they wish to use them. I will bring it up with the team

Thank you! 😃

I am very excited about this pull request(#4051).
I commented #4051 (comment)

@Callisto13
Copy link
Contributor

Cool 😎 . We release every Friday, so that PR might not make it in today, in which case it will be out in 0.62.0-rc.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/help Request for help
Projects
None yet
Development

No branches or pull requests

2 participants