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

Implement --containerd-extra-config-toml in bootstrap.sh #790

Closed
wants to merge 1 commit into from

Conversation

codablock
Copy link

This flag allows to pass extra configuration for containerd, which is
appended to /etc/containerd/config.toml. This allows to specify things
like mirros/pull-through-caches without interfering with the EKS provided
config.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

codablock added a commit to codablock/cluster-api-provider-aws that referenced this pull request Oct 20, 2021
@vavdoshka
Copy link

yes please I need it as well

@anusha-ragunathan
Copy link

anusha-ragunathan commented Jan 26, 2022

Thanks for taking care of this.

Comment on lines +471 to +483
if [[ -n "$CONTAINERD_EXTRA_CONFIG_TOML" ]]; then
echo "$CONTAINERD_EXTRA_CONFIG_TOML" >> /etc/eks/containerd/containerd-config.toml
fi

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This block should be moved above L470, so that we have the ability to specify SANDBOX image in custom containerd config and get is replaced by the right pause container in the bootstrap.sh script.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, I'm going to change this and force-push.

Copy link
Member

@suket22 suket22 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, my apologies it's taken us this long to get to this PR. Would you be open to us collaborating with you on this? I can help push changes to your fork if you're okay with it or take this over on a separate PR.

@cartermckinnon could you take a look at this PR too?

@@ -461,7 +468,10 @@ fi
if [[ "$CONTAINER_RUNTIME" = "containerd" ]]; then
sudo mkdir -p /etc/containerd
sudo mkdir -p /etc/cni/net.d
sudo sed -i s,SANDBOX_IMAGE,$PAUSE_CONTAINER,g /etc/eks/containerd/containerd-config.toml
if [[ -n "$CONTAINERD_EXTRA_CONFIG_TOML" ]]; then
echo "$CONTAINERD_EXTRA_CONFIG_TOML" >> /etc/eks/containerd/containerd-config.toml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we make this echo "$CONTAINERD_EXTRA_CONFIG_TOML" > /etc/eks/containerd/containerd-config.toml to support the use case also described in #830 where an append may not be sufficient?

@@ -75,6 +76,11 @@ while [[ $# -gt 0 ]]; do
shift
shift
;;
--containerd-extra-config-toml)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we change this to be a pointer to a file rather than the entire toml content itself?
I know with --docker-config-json we've already gone the latter route, but using a file pointer instead has a nice advantage when using MIME multiparts for the userData. In an earlier MIME part we can write the entire config to disk at a specific location, and the subsequent part that calls this bootstrap script (like Managed Nodegroups / Karpenter) can hardcode that file name.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer it as you described it, but decided to stick with the way --docker-config-json is implemented to avoid unexpected surprises. If enough EKS folks tell me that the file-pointer way is the preferred one, I'll go with it.

This flag allows to pass extra configuration for containerd, which is
appended to /etc/containerd/config.toml. This allows to specify things
like mirros/pull-through-caches without interfering with the EKS provided
config.
@codablock
Copy link
Author

@suket22 Thanks for looking into the PR. I would prefer if you take over with this PR, in whatever fashion (new PR or pushing to my branch) you prefer. Right now, I'd have to work on it without any ability to test out the changes, which might end up being much less effective than when you directly take over.

@suket22
Copy link
Member

suket22 commented May 25, 2022

Sounds good, thanks @codablock. I'll get on it and should have a PR soon.

@bryantbiggs
Copy link
Contributor

@suket22 / @codablock - is it possible to make whatever solution comes out of this PR compatible with managed node groups? Right now, with the way managed node groups inject the bootstrap script at the base of the user data file, users do not have access to all of the bootstrap script flags which leads to hacky workarounds. I know it might be beyond the scope of what you were envisioning, but I think if there is a path to cater to both self-managed and EKS managed node groups, that would be amazing. Something to consider, thank you!

@suket22
Copy link
Member

suket22 commented May 26, 2022

Alright we've got this merged as part of #929 and this should be make it as part of our next AMI release.

@suket22 suket22 closed this May 26, 2022
@codablock codablock deleted the extra-containerd-config branch May 26, 2022 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants