-
Notifications
You must be signed in to change notification settings - Fork 4k
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
feat: each node pool can now have different init configs #6184
feat: each node pool can now have different init configs #6184
Conversation
|
Welcome @Silvest89! |
Hi @Silvest89 |
To check EasyCLA /easycla |
Alright, just signed it :) |
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.
Looks very nice 💯
Two things I would like to see before approving this:
Backwards compatibility: We do not want to break users of the older options, so please add HCLOUD_CLOUD_INIT
& HCLOUD_IMAGE
back in. If one of the old options as well as a the HCLOUD_CLUSTER_CONFIG
is defined, I think we should use the newer options.
Docs: It would be great if you can provide an example of how this can be used and how they relate to the older options.
Alright I will be on it. Will update the PR later this week. With updated docs as well :) |
1c595a3
to
70f6275
Compare
70f6275
to
aa4ea0e
Compare
@apricote |
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.
Looking good besides one missed error handling and the linting errors from CI :)
https://github.com/kubernetes/autoscaler/actions/runs/6500103013/job/17654801323?pr=6184#step:6:152
if manager.clusterConfig.IsUsingNewFormat { | ||
_, ok := manager.clusterConfig.NodeConfigs[spec.name] | ||
if !ok { | ||
klog.Fatalf("No node config present for node id `%s` error: %v", spec.name, err) |
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.
klog.Fatalf("No node config present for node id `%s` error: %v", spec.name, err) | |
klog.Fatalf("No node config present for node group id `%s` error: %v", spec.name, err) |
if err != nil { | ||
return nil, fmt.Errorf("failed to parse cluster config error: %s", err) | ||
} | ||
json.Unmarshal([]byte(string(clusterConfigEnv)), &clusterConfig) |
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.
clusterConfigEnv
already is a []byte
, so no need to convert to string and back to []byte
. https://pkg.go.dev/encoding/base64#Encoding.DecodeString
json.Unmarshal([]byte(string(clusterConfigEnv)), &clusterConfig) | |
json.Unmarshal(clusterConfigEnv, &clusterConfig) |
Also please add error handling for failed json.Unmarshal()
.
StartAfterCreate := true | ||
opts := hcloud.ServerCreateOpts{ | ||
Name: newNodeName(n), | ||
UserData: n.manager.cloudInit, | ||
UserData: string(cloudInit), |
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.
cloudInit
is already a string
UserData: string(cloudInit), | |
UserData: cloudInit, |
aa4ea0e
to
412d8e1
Compare
@apricote |
412d8e1
to
e1408ed
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: apricote, Silvest89 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Am I seeing correctly that it is not included in the latest version yet? |
yes, @bgervan these changes weren't include in the latest version yet i.e. CA v1.28. This feature will be available in CA v1.29. |
What type of PR is this?
/kind feature
What this PR does / why we need it:
Currently the Hetzner provider is very lacking and the autoscaler does not know beforehand which custom taints/labels the provided node pools have.
This PR adds support for a each nodepool to have their own initconfig (currently breaking change, but will see if I have the time to make it backwards compatible). It also supports multi arch node pools. I have been running this a month or so~ build my own image
Special notes for your reviewer:
Does this PR introduce a user-facing change?