github.com/sealerio/sealer@v0.11.1-0.20240507115618-f4f89c5853ae/pkg/runtime/k0s/README.md (about)

     1  # k0s Runtime Design
     2  ## basefs
     3  
     4  ```shell
     5  .
     6  ├── amd64
     7  │   ├── bin
     8  │   │   ├── k0s
     9  │   │   ├── kubectl
    10  │   │   ├── nerdctl
    11  │   │   └── seautil
    12  │   ├── images
    13  │   │   └── registry.tar.gz
    14  │   └── Metadata
    15  ├── imageList
    16  ├── Kubefile
    17  └── rootfs
    18      ├── etc
    19      │   ├── dump-config.toml
    20      │   └── registry.yml
    21      └── scripts
    22          ├── containerd.sh
    23          ├── init-registry.sh
    24          └── init.sh
    25  ```
    26  
    27  ## introduce
    28  We define the k0s runtime has 5 phases to install/scale/reset the cluster.
    29  
    30  basefs contains binary、shell script、config file and image. See more about [sealerio/basefs](https://github.com/sealerio/basefs)
    31  
    32  Runtime before filesystem lead cluster install through execute [k0s](https://github.com/k0sproject/k0s) command.
    33  
    34  + Init
    35    + When sealer leads to cluster install first, init phase copy rootfs/bin to /usr/bin in init.sh script
    36    + create bootstrap config /etc/k0s/k0s.yaml to lead controller init
    37    + generate k0s join token /etc/k0s/worker-token and /etc/k0s/controller-token, also private registry cert
    38    + init controller node
    39    + fetch config for ~/.kube/config to manage the cluster.
    40  + Join
    41    + Join phase prepare the registry certs, and use `k0s join` to scale up the cluster.
    42  + Delete
    43    + Delete is same as join, but it recycles anything installed by join phase.
    44  + Reset
    45    + Reset through k0s to remove this cluster and remove anything about the cluster generated by sealer.
    46  + Upgrade
    47    + Coming for soon!