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

docs: Add snap upgrades how-to #934

Merged
merged 4 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/src/snap/howto/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ backup-restore
refresh-certs
restore-quorum
two-node-ha
Managing upgrades <upgrades>
Set up Enhanced Platform Awareness <epa>
contribute
Get support <support>
Expand Down
108 changes: 108 additions & 0 deletions docs/src/snap/howto/upgrades.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# Upgrading the snap
HomayoonAlimohammadi marked this conversation as resolved.
Show resolved Hide resolved

Upgrading the Kubernetes version of a node is a critical operation that
requires careful planning and execution. {{product}} is shipped as a snap,
which simplifies the upgrade process.
This how-to guide will cover the steps to upgrade the {{product}} snap
and how to put a hold on upgrades if desired.

## Important Considerations Before Upgrading

- According to the [upstream Kubernetes][1], skipping **minor** versions while
upgrading is not supported. For more details, please visit the
[Version Skew Policy][2].
- Before performing an upgrade, it's important to back up the cluster data.
This can be done by following the steps outlined in the [backup guide][3].
- For more information on managing snap updates, please refer to the
[snap documentation][4].
Comment on lines +11 to +17
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- According to the [upstream Kubernetes][1], skipping **minor** versions while
upgrading is not supported. For more details, please visit the
[Version Skew Policy][2].
- Before performing an upgrade, it's important to back up the cluster data.
This can be done by following the steps outlined in the [backup guide][3].
- For more information on managing snap updates, please refer to the
[snap documentation][4].
- According to the [upstream Kubernetes], skipping **minor** versions while
upgrading is not supported. For more details, please visit the
[Version Skew Policy].
- Before performing an upgrade, it's important to back up the cluster data.
This can be done by following the steps outlined in the [backup guide].
- For more information on managing snap updates, please refer to the
[snap documentation].


## Patch Upgrade

Patch upgrades address bug fixes and are typically safe, introducing no
breaking changes.
Snaps automatically check for updates of their specific track
(e.g. `1.32-classic`) several times a day and apply them when available.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
(e.g. `1.32-classic`) several times a day and apply them when available.
(e.g. `1.32-classic`) 4 times a day and apply them when available.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is what I initially had, but changed according to this comment: #934 (comment)

These updates ensure that the latest changes in the installed track are applied.
Patch upgrades can also be triggered manually by following the steps below.

1. **List available revisions:**

```
snap info k8s
```

2. **Refresh the snap:**

```
snap refresh k8s
```

3. **Verify the upgrade:**

Ensure that the upgrade was successful by checking the version of the snap and
confirming that the cluster is ready:

```
snap info k8s
sudo k8s status --wait-ready
```

## Minor Version Upgrade

Minor versions add new features or deprecate existing features without
breaking changes.
To upgrade to a new minor version, the snap channel needs to be changed.


1. **List available channels:**

```
snap info k8s
```

2. **Change the snap channel:**

The {{product}} snap channel can be changed by using the `snap refresh`
command.

```
snap refresh --channel=1.33/stable k8s
```

3. **Verify the upgrade:**

Ensure that the upgrade was successful by checking the version of the snap
and confirming that the cluster is ready:

```
snap info k8s
sudo k8s status --wait-ready
```

```{note}
In a multi-node cluster, the upgrade should be performed on all nodes.
```

HomayoonAlimohammadi marked this conversation as resolved.
Show resolved Hide resolved
## Freezing Upgrades

To prevent automatic updates, the snap can be tied to a specific revision.
`snap refresh --hold[=<duration>]` holds snap refreshes for a specified
duration (or forever, if no value is specified).

```
snap refresh k8s --hold
```

Or specify a time window:

```
snap refresh k8s --hold=24h
```

<!-- LINKS -->
[1]: https://kubernetes.io/docs/tasks/administer-cluster/kubeadm/kubeadm-upgrade/
[2]: https://kubernetes.io/docs/setup/release/version-skew-policy/
[3]: ./backup-restore.md
[4]: https://snapcraft.io/docs/managing-updates
[5]: ../../charm/index.md
[6]: ../../capi/index.md
Comment on lines +103 to +108
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
[1]: https://kubernetes.io/docs/tasks/administer-cluster/kubeadm/kubeadm-upgrade/
[2]: https://kubernetes.io/docs/setup/release/version-skew-policy/
[3]: ./backup-restore.md
[4]: https://snapcraft.io/docs/managing-updates
[5]: ../../charm/index.md
[6]: ../../capi/index.md
[upstream Kubernetes]: https://kubernetes.io/docs/tasks/administer-cluster/kubeadm/kubeadm-upgrade/
[Version Skew Policy]: https://kubernetes.io/docs/setup/release/version-skew-policy/
[backup guide]: ./backup-restore.md
[snap documentation]: https://snapcraft.io/docs/managing-updates
[5]: ../../charm/index.md
[6]: ../../capi/index.md

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, I think 5 and 6 are unused?

Loading