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

DPE-2206 In-place upgrade support #255

Merged
merged 3 commits into from
Aug 18, 2023
Merged

DPE-2206 In-place upgrade support #255

merged 3 commits into from
Aug 18, 2023

Conversation

paulomach
Copy link
Contributor

@paulomach paulomach commented Jul 12, 2023

In place upgrades for mysql-k8s.

Usage upgrade lib with k8s adaptations. Much like zookeeper PR#71.

Solution

Implemented upgrade module.
Depending on dp-libs PR#81

TODO

  • replicate mysql lib modifications to vm
  • Documentation
  • Rollback documentation

Manual Testing (with same local built charm)

Instructions (happy path):

git clone [email protected]:canonical/mysql-k8s-operator.git
cd mysql-k8s-operator
git checkout feature/upgrades

charmcraft pack
# deploy local charm
juju deploy ./*.charm --trust --resource mysql-image=ghcr.io/canonical/charmed-mysql@sha256:017605f168fcc569d10372bb74b29ef9041256bd066013dec39e9ceee8c88539 -n 3

# After units settle, run pre-upgrade-check to build update-stack.
# This will change primary to unit 0 if not already
juju run-action mysql-k8s/leader pre-upgrade-check --wait

# inspect update relation data, should have `upgrade-stack` like `'[0,1,2]'`
juju show-unit mysql-k8s/0|yq '.*.relation-info[]|select(.endpoint=="upgrade")'

# refresh command - we are updating to the same charm, which will pass version checking
juju refresh --path ./*.charm mysql-k8s

# at this point just the highest ordinal unit will be updated.
# after successful upgrade, run:
juju run-action mysql-k8s/leader resume-upgrade --wait

# which will trigger auto rollout for upgrading the other units.

@paulomach paulomach changed the title DPE-2206 minor version upgrade support DPE-2206 In-place upgrade support Jul 18, 2023
@paulomach paulomach marked this pull request as ready for review July 18, 2023 22:19
src/upgrade.py Outdated Show resolved Hide resolved
src/upgrade.py Outdated Show resolved Hide resolved
src/upgrade.py Show resolved Hide resolved
src/upgrade.py Outdated Show resolved Hide resolved
src/upgrade.py Show resolved Hide resolved
src/upgrade.py Outdated Show resolved Hide resolved
src/upgrade.py Outdated Show resolved Hide resolved
src/upgrade.py Outdated Show resolved Hide resolved
src/upgrade.py Outdated Show resolved Hide resolved
marceloneppel
marceloneppel previously approved these changes Jul 25, 2023
@paulomach paulomach requested a review from delgod July 25, 2023 20:07
delgod
delgod previously approved these changes Aug 2, 2023
taurus-forever
taurus-forever previously approved these changes Aug 17, 2023
Copy link
Contributor

@taurus-forever taurus-forever left a comment

Choose a reason for hiding this comment

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

Great work!

src/k8s_helpers.py Show resolved Hide resolved
src/dependency.json Outdated Show resolved Hide resolved
taurus-forever
taurus-forever previously approved these changes Aug 17, 2023
Copy link
Contributor

@taurus-forever taurus-forever left a comment

Choose a reason for hiding this comment

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

blessed.

Mehdi-Bendriss
Mehdi-Bendriss previously approved these changes Aug 18, 2023
marceloneppel
marceloneppel previously approved these changes Aug 18, 2023
@paulomach paulomach merged commit b21198f into main Aug 18, 2023
@paulomach paulomach deleted the feature/upgrades branch August 18, 2023 14:00
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.

8 participants