-
Notifications
You must be signed in to change notification settings - Fork 627
✨ Add ability to control "EKS Auto Mode" for EKS clusters #5642
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
base: main
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Welcome @CharlieR-o-o-t! |
Hi @CharlieR-o-o-t. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
/ok-to-test |
/retest-required |
/retest-required |
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.
Thank you @CharlieR-o-o-t for working on this, I added some initial thoughts.
// EKSAutoMode indicates the EKS Auto Mode state for control-plane. | ||
// If you set this value to false, the following params will be disabled for EKS: | ||
// AWS::EKS::Cluster KubernetesNetworkConfig ElasticLoadBalancing Enabled -> false. | ||
// AWS::EKS::Cluster StorageConfig blockStorage Enabled -> false. | ||
// AWS::EKS::Cluster ComputeConfig Enabled -> false. | ||
// +kubebuilder:default=true | ||
EKSAutoMode *bool `json:"eksAutoMode"` |
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 name the field autoMode
instead of eksAutoMode
?
Also, IMO, this should not default to true and field should be optional as upstream EKS service does not default to AutoMode.
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.
yes, my bad. For some reason though it's default feature.
pkg/cloud/services/eks/cluster.go
Outdated
} else { | ||
netConfig.ElasticLoadBalancing = &ekstypes.ElasticLoadBalancing{Enabled: aws.Bool(false)} | ||
} |
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 don't need this else as the field should be unset if autoMode is disabled.
pkg/cloud/services/eks/cluster.go
Outdated
ComputeConfig: &ekstypes.ComputeConfigRequest{Enabled: aws.Bool(false)}, | ||
StorageConfig: &ekstypes.StorageConfigRequest{BlockStorage: &ekstypes.BlockStorage{Enabled: aws.Bool(false)}}, |
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.
Let's keep the ComputeConfig
and StorageConfig
unset when autoMode disabled.
pkg/cloud/services/eks/cluster.go
Outdated
if s.scope.EKSAutoMode() { | ||
input.ComputeConfig = &ekstypes.ComputeConfigRequest{Enabled: aws.Bool(true)} | ||
input.StorageConfig = &ekstypes.StorageConfigRequest{BlockStorage: &ekstypes.BlockStorage{Enabled: aws.Bool(true)}} |
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.
The computeConfig
has nodepools
and if this is provided, it should also have nodeRoleArn
. This is crucial if user wants to use default nodepools (general-purpose and system). When this is not specified, the user will need to create own nodepools.
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.
good point, will handle nodepools/nodeRoleArn + validation
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.
+1, Let's keep this PR focused on AutoMode.
// Set default value for AutoMode | ||
if r.Spec.AutoMode == nil { | ||
r.Spec.AutoMode = aws.Bool(false) | ||
} |
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.
shouldn't the default be true considering this was always on by default in previous versions? a change like this could be breaking for users
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.
agree, have changed that.
Thanks for review, will add new version soon. |
/retest-required |
f7906fd
to
8b952fe
Compare
/retest-required |
1 similar comment
/retest-required |
6ac1f29
to
d052fc9
Compare
Signed-off-by: Siarhei Rasiukevich <[email protected]>
@CharlieR-o-o-t: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
@punkwalker , hello, I’m unsure how we should handle the breaking change reported here: https://prow.k8s.io/view/gs/kubernetes-ci-logs/pr-logs/pull/kubernetes-sigs_cluster-api-provider-aws/5642/pull-cluster-api-provider-aws-apidiff-main/1965129880395845632
cluster-api-provider-aws/controlplane/eks/api/v1beta2/awsmanagedcontrolplane_webhook.go Line 575 in 60649f3
Also I have added new field to struct Thank you for your review, I appreciate it. |
accessConfig: | ||
description: |- | ||
AccessConfig specifies the EKS cluster access configuration. | ||
It defines the authentication mode and whether to bootstrap the cluster creator | ||
as a cluster-admin. | ||
properties: | ||
authenticationMode: | ||
description: |- | ||
AuthenticationMode mode controls how Kubernetes API authentication is performed: | ||
- CONFIG_MAP — uses only the aws-auth ConfigMap (legacy mode). | ||
- API — uses only EKS Access Entries (aws-auth is ignored). | ||
- API_AND_CONFIG_MAP — enables both Access Entries and aws-auth. | ||
type: string | ||
bootstrapAdminPermissions: | ||
description: |- |
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.
Is it possible to rebase your changes off https://github.com/kubernetes-sigs/cluster-api-provider-aws/pull/5578/files -- we're implementing the same changes there.
Rebasing your changes off that would make the PR much smaller and less work down the line -- considering that has a lot of reviews already
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.
sure, will do
|
||
// Compute allows to run compute capability with EKS AutoMode. | ||
type Compute struct { | ||
NodePools []string `json:"nodePools,omitempty"` |
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.
needs a comment describing the field.
@CharlieR-o-o-t |
Yeah we should probably change this back to We will probably change all option |
thank you, will change back to "bool". |
What type of PR is this?
/kind feature
/kind api-change
What this PR does / why we need it
This PR introduces support for controlling EKS Auto Mode for EKS clusters managed with AWSManagedControlPlane CRD.
Previously, the EKSAutoMode was always enabled by default, for someone it's not needed.
With this change, users can explicitly set the spec.eksAutoMode field in the AWSManagedControlPlane resource to true or false based on their needs.
Special notes for your reviewer:
Includes extra fix:
AWSManagedControlPlane.spec.bootstrapSelfManagedAddons was always defaulted to true by webhook.
Checklist:
Release note: