Skip to content

feat: unify bootstrap resources into K0sConfig#1394

Draft
apedriza wants to merge 1 commit intok0sproject:v1beta2-api-versionfrom
apedriza:unify-config-resource
Draft

feat: unify bootstrap resources into K0sConfig#1394
apedriza wants to merge 1 commit intok0sproject:v1beta2-api-versionfrom
apedriza:unify-config-resource

Conversation

@apedriza
Copy link
Copy Markdown
Contributor

@apedriza apedriza commented Mar 11, 2026

Changes

  • Remove in v1beta2 usage of K0sControllerConfig and K0sWorkerConfig and unify them into K0sConfig. This makes things easier in terms of UX. Now, the user will use the same resource type to declare controller or worker configs, no extra fields needed for it.
  • Rename field k0s where the user defines the k0s configuration file to clusterConfig, this way is more verbose the value of the field. For example, K0sControllerConfig.spec.k0s -> K0sConfig.spec.clusterconfig
  • Removed conversion. Since there is no new version of the existing resources, but replacing them, the "conversion" for backward compatibility is done in the controller by mimicking the resources in the controller logic

Fix

  • Add conversion webhook in K0sControlplaneTemplate CRD

@apedriza apedriza changed the title unify bootstrap resources WIP: unify bootstrap resources Mar 11, 2026
@apedriza apedriza force-pushed the unify-config-resource branch 23 times, most recently from 06b2f09 to ab89a3e Compare March 17, 2026 11:47
Signed-off-by: apedriza <adripedriza@gmail.com>
@apedriza apedriza force-pushed the unify-config-resource branch from ab89a3e to 8d7452a Compare March 17, 2026 14:53
@apedriza apedriza changed the title WIP: unify bootstrap resources feat: unify bootstrap resources into K0sConfig Mar 17, 2026
@apedriza apedriza marked this pull request as ready for review March 17, 2026 15:55
@apedriza apedriza requested a review from a team as a code owner March 17, 2026 15:55
@makhov
Copy link
Copy Markdown
Contributor

makhov commented Mar 18, 2026

As I said before, it's not that easy.

clusterConfig and tunneling fields are only meaningful for controller nodes. Also args means k0s controller flags in one context and k0s worker flags in another.

And we already have K0sConfigSpec which supposed to keep common fields from both objects, we just don't use it in K0sWorkerConfig for some reason.

Also, I'm not sure that creating v1beta1 shadow objects is a good idea in general. Sounds fragile.

@apedriza apedriza marked this pull request as draft March 18, 2026 10:07
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.

2 participants