Update the docs

This commit is contained in:
2026-04-06 05:47:34 +08:00
parent d662162921
commit c6f89651ce
4 changed files with 39 additions and 43 deletions

View File

@@ -8,13 +8,13 @@ https://docs.mono.si/gateway-development-kit/getting-started
* Read-only RootFS * Read-only RootFS
* k8s style OS upgrade (see Upgrading) * k8s style OS upgrade (see Upgrading)
## IMPORTANT NOTES ## DISCLAIMER
* This is not your everyday linux image! It is best suited for users that is already familiar * 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-use with k8s. For first-timers, you may want to try the default config that gives you a ready-to-use
cluster then get yourself started from there cluster and get yourself started from there
* The 3 RJ45 ports are label in eth1, eth2, eth0 respectively by the kernel (left to right) * USE AT YOUR OWN RISKS. I leverage ChatGPT heavily for this.
So `ip addr eth0` is your right most port
### Table of Contents ### Table of Contents
1. Flashing 1. Flashing
@@ -26,19 +26,20 @@ https://docs.mono.si/gateway-development-kit/getting-started
- [Install an ssh pod](docs/installing-ssh-pod.md) (Recommended) - [Install an ssh pod](docs/installing-ssh-pod.md) (Recommended)
## Build ## 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 Prerequisites
* make
* Docker
* curl (downloading dependency packages, kubelet, crio, etc)
* go (building clitools, control-agent)
* controller-gen (see [clitools readme](clitools/README.md))
* git (cloning uboot repo because uboot does not provide direct downloads)
``` ```
make release make release
``` ```
The default configuration will boot as a first time control-plane. Adjust to your own needs. The default configuration will boot as a first time control-plane.
For control-plane For control-plane
``` ```
@@ -73,12 +74,3 @@ make kernel # Builds our kernel from NXP
make initramfs make initramfs
make itb # Builds out/board.itb (contains the kernel and the 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.

View File

@@ -1,30 +1,28 @@
## For development workflow Installing `controller-gen`
For running `controll-gen`
``` ```
export PATH="$(go env GOPATH)/bin:$PATH" export PATH="$(go env GOPATH)/bin:$PATH"
go install sigs.k8s.io/controller-tools/cmd/controller-gen@latest go install sigs.k8s.io/controller-tools/cmd/controller-gen@latest
``` ```
Run this on device ## For development workflow
Run this on the gateway device
```bash ```bash
while true; do nc -l -p 1234 -e sh; done while true; do nc -l -p 1234 -e sh; done
``` ```
Run this script on the dev machine Run this script on your dev machine
```bash ```bash
#!/bin/bash
make build make build
SIZE=$(wc -c < ./bin/ctl-linux-aarch64-dev) SIZE=$(wc -c < ./bin/ctl-linux-aarch64-dev)
( (
echo 'base64 -d > /var/ctl <<'"'"'EOF'"'"'' echo 'base64 -d > /var/ctl <<'"'"'EOF'"'"''
pv -s "$SIZE" < ./bin/ctl-linux-aarch64-dev | base64 pv -s "$SIZE" < ./bin/ctl-linux-aarch64-dev | base64
echo 'EOF' echo 'EOF'
echo "export DEBUG=1"
echo 'chmod +x /var/ctl' echo 'chmod +x /var/ctl'
echo '/var/ctl create config > /var/abc.yaml' echo "echo Running /var/ctl $@"
echo "/var/ctl internal run-step $1 -c /var/abc.yaml 2>&1" echo "/var/ctl $@ 2>&1"
) | nc 10.0.0.10 1234 ) | nc 10.0.0.10 1234
``` ```
@@ -33,21 +31,14 @@ And use it like this
./send.sh start_crio ./send.sh start_crio
``` ```
### Join token
Create join token from control plane Create join token from control plane
``` ```
kubeadm token create --print-join-command kubeadm token create --print-join-command
``` ```
Export the token inside the device Generate join token using kubectl
```
export DEBUG=1
export HOSTNAME=monok8s-master-1
export BOOTSTRAP_TOKEN=
export TOKEN_CACERT_HASH=
```
Generate using kubectl
``` ```
TOKEN_NAME=bootstrap-token-iwotl0 TOKEN_NAME=bootstrap-token-iwotl0
@@ -61,6 +52,7 @@ HASH=$(kubectl -n kube-public get configmap cluster-info -o jsonpath='{.data.kub
| openssl rsa -pubin -outform der 2>/dev/null \ | openssl rsa -pubin -outform der 2>/dev/null \
| openssl dgst -sha256 -hex \ | openssl dgst -sha256 -hex \
| awk '{print "sha256:" $2}') | awk '{print "sha256:" $2}')
echo "export API_SERVER_ENDPOINT=${API_SERVER}" echo "export API_SERVER_ENDPOINT=${API_SERVER}"
echo "export BOOTSTRAP_TOKEN=${TOKEN}" echo "export BOOTSTRAP_TOKEN=${TOKEN}"
echo "export TOKEN_CACERT_HASH=${HASH}" echo "export TOKEN_CACERT_HASH=${HASH}"

View File

@@ -48,8 +48,8 @@ catalog:
ConfigMap: images-cm ConfigMap: images-cm
``` ```
※ ConfigMap requires additional RBAC permission which is not by default. You edit the ※ ConfigMap requires additional RBAC permission which is not enabled by default. You can edit
control-agent ClusterRole and add `cnofigmaps: get` to allow this. the control-agent's ClusterRole and add `cnofigmaps: get` to allow this.
Contents should look like this Contents should look like this
```yaml ```yaml
@@ -118,7 +118,7 @@ status:
## Development notes ## Development notes
### Simulate OTA ### Flashing manually into partition B
**Use nmap ncat**. Otherwise we'll have all kinds of fabulous issues sending it. **Use nmap ncat**. Otherwise we'll have all kinds of fabulous issues sending it.

12
docs/vendor-resources.md Normal file
View File

@@ -0,0 +1,12 @@
## Updating build.env
You can find the latest package versions in here
* [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/)
## 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`