Upgrades can be triggered from Kubernetes with system-upgrade-controller
installed in your cluster. See the Elemental-toolkit documentation
System upgrade controller needs to be installed in the cluster which is targeted for the upgrades, for example:
kubectl apply -f https://raw.githubusercontent.com/rancher/system-upgrade-controller/master/manifests/system-upgrade-controller.yaml
Then in order to trigger an upgrade, we need to create a new upgrade plan for the cluster. create a Plan
resource like the following as upgrade.yaml
:
---
apiVersion: upgrade.cattle.io/v1
kind: Plan
metadata:
name: os-upgrade
namespace: system-upgrade
labels:
k3s-upgrade: server
spec:
concurrency: 1
#version: latest
version: "opensuse-v1.21.4-31"
nodeSelector:
matchExpressions:
- {key: kubernetes.io/hostname, operator: Exists}
serviceAccountName: system-upgrade
cordon: true
drain:
force: true
disableEviction: true
upgrade:
image: quay.io/c3os/c3os
command:
- "/usr/sbin/suc-upgrade"
And apply it:
kubectl apply -f upgrade.yaml
You can use the version
field in the resource to tweak the c3os version
depending on the chosen flavor. Refer to system-upgrade-controller for documentation.
Upgrades can be triggered manually as well from the nodes.
To upgrade to latest available version, run from a shell of a cluster node:
c3os-agent upgrade
To specify a version, just run
c3os-agent upgrade <version>
Use --force
to force upgrading to avoid checking versions. All the available versions can be list with: c3os upgrade list-releases
.
It is possible altough to use the same commandset from Elemental-toolkit
. So for example, the following works too:
elemental upgrade --no-verify --docker-image quay.io/c3os/c3os:opensuse-v1.21.4-22
c3os images are released on quay.io.
See also the general Elemental-toolkit documentation which applies for c3os
as well.