-
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
add node-name-strategy option #419
Conversation
@@ -69,6 +71,7 @@ type deployerOptions struct { | |||
KubernetesVersion string `flag:"kubernetes-version" desc:"cluster Kubernetes version"` | |||
NodeReadyTimeout time.Duration `flag:"node-ready-timeout" desc:"Time to wait for all nodes to become ready"` | |||
Nodes int `flag:"nodes" desc:"number of nodes to launch in cluster"` | |||
OsDistro string `flag:"os-distro" desc:"Specifies the OS distribution for the AMI. Allowed values: ['al2', 'al2023'] (case-insensitive)"` |
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.
Can we make this option a little more targeted to this specific behavior, something like --node-name-strategy
?
We'll eventually have to add --ami-type
to test with MNG, but that concept doesn't mean anything for an unmanaged nodegroup.
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.
Do you mean we need to decouple the behaviors from the os-distro? Option like naming strategy would allow use cases like AL2 + SessionName and AL2023 + PrivateDNSName. Although we can control it via pipeline, is there any other user will use it in that way?
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.
Option like naming strategy would allow use cases like AL2 + SessionName and AL2023 + PrivateDNSName.
Yeah exactly. When we add support for AL2023 managed node groups, this tool will need an option for --ami-type
, and we will set --node-name-strategy
based on that value; but for unmanaged nodes, the AMI may use bootstrap.sh
, nodeadm
, or something else entirely. I want to avoid making too many assumptions about feature sets here, and just expose the individual options. Our higher level test framework that uses this tool can centralize all the details of which AMI's support which feature, how to test a given AMI, etc.
return fmt.Sprintf(` | ||
- username: system:node:{{%s}} | ||
groups: | ||
- system:bootstrappers | ||
- system:nodes | ||
rolearn: ` | ||
rolearn: `, nodeNameFlavor) | ||
|
||
} |
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.
I think we should use a proper go template for this, since we're filling in 2 values now. Examples in the deployers/eksapi/templates package
kubetest2/internal/util/common.go
Outdated
"strings" | ||
) | ||
|
||
func IsStringInSlice(a string, list []string) bool { |
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.
I think the stdlib has something like this now: https://pkg.go.dev/slices
Issue #, if available:
Description of changes:
Add support for AL2023 self managed node group to have EC2Instance Based Name
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Testing
Tested with AL2 AMI
Tested with self build AL2023 1.28 AMI, along with this change