Skip to content

Commit

Permalink
2760 document suc upgrade recovery (#278)
Browse files Browse the repository at this point in the history
* Move instruction for system-upgrade-controller to a new page

Signed-off-by: Dimitris Karakasilis <[email protected]>

* Explaing the usage of the new `--recovery` flag

kairos-io/packages#1087

Signed-off-by: Dimitris Karakasilis <[email protected]>

* Add version to system-upgrade-controller checkout

Signed-off-by: Dimitris Karakasilis <[email protected]>

* Bump suc version

Signed-off-by: Dimitris Karakasilis <[email protected]>

---------

Signed-off-by: Dimitris Karakasilis <[email protected]>
  • Loading branch information
jimmykarily authored Oct 4, 2024
1 parent d6ab622 commit 592f1f2
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 11 deletions.
17 changes: 10 additions & 7 deletions content/en/docs/Upgrade/kubernetes.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,7 @@ Kairos upgrades can be performed either manually or via Kubernetes if the cluste

## Prerequisites

- It is necessary [system-upgrade-controller](https://github.com/rancher/system-upgrade-controller) to be deployed in the target cluster.

To install it, use kubectl:

```bash
kubectl apply -f https://github.com/rancher/system-upgrade-controller/releases/download/{{< system-upgrade-controller-version >}}/system-upgrade-controller.yaml
```
system-upgrade-controller needs to be deployed on the target cluster. [Read the instructions here]({{< relref "./system-upgrade-controller" >}})

### Upgrading from version X to version Y with Kubernetes

Expand Down Expand Up @@ -53,6 +47,15 @@ spec:
EOF
```

To upgrade the "recovery" image instead of the active one, just pass `--recovery` to the `suc-upgrade script:

```
...
command:
- "/usr/sbin/suc-upgrade"
- "--recovery"
```

To check all the available versions, see the [images](https://quay.io/repository/kairos/opensuse?tab=tags) available on the container registry, corresponding to the flavor/version selected.

{{% alert title="Note" %}}
Expand Down
50 changes: 50 additions & 0 deletions content/en/docs/Upgrade/system-upgrade-controller.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
title: "Installing system-upgrade-controller"
linkTitle: "System Upgrade Controller"
weight: 4
date: 2024-10-2
description: Install the system-upgrade-controller
---

To upgrade Kairos with Kubernetes, it is necessary to have [system-upgrade-controller](https://github.com/rancher/system-upgrade-controller) deployed on the target cluster.

[The upstream documentation](https://github.com/rancher/system-upgrade-controller#deploying) on how to install the system-upgrade-controller, is this command:

```
kubectl apply -k github.com/rancher/system-upgrade-controller
```

This command requires the `git` command to be available in order to clone the remote repository. Kairos images, generally, don't include git. You will need to run this command from a machine which has `git` available and access to the cluster with a valid KUBECONFIG file.

Alternatively, from withing the Kairos node, you can deploy the following `Job` which will clone the system-upgrade controller repository to the `/home/kairos` directory:

```
apiVersion: batch/v1
kind: Job
metadata:
name: git
spec:
template:
spec:
restartPolicy: Never
containers:
- name: git
image: alpine/git
command: ["git", "clone", "--branch", "{{< system-upgrade-controller-version >}}", "https://github.com/rancher/system-upgrade-controller", "/homedir/system-upgrade-controller"]
volumeMounts:
- name: homedir
mountPath: /homedir
volumes:
- name: homedir
hostPath:
path: /home/kairos
type: Directory
```

(make sure you checkout the desired branch/release)

Then, from the `/home/kairos` directory, you can run this command to deploy the system-upgrade-controller:

```
kubectl apply -k system-upgrade-controller
```
4 changes: 1 addition & 3 deletions content/en/docs/Upgrade/trustedboot.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,7 @@ kairos-agent upgrade --source oci:acme.com/acme/kairos

#### Upgrades with Kubernetes

Kairos can be upgraded with the [system-upgrade-controller](https://github.com/rancher/system-upgrade-controller) from
Kubernetes itself. The controller and all the relevant CRDs [should already be installed](https://github.com/rancher/system-upgrade-controller?tab=readme-ov-file#deploying)
(at the time of writing, this workaround is needed in order to install the system-upgrade-controller: [workaround for the missing "latest" tag](https://github.com/rancher/system-upgrade-controller/issues/302#issuecomment-2027163863)).
To upgrade Kairos with Kubernetes, system-upgrade-controller needs to be deployed on the target cluster. [Read the instructions here]({{< relref "./system-upgrade-controller" >}}).

A "Plan" resource needs to be created which will use the image generated in the step above.
Since that image only contains the EFI files for the upgrade and in order to be able use any ImagePullSecrets
Expand Down
2 changes: 1 addition & 1 deletion hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ defaultFlavorRelease = "24.04"
# renovate: datasource=github-releases depName=kairos-io/kairos-framework
defaultFrameworkRelease = "v2.10.2"
# renovate: datasource=github-releases depName=rancher/system-upgrade-controller
system_upgrade_controller = "v0.13.4"
system_upgrade_controller = "v0.14.1"
# User interface configuration
[params.ui]
# Enable to show the side bar menu in its compact state.
Expand Down

0 comments on commit 592f1f2

Please sign in to comment.