Skip to content
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

✨ Multi-stage cluster addons and hook server #183

Merged
merged 31 commits into from
Jun 28, 2024
Merged

✨ Multi-stage cluster addons and hook server #183

merged 31 commits into from
Jun 28, 2024

Conversation

janiskemper
Copy link
Member

@janiskemper janiskemper commented Jun 7, 2024

What this PR does / why we need it:
This PR is about the multi-stage cluster addons feature.

Tasks:

  • Hook server and Tilt setup
  • Basic Control loop
  • Deleting objects that are removed from one Helm chart version to the next
  • Handle case where Kubernetes version is not upgraded and hook server does not get triggered
  • Put hook server in same container as operator
  • Add debug logs for an audit of how clusteraddons got applied
  • Improve ClusterAddon.status
  • Show debug information in ClusterAddon.status
  • Improve error handling of CEL expressions with conditions
  • Improve error handling of helm template etc. with conditions
  • Testing

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

TODOs:

  • include documentation
  • add unit tests

@jschoone jschoone added the Container Issues or pull requests relevant for Team 2: Container Infra and Tooling label Jun 18, 2024
kranurag7 and others added 27 commits June 24, 2024 16:14
this commit enables CI on addons branch.

Signed-off-by: Anurag <[email protected]>
Signed-off-by: Aniruddha Basak <[email protected]>
Adapt controller with runtime sdk

- API change for hook
- Control loop for new way of cluster addon
- fix hook server
- update packages

Signed-off-by: Aniruddha Basak <[email protected]>
Update the hook sever service role

Signed-off-by: Aniruddha Basak <[email protected]>
Add manual upgrade if no k8s version is changed

Signed-off-by: Aniruddha Basak <[email protected]>
…d and after cluster upgrade

Signed-off-by: Aniruddha Basak <[email protected]>
- Download old cluster stack release if not present in the pod

Signed-off-by: Aniruddha Basak <[email protected]>
users on fedora using btrfs filesystem were having issues with capd and
that was fixed on main and it requires building your own image and using
the same here for now.

I tested it by building the image locally and now I don't see any error.
This will be fixed when we upgrade to 1.6.3 or later version.
As of now, we will rely on image built from CAPI main branch and pushed
to ghcr.io/sovereigncloudstack/capd with 1.0.5 tag.

Signed-off-by: kranurag7 <[email protected]>
Add hook server into same container as operator

Adding the hook server into the same container as CSO
Signed-off-by: janiskemper <[email protected]>
Signed-off-by: Aniruddha Basak <[email protected]>
Add debug log information in the addon controller

Signed-off-by: Aniruddha Basak <[email protected]>
Adding status.resources
Signed-off-by: janiskemper <[email protected]>
Fix overwrite yaml support

Signed-off-by: janiskemper <[email protected]>
use old release kubernetes version from the metadata.yaml

Signed-off-by: janiskemper <[email protected]>
Remove status.currentHook from the cluster addon

Signed-off-by: janiskemper <[email protected]>
In the previous PR we introduced a bug that resets the status in every
reconcile loop as long as a hook is specified.

However, we only want to reset it once when the hook is new. This commit
introduces the same.

Signed-off-by: janiskemper <[email protected]>
Refactor HelmChartStatus so that it is more user-friendly and always
shows the appropriate phase we are in.

Signed-off-by: janiskemper <[email protected]>
Signed-off-by: Aniruddha Basak <[email protected]>
Clean up resources for upgrades that do not trigger the hook server
because they don't upgrade the Kubernetes version
Signed-off-by: janiskemper <[email protected]>
Fixing bug that diff of old clusteraddons and new clusteraddons was
calculated wrongly due to issues with pointers and for loops.

Fixing the linting for the multi-stage cluster addons feature.

Fix the extension hooks that didn't work properly until now. They should
only update the clusteraddon once.

Add hook server to localmode config.

Update to yaml3 package.

Allow missing values prefix in overwrite.yaml.

Signed-off-by: janiskemper <[email protected]>
Currently, we set the clusterAddon on ready always. we want to do that
only at the end of a flow.

Signed-off-by: janiskemper <[email protected]>
Adding a condition that indicates that we wait for the hook server
or that the hook server is responsive.

Signed-off-by: janiskemper <[email protected]>
update the Kubernetes version

Signed-off-by: Aniruddha Basak <[email protected]>
Signed-off-by: Aniruddha Basak <[email protected]>
Finalizer for ClusterAddon object to block deletion if Cluster exists

Signed-off-by: janiskemper <[email protected]>
Adding a new condition that gives precise information about the status
of the operations regarding helm templating

Signed-off-by: janiskemper <[email protected]>
@janiskemper janiskemper force-pushed the addons-new branch 3 times, most recently from f44988e to 0fb787c Compare June 26, 2024 10:18
Fix linting in new clusteraddon-related files that we changed in the
feature branch.

Fixing unit tests.

Prepare feature branch to merge by going through changes of PR and
validating them. Fixing some small stuff, as well as changing
unnecessary or temporary changes back to the state of the main branch.

Signed-off-by: janiskemper <[email protected]>
aniruddha2000 and others added 2 commits June 28, 2024 12:38
Removing the shouldDelete option in kubeClient.Apply that was not used
anyway and always set on true.

Co-authored-by: janiskemper <[email protected]>
Signed-off-by: Aniruddha Basak <[email protected]>
🌱 Removing the temporary shouldDelete option to kubeClient.Apply that was not used anyway and always set on true
@janiskemper janiskemper changed the title [WIP] ✨ Multi-stage cluster addons and hook server ✨ Multi-stage cluster addons and hook server Jun 28, 2024
@janiskemper janiskemper merged commit 22cc6d7 into main Jun 28, 2024
10 checks passed
@janiskemper janiskemper deleted the addons-new branch June 28, 2024 16:01
@janiskemper janiskemper restored the addons-new branch June 28, 2024 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Container Issues or pull requests relevant for Team 2: Container Infra and Tooling
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Concurrent update of Cluster Add-ons can lead to downtime
4 participants