-
Notifications
You must be signed in to change notification settings - Fork 629
✨ Add node auto repair configuration for EKS managed node groups #5604
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
Hi @afarbos. 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. |
[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 |
c29aa17
to
308295b
Compare
} | ||
|
||
// NodeRepairConfig defines the node auto repair configuration for managed node groups. | ||
type NodeRepairConfig struct { |
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 there a chance to extend this struct (adding more fields) ? if not, then adding autoNodeRepair boolean field under spec is better
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.
There is are more fields, see https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/service/[email protected]/types#NodeRepairConfig / https://docs.aws.amazon.com/eks/latest/APIReference/API_NodeRepairConfig.html Do you want me to add support for all?
Note: those did not exist when this PR was created
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.
Fine as a struct, given that more options may be supported in the future. Is enabled
enough as default to get the feature to work nicely? If yes, I think we can live with only the enabled
field for now.
@afarbos rebase is required for the PR |
308295b
to
28ad4be
Compare
rebased |
} | ||
|
||
// NodeRepairConfig defines the node auto repair configuration for managed node groups. | ||
type NodeRepairConfig struct { |
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.
Fine as a struct, given that more options may be supported in the future. Is enabled
enough as default to get the feature to work nicely? If yes, I think we can live with only the enabled
field for now.
// NodegroupRepairConfigToSDK is used to convert a CAPA NodeRepairConfig to AWS SDK NodeRepairConfig. | ||
func NodegroupRepairConfigToSDK(repairConfig *expinfrav1.NodeRepairConfig) *ekstypes.NodeRepairConfig { |
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.
// NodegroupRepairConfigToSDK is used to convert a CAPA NodeRepairConfig to AWS SDK NodeRepairConfig. | |
func NodegroupRepairConfigToSDK(repairConfig *expinfrav1.NodeRepairConfig) *ekstypes.NodeRepairConfig { | |
// NodeRepairConfigToSDK is used to convert a CAPA NodeRepairConfig to AWS SDK NodeRepairConfig. | |
func NodeRepairConfigToSDK(repairConfig *expinfrav1.NodeRepairConfig) *ekstypes.NodeRepairConfig { |
expinfrav1 "sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2" | ||
) | ||
|
||
func TestNodegroupRepairConfigToSDK(t *testing.T) { |
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.
func TestNodegroupRepairConfigToSDK(t *testing.T) { | |
func TestNodeRepairConfigToSDK(t *testing.T) { |
return | ||
} | ||
if result == nil || tt.expected == nil { | ||
t.Errorf("NodegroupRepairConfigToSDK() = %v, want %v", result, tt.expected) |
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.
t.Errorf("NodegroupRepairConfigToSDK() = %v, want %v", result, tt.expected) | |
t.Errorf("NodeRepairConfigToSDK() = %v, want %v", result, tt.expected) |
[repeated]
if result == nil && tt.expected == nil { | ||
return | ||
} | ||
if result == nil || tt.expected == nil { |
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.
if result == nil && tt.expected == nil { | |
return | |
} | |
if result == nil || tt.expected == nil { | |
if result == nil { |
...as the function shouldn't return nil
t.Errorf("NodegroupRepairConfigToSDK() = %v, want %v", result, tt.expected) | ||
return | ||
} | ||
if *result.Enabled != *tt.expected.Enabled { |
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 instead use reflect.DeepEqual
or something else that diffs the whole struct at once? That will be easier once new fields become supported in CAPA.
What type of PR is this?
/kind feature
What this PR does / why we need it:
This PR adds support for node auto repair configuration in EKS managed node groups. Node auto repair is a feature that allows EKS to automatically repair unhealthy nodes by replacing them, helping maintain cluster health and availability.
https://aws.amazon.com/about-aws/whats-new/2024/12/node-health-monitoring-auto-repair-amazon-eks/
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #
Special notes for your reviewer:
NodeRepairConfig
field toAWSManagedMachinePoolSpec
with anenabled
boolean fieldNodegroupRepairConfigToSDK
andNodegroupRepairConfigFromSDK
functionsChecklist:
Release note: