Skip to content

Conversation

@dkoshkin
Copy link
Contributor

@dkoshkin dkoshkin commented Sep 12, 2025

What problem does this PR solve?:
After EKS types were introduced, the fields in GenericClusterConfigSpec and GenericNodeSpec are no longer all "generic" because some do not apply to EKS clusters, as it does not use kubeadm to create the cluster.

This PR attempts to address this by only keeping the fields that can be set for both EKS and all other infra types in GenericClusterConfigSpec and moves the rest of the fields to KubeadmClusterConfigSpec, and similarly for GenericNodeSpec.

Because the structs are included inline in the individual Cluster types this does not change the external yaml API, only how they are referenced in Go (notice how the CRDs for <aws|docker|nutanix>clusterconfigs did not change).

Which issue(s) this PR fixes:
Fixes #

How Has This Been Tested?:

Unit tests.

Special notes for your reviewer:

If we agree with this approach I will have separate refactor PRs to reorganize the handlers and the public docs.

@dkoshkin dkoshkin force-pushed the dkoshkin/refactor-GenericClusterConfigSpec branch from 2374cf8 to 5a6ccd8 Compare September 13, 2025 00:02
@dkoshkin dkoshkin changed the title refactor: keep only common types in GenericClusterConfigSpec refactor: keep only common types in Generic config specs Sep 13, 2025
@dkoshkin dkoshkin requested a review from yanhua121 September 15, 2025 17:04
Copy link
Member

@jimmidyson jimmidyson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks!

@dkoshkin dkoshkin enabled auto-merge (squash) September 16, 2025 16:18
@dkoshkin dkoshkin merged commit 39e345f into main Sep 16, 2025
37 of 38 checks passed
@dkoshkin dkoshkin deleted the dkoshkin/refactor-GenericClusterConfigSpec branch September 16, 2025 17:40
@faiq
Copy link
Contributor

faiq commented Sep 16, 2025

nice work!

dkoshkin added a commit that referenced this pull request Sep 16, 2025
**What problem does this PR solve?**:
Stacked on
#1297

This fixes the generic handlers for EKS clusters by properly exposing
the `GenericClusterConfigSpec` API in `EKSClusterConfig`.

The following fields are still aspirational and are not properly
supported in the handlers for EKS, but they can be.
```
	// +kubebuilder:validation:Optional
	Proxy *HTTPProxy `json:"proxy,omitempty"`

	// +kubebuilder:validation:Optional
	// +kubebuilder:validation:MaxItems=32
	ImageRegistries []ImageRegistry `json:"imageRegistries,omitempty"`

	// +kubebuilder:validation:Optional
	GlobalImageRegistryMirror *GlobalImageRegistryMirror `json:"globalImageRegistryMirror,omitempty"`
```

But these are working and I've added broken tests to verify before
fixing the API.
```
	// +kubebuilder:validation:Optional
	// +kubebuilder:validation:MaxItems=32
	Users []User `json:"users,omitempty"`

	// NTP defines the NTP configuration for the cluster.
	// +kubebuilder:validation:Optional
	NTP *NTP `json:"ntp,omitempty"`
```

**Which issue(s) this PR fixes**:
Fixes #

**How Has This Been Tested?**:
<!--
Please describe the tests that you ran to verify your changes.
Provide output from the tests and any manual steps needed to replicate
the tests.
-->

**Special notes for your reviewer**:
<!--
Use this to provide any additional information to the reviewers.
This may include:
- Best way to review the PR.
- Where the author wants the most review attention on.
- etc.
-->
dkoshkin added a commit that referenced this pull request Oct 6, 2025
**What problem does this PR solve?**:
Moving the handlers and docs around to make it clear when adding new
providers and new handlers if they apply to all providers or only those
that use kubeadm too bootstrap the Nodes.

This better aligns with the changes in
#1297

**Which issue(s) this PR fixes**:
Fixes #

**How Has This Been Tested?**:
<!--
Please describe the tests that you ran to verify your changes.
Provide output from the tests and any manual steps needed to replicate
the tests.
-->

**Special notes for your reviewer**:
<!--
Use this to provide any additional information to the reviewers.
This may include:
- Best way to review the PR.
- Where the author wants the most review attention on.
- etc.
-->
vijayaraghavanr31 pushed a commit that referenced this pull request Oct 8, 2025
**What problem does this PR solve?**:
Moving the handlers and docs around to make it clear when adding new
providers and new handlers if they apply to all providers or only those
that use kubeadm too bootstrap the Nodes.

This better aligns with the changes in
#1297

**Which issue(s) this PR fixes**:
Fixes #

**How Has This Been Tested?**:
<!--
Please describe the tests that you ran to verify your changes.
Provide output from the tests and any manual steps needed to replicate
the tests.
-->

**Special notes for your reviewer**:
<!--
Use this to provide any additional information to the reviewers.
This may include:
- Best way to review the PR.
- Where the author wants the most review attention on.
- etc.
-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants