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

feature(main): join nodes for k3s #3944

Merged
merged 4 commits into from
Sep 25, 2023
Merged

Conversation

cuisongliu
Copy link
Collaborator

@cuisongliu cuisongliu commented Sep 17, 2023

🤖 Generated by Copilot at 14e472d

Summary

✨♻️🔧

This pull request adds IPVS load balancing for the API server in the k3s runtime and makes some code quality improvements. It updates the k3s package to sync the IPVS load balancer with the master IP list and to use a constant for the static pod path. It also modifies the kubeadm package to use the same static pod path parameter for the IPVS load balancer. It affects the files pkg/runtime/k3s/* and pkg/ssh/remote.go and pkg/runtime/kubernetes/runtime_getter.go.

We're sailing on the k3s cluster, with IPVS on the nodes
We'll sync the load balancer with the masters, as we go
We'll heave away the static pods, to the path that we choose
We'll sing a song of kubeadm and remoteUtils

Walkthrough

  • Import iputils package to use its functions for IP address handling (link)
  • Update /etc/hosts file on master nodes with API server domain name and IP address using remoteUtil.HostsAdd and iputils.GetHostIP (link, link)
  • Add functions to K3s struct to get API server port, master IP list with port, and VIP with port from k3s-init.yaml file or constants package (link)
  • Create static pod for IPVS load balancer on nodes using remoteUtil.IPVS or remoteUtil.StaticPod with lvscare image and k3sEtcStaticPod path (link, link, link, link, link)
  • Replace hard-coded value of 6443 with constants.DefaultAPIServerPort for HTTPSPort field of Config struct (link)
  • Remove unused function to get container runtime endpoint from Config struct (link)
  • Add constant value of k3sEtcStaticPod to k3s package (link)
  • Comment out code to replace API server address in admin.config file as it is already set in k3s-init.yaml file and /etc/hosts file (link)

@sealos-ci-robot
Copy link
Member

sealos-ci-robot commented Sep 17, 2023

🤖 Generated by lychee action

Summary

Status Count
🔍 Total 977
✅ Successful 392
⏳ Timeouts 8
🔀 Redirected 0
👻 Excluded 576
❓ Unknown 0
🚫 Errors 0

Errors per input

Errors in docs/4.0/i18n/zh-Hans/examples/baas/install-fireboom.md

Errors in docs/4.0/i18n/zh-Hans/quick-start/app-deployments/use-a-template.md

Errors in docs/4.0/i18n/zh-Hans/quick-start/app-deployments/use-app-launchpad.md

Errors in docs/4.0/i18n/zh-Hans/quick-start/app-deployments/use-terminal.md

Errors in docs/4.0/docs/examples/baas/install-fireboom.md

Errors in docs/4.0/i18n/zh-Hans/quick-start/app-deployments/install-db-with-database.md

Full action output

Full Github Actions output

@cuisongliu cuisongliu mentioned this pull request Sep 17, 2023
8 tasks
@codecov
Copy link

codecov bot commented Sep 17, 2023

Codecov Report

Patch has no changes to coverable lines.

📢 Thoughts on this report? Let us know!.

@cuisongliu
Copy link
Collaborator Author

image

@cuisongliu cuisongliu marked this pull request as draft September 17, 2023 11:39
@cuisongliu cuisongliu force-pushed the join_nodes branch 2 times, most recently from 72d8713 to f75317b Compare September 23, 2023 03:28
@pull-request-size pull-request-size bot added size/L and removed size/M labels Sep 23, 2023
@cuisongliu cuisongliu marked this pull request as ready for review September 23, 2023 06:55
@cuisongliu cuisongliu added this to the v4.4 milestone Sep 23, 2023
pkg/runtime/k3s/bootstrap.go Outdated Show resolved Hide resolved
pkg/runtime/k3s/k3s.go Outdated Show resolved Hide resolved
pkg/runtime/k3s/bootstrap.go Outdated Show resolved Hide resolved
pkg/runtime/k3s/lifecycle.go Outdated Show resolved Hide resolved
pkg/runtime/k3s/lifecycle.go Outdated Show resolved Hide resolved
pkg/ssh/remote.go Outdated Show resolved Hide resolved
Signed-off-by: cuisongliu <cuisongliu@qq.com>
Signed-off-by: cuisongliu <cuisongliu@qq.com>
Signed-off-by: cuisongliu <cuisongliu@qq.com>
Signed-off-by: cuisongliu <cuisongliu@qq.com>
@cuisongliu cuisongliu merged commit dd906fd into labring:main Sep 25, 2023
90 of 91 checks passed
@sealos-ci-robot
Copy link
Member

/cherry-pick release-v4.4

@sealos-ci-robot
Copy link
Member

🤖 says: cherry pick action finished successfully 🎉!
See: https://github.com/labring/sealos/actions/runs/6299198045

sealos-ci-robot pushed a commit that referenced this pull request Sep 25, 2023
@cuisongliu cuisongliu deleted the join_nodes branch September 25, 2023 14:23
bxy4543 pushed a commit to bxy4543/sealos that referenced this pull request Oct 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants