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

Add support to upgrade addons #3678

Closed
anubisg1 opened this issue Jan 18, 2023 · 4 comments
Closed

Add support to upgrade addons #3678

anubisg1 opened this issue Jan 18, 2023 · 4 comments
Labels
inactive kind/feature New feature or request priority/medium Medium Priority

Comments

@anubisg1
Copy link

Summary

Allow to upgrade addons when upgrading microk8s from one version to another

Why is this important?

When upgrading from one version to another, incompatibilities may arise causing old version of addons to no longer work.

Currently the only way to upgrade an addon is to Uninstall it, then update it. This causes. Downtime

Are you interested in contributing to this feature?

I'd be happy to but I need some direction on how to do it. I'm not a full developer rather just a "patcher"

@neoaggelos
Copy link
Contributor

Hi @anubisg1

This has been a consideration for some time now and different approaches have been considered by the team.

In the end, it all boils down to the fact that upgrade is just a fundamentally different operation depending on each add-on. For some addons, this is as simple as applying a new manifest, but for others it might mean downloading new binaries, ensuring configuration options match across the nodes of a cluster, etc.

Just to make sure that this is recorded, I believe that the way forward would be to allow for addon implementations to implement an upgrade hook themselves, sitting next to the enable script. Then, for the microk8s core to support this, an extension to the microk8s_xable to look up the upgrade script and fall back to a message "Upgrade is not supported by $addon" if none is found.

As for the implementation of the upgrade hook, it should look like the existing enable and disable hooks. Depending on the addon, the upgrade hook may be:

  • A symlink to the enable script. This works well for addons that do some basic validation and then apply a manifest. Special care needs to be taken in case the addon accepts user parameters, with regards to how and if this configuration is preserved on upgrade.
  • The enable script is a wrapper around the upgrade script. This works well for cases where the enable script does some consistency checks, then proceeds to deploy the addon.
  • In case of backwards incompatible changes, manage the migration of resources, configurations and ensure the upgrade is possible before proceeding.
  • Something else entirely.

Further, I believe the UX should look similar to this:

$ microk8s upgrade $addon [ $args... ]

Finally, I would be reluctant to add a microk8s upgrade --all variant, at least not until we get some good sense of how the feature is mainly used.

I am suggesting this both as an exercise to consider what the feature could look like, as well an initial case to gather interest and feedback from the community.

Also cc @ktsakalozos if you want to share any ideas of your own.

@neoaggelos neoaggelos added kind/feature New feature or request priority/medium Medium Priority labels Jan 27, 2023
@yoe
Copy link

yoe commented Mar 7, 2023

I just had to do a manual upgrade of the storage addon from version 1.1.0 to 1.4.2 (with the help of @neoaggelos), and it was a bit painful ("try this" -- "no that doesn't work, needs more" -- "not there yet", etc). While we got there in the end, having a feature like this would be tremendously helpful and would save a lot of time.

Copy link

stale bot commented Feb 1, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the inactive label Feb 1, 2024
@stale stale bot closed this as completed Mar 2, 2024
@btrepp
Copy link

btrepp commented May 25, 2024

Would be great to see if something like this is possible, one of the draws to me of microk8s is that it appeared like the snap can be auto updated, which is great for keeping a platform evergreen.

Extensions seemed a great addition to this, core capability that just works. However without an upgrade story they feel a bit more footgun-y.

It does make sense as there won't always be easy upgrade paths, and I suspect it would make the extension mechanism way more complicated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
inactive kind/feature New feature or request priority/medium Medium Priority
Projects
None yet
Development

No branches or pull requests

4 participants