Added some ctl boilerplate

This commit is contained in:
2026-03-27 18:34:53 +08:00
parent bf85462e34
commit 87aa1d4b0b
30 changed files with 1813 additions and 19 deletions

View File

@@ -1,12 +1,17 @@
# monok8s
Kubernetes node firmware (built with Linux) for Mono Gateway Development Kit
Alpine-based Kubernetes cluster image for Mono's Gateway Development Kit
https://docs.mono.si/gateway-development-kit/getting-started
## DISCLAIMER
USE AT YOUR OWN RISKS. I leverage ChatGPT heavily for this. I am testing them all by myself right now.
## IMPORTANT NOTES
* The 3 RJ45 ports are label in eth1, eth2, eth0 respectively by the kernel (left to right)
* So `ip addr eth0` is your right most port
* If the fan stopped spinning. Unplug ASAP! Otherwise CPU temp goes to the moon.
## Build
Find the latest package versions and update build.env
@@ -80,27 +85,34 @@ make itb # Builds out/board.itb (contains the kernel and the initramfs)
- Read-only OS
## Upgrade process
Rough idea
```bash
./configure
# - asks for some config for kubelet
# - Join a cluster? Start a cluster?
make release
# Copy the new image to the upgrade-scheduler
kubectl cp -n kube-system upgrade-scheduler:/tmp/upgrade.img
# Upgrade scheduler reads the file that issue a self-reboot
reboot
# uboot to boot into partition B
We use a CRD with an agent to handle this. Our versions follows upstream's.
kubectl apply -f upgrade.yaml
```yaml
apiVersion: k8s.mono.si/v1alpha1
kind: OSUpgrade
metadata:
name: "my-ugrade"
spec:
version: "v1.35.1" # Or just "latest"
imageURL: "https://updates.example.com/monok8s-1.2.3.img.zst"
checksum: "sha256:..."
```
```yaml
PENDING
kubectl get osugrades
```
NAME TARGET STATUS AGE
my-upgrade-1 latest pending 1m
my-upgrade-2 v1.35.3 accepted 1m # latest gets realized into a version number
their-upgrade v1.33.2 succeeded 1m
```
kubectl get osupgradeprogress
```
NODE SOURCE STATUS
my-node my-upgrade-2 active
their-node my-upgrade-2 completed
```
## NOTES