Skip to content

Conversation

@apedriza
Copy link
Contributor

@apedriza apedriza commented Sep 9, 2025

fix #1179

Changes

  • Three ways to install k0smotron:

    • only standalone mode. The Install manifest only includes resources related to standalone mode.
    • full installation. All in one manifest (as it is now)
    • per CAPI provider. *-components.yaml only includes resources related to it. Some RBAC roles have been added for each provider because the "bug" was masked when including all providers' RBACs per *-components.yaml
  • Now that standalone mode can be installed only using required manifests, if CAPI core or other CAPI providers were installed before installing standalone, the k0smotron manager failed because it detects there are CAPI resources + k0smotron CAPI CRDs were not installed with the new standalone manifest. Added a new flag to enable only the standalone controller to have more control over which controller needs to be set up.

@apedriza apedriza force-pushed the refactor-k0smotron-config branch 27 times, most recently from 89f5368 to e4cc56a Compare September 12, 2025 07:55
Comment on lines -189 to -204
install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config.
$(KUSTOMIZE) build config/crd | kubectl create -f -

.PHONY: uninstall
uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
$(KUSTOMIZE) build config/crd | kubectl delete --ignore-not-found=$(ignore-not-found) -f -
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I dont think this is really used since we need to tweak the dev environment to not deploy the webhook locally. I will take a general look to improve devx soon.

@apedriza apedriza force-pushed the refactor-k0smotron-config branch from e4cc56a to 050f7df Compare September 12, 2025 09:21
os.Exit(1)
}
}
} else if isControllerEnabled(standaloneController) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

new flag value --enable-controller=standalone allows us to run only controllers for standalone mode. If not, combining cluster-api core controller + standalone k0smotron is not possible (weird combination but someone might run CAPI without k0smotron provider and k0smotron in standalone mode)

@apedriza apedriza force-pushed the refactor-k0smotron-config branch from fac787b to eb5134d Compare September 30, 2025 16:07
@apedriza apedriza marked this pull request as draft October 1, 2025 09:42
@apedriza apedriza force-pushed the refactor-k0smotron-config branch 12 times, most recently from 0363d1c to 053ed25 Compare October 2, 2025 11:16
@apedriza apedriza marked this pull request as ready for review October 2, 2025 11:58
@apedriza apedriza force-pushed the refactor-k0smotron-config branch from 053ed25 to f3edb47 Compare October 7, 2025 13:18
@apedriza apedriza requested a review from makhov October 8, 2025 07:57
@apedriza apedriza force-pushed the refactor-k0smotron-config branch 2 times, most recently from f248de0 to 9a4d0b5 Compare October 16, 2025 08:15
@apedriza
Copy link
Contributor Author

@makhov this is ready for another round 😁

@apedriza apedriza force-pushed the refactor-k0smotron-config branch 2 times, most recently from 9b7096f to adf2403 Compare November 3, 2025 08:48
args:
- "--health-probe-bind-address=:8081"
- "--metrics-bind-address=127.0.0.1:8080"
- "--leader-elect"
Copy link
Contributor

Choose a reason for hiding this comment

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

The current state of the patch file is:

        - "--health-probe-bind-address=:8081"
        - "--diagnostics-address=127.0.0.1:8080"
        - "--leader-elect"
        - "--enable-controller=bootstrap"
        - --feature-gates=${K0SMOTRON_FEATURE_GATES:=""}

And why we switching from patches to full files for controllers?

Copy link
Contributor Author

@apedriza apedriza Nov 4, 2025

Choose a reason for hiding this comment

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

this is the same what we currently use for the make *-component.yaml targets where we use the manager declaration (by the way I removed manager config duplication and use the same for all in the last changes) and then when we call kustomize build where we use the patch file in every component with the proper enable-controller value

args:
- "--health-probe-bind-address=:8081"
- "--metrics-bind-address=127.0.0.1:8080"
- "--leader-elect"
Copy link
Contributor

Choose a reason for hiding this comment

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

this again will start full set of controllers, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

every component has the proper patch file for the manager setting the expected enable-controller flag

@apedriza apedriza force-pushed the refactor-k0smotron-config branch from adf2403 to 5d176c6 Compare November 4, 2025 10:33
@apedriza apedriza force-pushed the refactor-k0smotron-config branch 4 times, most recently from 526ba85 to 28384b5 Compare December 4, 2025 10:24
@apedriza apedriza force-pushed the refactor-k0smotron-config branch from 28384b5 to 6a686f6 Compare December 4, 2025 11:38
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.

refactor config structure for more flexibility in k0smotron installation

2 participants