kubermatic / operating-system-manager

Operating System Manager is responsible for creating and managing the configuration that are needed to configure worker nodes
Apache License 2.0
35 stars 30 forks source link

update to controller-runtime 0.18.3 #380

Closed xrstf closed 3 months ago

xrstf commented 4 months ago

What this PR does / why we need it: This bumps controller-runtime to 0.18 and takes the opportunity to clean up the OSP bootstrapping.

Previously, the default OSPs were reconciled once on OSM startup by watching Deployment creation in the kube-system namespace in the worker cluster.

The new code uses a channel to trigger the initial reconciliation in empty clusters. The original OSP controller would revert any OSP updates back to the version compiled into OSM, but only when a) OSM is restarted or b) a Deployment is created. So the controller is in fact reconciling like most other controllers and so is now also simply watching OSPs to reconcile unwanted changes immediately.

The reconciler also removes the ResourceVersion/Generation setting by simply not overwriting the entire OSP object (including metadata), but only overwriting its Spec when reconciling.

I also removed the duplicated OSP map (the default OSPs were both embedded and kept as a duplicate in defaultOSPFiles) and instead parse the OSPs once upon startup and keep those objects around. The controller will now in general reconcile a little bit more than before, so not having to re-parse the YAML everytime should compensate for the additional reconcilings.

What type of PR is this? /kind cleanup /kind chore

Does this PR introduce a user-facing change? Then add your Release Note here:

Update controller-runtime to 0.18.3

Documentation:

NONE
kubermatic-bot commented 4 months ago

Skipping CI for Draft Pull Request. If you want CI signal for your change, please convert it to an actual PR. You can still manually trigger a test run with /test all

xrstf commented 4 months ago

/test all

xrstf commented 4 months ago

/test all

xrstf commented 4 months ago

/test all

xrstf commented 4 months ago

/test all

xrstf commented 4 months ago

/test all

kubermatic-bot commented 3 months ago

LGTM label has been added.

Git tree hash: db63db8b1af571ce60a78261e9030e9656b2e0ef

kubermatic-bot commented 3 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: embik

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/kubermatic/operating-system-manager/blob/main/OWNERS)~~ [embik] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment