Adds support for mesh network with k0s distro. The detection of the
distro is done by either having explicit config or by the binary
installed. By default, it uses k3s, for backwards compatibility.
Additionally, I refactored to split responsibilities. `master.go` will
have generic logic on how the steps to setup a master node, and
`worker.go` a worker node. It does so by interacting with the `K8sNode`
interface, and the detailed logic on how to do it for each distribution
has been moved to `k3s.go` and `k0s.go` respectively. This should make
it much simpler to debug or add new distributions.
Tests:
- [x] k3s single
- [x] k3s multi manual
- [x] k3s p2p auto
- [x] k0s single
- [x] k0s multi manual
- [x] k0s p2p auto
Covered:
- https://kairos.io/docs/examples/multi-node-p2p/
- https://kairos.io/docs/examples/multi-node/
- https://kairos.io/docs/examples/single-node/
---------
Signed-off-by: Mauro Morales <contact@mauromorales.com>
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
This PR is dependent of
https://github.com/kairos-io/kairos-sdk/pull/546, and it adds the
possibility to deploy k0s instead of k3s.
refactored `oneTimeBootstrap()` to handle k0s and k3s.
Added `K0s` type to bootstrap `config` package
added k0s to provider `package`` InteractiveInstall()` and check for
mutual exclusivity
CC: @mauromorales
---------
Signed-off-by: William Rizzo <william.rizzo@gmail.com>
Signed-off-by: Mauro Morales <contact@mauromorales.com>
Co-authored-by: Mauro Morales <contact@mauromorales.com>
Tests are green and did a manual QA and it's working properly. I do have
two questions which I put as comments
---------
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
If we keep the API started, we want to keep streaming roles in case of completely disconnection between the nodes.
This guarantees that we keep streaming out our roles nevertheless of what happens
Signed-off-by: Ettore Di Giacinto <mudler@mocaccino.org>
This doesn't change the documented flow, but makes sure that if someone did defined a network token and also enables k3s manually it still tries to co-ordinate over p2p.
Optionally, a `skip_auto` is introduced to manually bootstrap the node
Signed-off-by: Ettore Di Giacinto <mudler@mocaccino.org>
In this way, the p2p API will just run the co-ordination to setup KubeVIP automatically
to the new cluster.
Signed-off-by: Ettore Di Giacinto <mudler@mocaccino.org>