85 lines
2.8 KiB
Markdown
85 lines
2.8 KiB
Markdown
# monok8s
|
|
An Alpine-based Kubernetes cluster image for Mono's Gateway Development Kit
|
|
|
|
https://docs.mono.si/gateway-development-kit/getting-started
|
|
|
|
## Features
|
|
* A/B deployment
|
|
* Read-only RootFS
|
|
* k8s style OS upgrade (see Upgrading)
|
|
|
|
## IMPORTANT NOTES
|
|
* This is not your everyday linux image! It is best suited for users that is already familiar
|
|
with k8s. For first-timers, you may want to try the default config that gives you a ready-to-used
|
|
cluster then get yourself started from there
|
|
|
|
* 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
|
|
|
|
### Table of Contents
|
|
1. Flashing
|
|
- [USB](docs/flashing-usb.md)
|
|
- [Over network (tftp)](docs/flashing-network.md)
|
|
2. [Upgrading](docs/ota.md)
|
|
3. Getting shell access to the host
|
|
- UART. The thing you did in first time flashing.
|
|
- [Install an ssh pod](docs/installing-ssh-pod.md) (Recommended)
|
|
|
|
## Build
|
|
Find the latest package versions and update build.env
|
|
* [kernel](https://github.com/nxp-qoriq/linux/archive/refs/tags/)
|
|
* [busybox](https://github.com/mirror/busybox/archive/refs/tags/)
|
|
* [CRI-O](https://github.com/cri-o/cri-o/releases)
|
|
* [Kubelet](https://kubernetes.io/releases/download/)
|
|
* [UBoot](https://github.com/u-boot/)
|
|
|
|
Then run
|
|
```
|
|
make release
|
|
```
|
|
|
|
The default configuration will boot as a first time control-plane. Adjust to your own needs.
|
|
|
|
For control-plane
|
|
```
|
|
make cluster-config \
|
|
MKS_HOSTNAME=monok8s-master \
|
|
MKS_CLUSTER_ROLE=control-plane \
|
|
MKS_INIT_CONTROL_PLANE=true \
|
|
MKS_MGMT_ADDRESS=10.0.0.10/24 \
|
|
MKS_APISERVER_ADVERTISE_ADDRESS=10.0.0.10
|
|
```
|
|
|
|
For worker
|
|
```
|
|
make cluster-config \
|
|
MKS_HOSTNAME=monok8s-worker \
|
|
MKS_CLUSTER_ROLE=worker \
|
|
MKS_INIT_CONTROL_PLANE=no \
|
|
MKS_MGMT_ADDRESS=10.0.0.10/24 \
|
|
MKS_APISERVER_ADVERTISE_ADDRESS=10.0.0.10 \
|
|
MKS_API_SERVER_ENDPOINT=10.0.0.1:6443 \
|
|
MKS_CNI_PLUGIN=none \
|
|
MKS_BOOTSTRAP_TOKEN=abcd12.ef3456789abcdef0 \
|
|
MKS_DISCOVERY_TOKEN_CA_CERT_HASH=sha256:9f1c2b3a4d5e6f7890abc1234567890abcdef1234567890abcdef1234567890ab
|
|
```
|
|
|
|
Check inside [configs/cluster.env.default](configs/cluster.env.default) for configuration details
|
|
|
|
### Making sub stages
|
|
```bash
|
|
make build-base # The image that builds the kernel and everything
|
|
make kernel # Builds our kernel from NXP
|
|
make initramfs
|
|
make itb # Builds out/board.itb (contains the kernel and the initramfs)
|
|
```
|
|
|
|
## NOTES
|
|
### The device's dts files are located at here
|
|
https://github.com/we-are-mono/OpenWRT-ASK/tree/mono-25.12.0-rc3/target/linux/layerscape/files/arch/arm64/boot/dts/freescale
|
|
* We need both `mono-gateway-dk-sdk.dts` and `mono-gateway-dk.dts` since the sdk one includes the non-sdk one.
|
|
* The actual dts being used is the `mono-gateway-dk-sdk.dts`
|
|
|
|
## DISCLAIMER
|
|
USE AT YOUR OWN RISKS. I leverage ChatGPT heavily for this.
|