-
Notifications
You must be signed in to change notification settings - Fork 82
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
Fix ManagedNodeGroup taints being wrongly set in userdata #1441
Conversation
Does the PR have any schema changes?Looking good! No breaking changes found. |
18fbcaa
to
d0e7a0d
Compare
@@ -449,7 +454,8 @@ function createBottlerocketUserData( | |||
if (args.taints) { | |||
const taints = {}; | |||
const records = Object.entries(args.taints).map(([key, taint]) => { | |||
return { [key]: `${taint.value}:${taint.effect}` }; | |||
// empty taint values are represented as an empty string, see https://github.com/bottlerocket-os/bottlerocket/pull/1406 | |||
return { [key]: `${taint.value ?? ""}:${taint.effect}` }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch!
coredns = eks.Addon( | ||
f"{project_name}-cluster3-coredns", | ||
cluster=cluster3, | ||
addon_name="coredns", | ||
addon_version="v1.11.1-eksbuild.9", | ||
addon_version=coredns_version.version, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated fix looks like.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But great! I was fixing this again as port of ops, your solution is more robust.
The taints for the `ManagedNodeGroup` component were being wrongly calculated when using custom userdata. That was the case because the EKS service uses different capitalization for the taint effect enum than the kubernetes API(e.g. `NO_SCHEDULE` vs `NoSchedule`). When building the custom userdata we need to map the EKS style enums to kubernetes style enums, otherwise it doesn't work. Fixing this also revealed that taint values being absent aren't correctly handled either. The change fixes that as well.
This PR has been shipped in release v3.0.0-beta.2. |
The taints for the `ManagedNodeGroup` component were being wrongly calculated when using custom userdata. That was the case because the EKS service uses different capitalization for the taint effect enum than the kubernetes API(e.g. `NO_SCHEDULE` vs `NoSchedule`). When building the custom userdata we need to map the EKS style enums to kubernetes style enums, otherwise it doesn't work. Fixing this also revealed that taint values being absent aren't correctly handled either. The change fixes that as well.
The taints for the
ManagedNodeGroup
component were being wrongly calculated when using custom userdata.That was the case because the EKS service uses different capitalization for the taint effect enum than the kubernetes API(e.g.
NO_SCHEDULE
vsNoSchedule
).When building the custom userdata we need to map the EKS style enums to kubernetes style enums, otherwise it doesn't work.
Fixing this also revealed that taint values being absent aren't correctly handled either. The change fixes that as well.
While this was found during the v3 beta testing (see), it's a bug on v2 as well. The bug fix is targeting v3 anyways because the node group and user data logic was heavily rewritten during the development of v3. Back porting that to v2 would be too big of an effort given that v3 is right around the corner.