Introducing the k3OS Operator
🚧 Work-In-Progress 🚧
Initially focused with providing a kubernetes-native upgrade experience, this change-set enhances the k3os multi-call binary to provide:
k3os ops agent
custom resource and node controllerk3os ops upgrade
perform rootfs and kernel upgrades
The k3os-upgrade-rootfs
and k3os-upgrade-kernel
scripts have been updated to leverage k3os ops upgrade
CLI.
The Custom Resource
This change-set also introduces a new custom resource, the UpdateChannel
or upchan
:
$ kubectl describe upchan -A
Name: github-releases
Namespace: k3os-system
Labels: <none>
Annotations: k3os.io/node: k3os-21702
API Version: k3os.io/v1
Kind: UpdateChannel
Metadata:
Creation Timestamp: 2019-11-17T02:25:56Z
Finalizers:
wrangler.cattle.io/k3os-operator
Generation: 1
Resource Version: 377
Self Link: /apis/k3os.io/v1/namespaces/k3os-system/updatechannels/github-releases
UID: 9bd4ecf3-44ea-4d69-b720-09e01b20ad76
Spec:
Concurrency: 1
URL: github-releases://dweomer/k3os
Version: v0.7.0-dweomer1
Status:
Events: <none>
The Resource Controller
Controlling this resource is a DaemonSet running on every k3os
node in the cluster. It watches for changes on UpdateChannel.Spec.Version
and if a node's installed version differs the controller will attempt to take up one of the UpdateChannel.Status.Updating
slots (max of UpdateChannel.Spec.Concurrency
) and when successful will schedule a batch Job
that invokes k3os ops upgrade
. The controller will watch for this job to finish, when it does it will free up the UpdateChannel.Status.Updating
slot and schedule a reboot, via goroutine, on a delay of 5 seconds.
Additionally, the controller will notice when UpdateChannel.Spec.Version
is latest
(or empty) and attempt to poll for the latest release. As there is only one UpdateChannel.Status.Polling
slot, only one node will poll at a time and if there are any polling nodes updates will not be triggered.