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

Update manual upgrade page with better order of operations #251

Merged
merged 4 commits into from
Mar 20, 2024
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
2 changes: 1 addition & 1 deletion .codespellrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[codespell]
skip = .git,./src,./node_modules,*.js,*.json,./build,./.github,yarn.lock
check-filenames = true
ignore-words-list = aks,ec2,eks,gce,gcp,ro,shouldnot,pullrequest
ignore-words-list = aks,ec2,eks,gce,gcp,ro,shouldnot,pullrequest,readd
140 changes: 70 additions & 70 deletions docs/release-notes/v1.26.X.md

Large diffs are not rendered by default.

110 changes: 55 additions & 55 deletions docs/release-notes/v1.27.X.md

Large diffs are not rendered by default.

90 changes: 45 additions & 45 deletions docs/release-notes/v1.28.X.md

Large diffs are not rendered by default.

57 changes: 57 additions & 0 deletions docs/upgrades/killall.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,63 @@ weight: 4

To allow high availability during upgrades, the K3s containers continue running when the K3s service is stopped.


## K3s Service

Stopping and restarting K3s is supported by the installation script for systemd and OpenRC.

<Tabs>
<TabItem value="systemd">

To stop servers:
```sh
sudo systemctl stop k3s
```

To restart servers:
```sh
sudo systemctl start k3s
```

To stop agents:
```sh
sudo systemctl stop k3s-agent
```

To restart agents:
```sh
sudo systemctl start k3s-agent
```

</TabItem>
<TabItem value="OpenRC">

To stop servers:
```sh
sudo rc-service k3s stop
```

To restart servers:
```sh
sudo rc-service k3s restart
```

To stop agents:
```sh
sudo rc-service k3s-agent stop
```

To restart agents:
```sh
sudo rc-service k3s-agent restart
```

</TabItem>
</Tabs>


## Killall Script

To stop all of the K3s containers and reset the containerd state, the `k3s-killall.sh` script can be used.

The killall script cleans up containers, K3s directories, and networking components while also removing the iptables chain with all the associated rules. The cluster data will not be deleted.
Expand Down
46 changes: 14 additions & 32 deletions docs/upgrades/manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ The contents of the [configuration file](../installation/configuration.md#config
If you want your configuration to be independent from the install script, you should use a configuration file instead of passing environment variables or arguments to the install script.
:::

Running the install script will:

1. Download the new k3s binary
2. Update the systemd unit or openrc init script to reflect the args passed to the install script
3. Restart the k3s service

For example, to upgrade to the current stable release:

```sh
Expand All @@ -51,42 +57,18 @@ curl -sfL https://get.k3s.io | INSTALL_K3S_CHANNEL=latest <EXISTING_K3S_ENV> sh
If you want to upgrade to a specific version you can run the following command:

```sh
curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=vX.Y.Z-rc1 <EXISTING_K3S_ENV> sh -s - <EXISTING_K3S_ARGS>
curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=vX.Y.Z+k3s1 <EXISTING_K3S_ENV> sh -s - <EXISTING_K3S_ARGS>
```

### Manually Upgrade K3s Using the Binary
:::tip
If you want to download the new verision of k3s, but not start it, you can use the `INSTALL_K3S_SKIP_START=true` environment variable.
:::

Or to manually upgrade K3s:
### Upgrade K3s Using the Binary

To upgrade K3s manually, you can download the desired version of the K3s binary and replace the existing binary with the new one.

1. Download the desired version of the K3s binary from [releases](https://github.com/k3s-io/k3s/releases)
2. Copy the downloaded binary to `/usr/local/bin/k3s` (or your desired location)
3. Stop the old k3s binary
4. Launch the new k3s binary

### Restarting K3s

Restarting K3s is supported by the installation script for systemd and OpenRC.

**systemd**

To restart servers manually:
```sh
sudo systemctl restart k3s
```

To restart agents manually:
```sh
sudo systemctl restart k3s-agent
```

**OpenRC**

To restart servers manually:
```sh
sudo service k3s restart
```

To restart agents manually:
```sh
sudo service k3s-agent restart
```
4. Launch the new k3s binary
Loading