sealer icon indicating copy to clipboard operation
sealer copied to clipboard

feature: k0s init, import some dependencies form k0sproject.

Open starComingup opened this issue 2 years ago • 2 comments

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.

starComingup avatar Aug 05 '22 09:08 starComingup

I use go mod tidy, but it seems so many dependencies imported.

starComingup avatar Aug 05 '22 09:08 starComingup

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.

allencloud avatar Aug 10 '22 03:08 allencloud

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

allencloud avatar Aug 11 '22 08:08 allencloud

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

allencloud avatar Aug 12 '22 02:08 allencloud

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.

starComingup avatar Aug 12 '22 02:08 starComingup

LGTM, and this is related to https://github.com/sealerio/basefs/pull/23 . Please help complete the k3s other part. @starComingup

allencloud avatar Aug 14 '22 12:08 allencloud