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

2760 document suc upgrade recovery #278

Merged
merged 4 commits into from
Oct 4, 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
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