sealer
sealer copied to clipboard
feature: k0s init, import some dependencies form k0sproject.
Signed-off-by: starComingup [email protected]
Describe what this PR does / why we need it
add k0s init step feature for sealer, it prepare k0sctl install env and image registry and so on.
Does this pull request fix one issue?
NONE, but is a step for k0s clusterRuntime.
Describe how you did it
NONE
Describe how to verify it
use unit test for check it work!
Todo list:
- [x] k.MergeConfigOnMaster0, // convert cluster file to k0s config
- [x] k.SSHCopyIDToHosts, // ssh-key-gen and ssh-copy-id to login hosts without passwd
- [x] k.GenerateCert, // generate Registry cert mainly
- [x] k.ApplyRegistryOnMaster0, // start a private registry for cluster
Note:
Why we don't need initMaster0 and GetKubectlConfig func like k8s init step?
In k0sctl
design which lead the cluster creation, cluster init phase and node join phase integrate to k0sctl apply
and it will reconcile by k0sctl
itself, so to keep sealer now createProcess logic c.init and c.join. I would like to implement the k0sctl apply
cmd in join function rather than init function. And after apply, and we can use k0sctl kubeconfig
to create the config file for kubectl.
I use go mod tidy
, but it seems so many dependencies imported.
Good job, 👍 I think @sealerio/sealer-maintainers could review this first, and @starComingup can illustrate this pull request in the maintainer's meeting this night.
Good job for the k0s initial work. 👍
I think there is still more work to do, maybe in the follow-up pull requests:
- k0s testing;
- other operations implementation about k0s.
LGTM unless all review comments has been finished. and wish to see that we could iterate quickly with small steps. @starComingup
What is more, I think we could add a design document about different cluster runtime support into the sealer docs directory, which could also be a follow-up pull request. @starComingup
What is more, I think we could add a design document about different cluster runtime support into the sealer docs directory, which could also be a follow-up pull request. @starComingup
OK, I will keep this in mind and after k0s、k3s all finished and stable, I would like to design it with use cases.
LGTM, and this is related to https://github.com/sealerio/basefs/pull/23 . Please help complete the k3s other part. @starComingup