Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add k3s provisionning #1875

Merged
merged 1 commit into from
Mar 11, 2024
Merged

Conversation

DrummyFloyd
Copy link
Contributor

@DrummyFloyd DrummyFloyd commented Oct 29, 2023

So the Merge request is dropped at least for starting some review and some test from your side

what it's being made

  • CLI

    • add k3s support based on your new cli design (had to keep some args for compatibilty issue, could be managed in a another ways on next iteration)
    • some news args are used to manged K3S install from terraform
      - --k3s-extra-conf "--disable traefik,--write-kubeconfig-mode 0644,--flannel-iface eth1"
      - --k3s-servers-ips 10.0.0.11,10.0.0.12,10.0.0.13
      -~ --k3s-ssh-private-key ~/.ssh/id_ed25519~
      - --K3s-agents-ips (optionals if you want agent+ server
      - --k3s-ssh-user vagrant
    • --extra-servers-args
    • --servers-private-ips
    • --servers-public-ips usefulle when u have VPS/vm with public ip
    • --servers-private-ips LAN network eg: 192.168.1.20,192.168.1.21
    • --ssh-user
    • --ssh-privatekey

    NB1: i removed the agents CLI configuration, (for now), because i need to rethink how it will be done , i want to avoid, a huge CMD Line with infinite arguments and another process to deliver this PR. So to avoid wasting time searching a solution i prefer to split and give a functional K3S provisionning with only the k3s servers stuff , the k3s agents is postpone SO, i'll need to discuss with kubefirst team , but i may some solutions for the huge CMD CLI ( like a config file) , but obviously, will need to make that another PR before the k3s agent provisionning
    NB: i've also remove the --k3s-* awful prefix from arguments

  • kubefirst-api has been updated according to your logic Add k3s backend kubefirst-api#281

    • to use with the cli => go mod edit -replace github.com/kubefirst/kubefirst-api=../kubefirst-api
  • Gitops-Templates updated feat: add-k3s-scenario gitops-template#659

    • the YAML part is a copy from DigitalOcean template
    • the terraform part is a copy of the k3d tempalte
    • gitlab
    • github => will be done once gitlab is review and validated, essentially for all the YAML manifests

    is being tested with Virtual machine (made by Vagrant), whihch involved a not fully ended delivery by CLI, because i don"t have the possibility to expose my box to a DNS, so all the finalizes are blocked byt TLS-acme stuff
    but basically if went to this line

    // Wait for last sync wave app transition to Running
    log.Info("waiting for final sync wave Deployment to transition to Running")
    crossplaneDeployment, err := k8s.ReturnDeploymentObject(
    	kcfg.Clientset,
    	"app.kubernetes.io/instance",
    	"crossplane",
    	"crossplane-system",
    	3600,
    )
    ....

    https://github.com/DrummyFloyd/kubefirst-api/blob/fd69ab7fd02c58e5842ad9c20bc61161a3b8239e/providers/k3s/create.go#L188

    i assumed that quite everything is being done when we are here.

TODO

  • [x ] delete command
  • github template
  • define how S3 object will be stored => can be another iteration or made internally ?
  • move some functions in runtime or in another place like detokenize stuff or the use of vultr function for facility
  • website documentaion
  • make k3s agents provisionning
  • add a configfile to the CLI ( to discuss...)
    - [ ] add Metallb as LoadBalancer => remove to stay generic as possible, use servicelb from k3s

test

go run . beta k3s create --extra-args "--disable traefik,--write-kubeconfig-mode 0644" --alerts-email xxxx@gmail.com --domain-name feedkray.one --gitlab-group $GROUP_NAME/$SUBGROUP --git-provider gitlab --servers-private-ips 10.0.0.11,10.0.0.12,10.0.0.13 --servers-public-ip 90.100.1.0,....  --k3s-ssh-privatekey ~/.ssh/id_ed25519 --gitops-template-url https://github.com/DrummyFloyd/gitops-template.git --gitops-template-branch add-k3s-scenario --ssh-user vagrant

NB:: if you want my VagrantFile , do not hesitate!

have fun !

Resolves: #1748

@DrummyFloyd DrummyFloyd changed the title Add k3s new cli Add k3s provisionning Oct 29, 2023
@DrummyFloyd DrummyFloyd changed the title Add k3s provisionning feat: Add k3s provisionning Oct 29, 2023
@DrummyFloyd
Copy link
Contributor Author

DrummyFloyd commented Oct 29, 2023

still need to work on the Kubefirst-api => will be discuss in Slack

Done

CristhianF7
CristhianF7 previously approved these changes Mar 11, 2024
Signed-off-by: DrummyFloyd <jonathan.monnet28@gmail.com>
Copy link
Member

@johndietz johndietz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@jarededwards jarededwards merged commit 1db2022 into kubefirst:main Mar 11, 2024
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

K3s provisioning
4 participants