Skip to content

feat: auto create dummy link if needed #1367

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

Merged
merged 2 commits into from
Jul 21, 2022

Conversation

fengxsong
Copy link
Collaborator

automatic create a dummy network interface and bind virtual IP to it when any of real server is listening locally(by automatic dectection), setting this parameter to null will skip this behaviour.

Signed-off-by: fengxsong [email protected]

@codecov
Copy link

codecov bot commented Jul 21, 2022

Codecov Report

Merging #1367 (788b379) into main (7273d12) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main    #1367   +/-   ##
=======================================
  Coverage   53.09%   53.09%           
=======================================
  Files           5        5           
  Lines         420      420           
=======================================
  Hits          223      223           
  Misses        181      181           
  Partials       16       16           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7273d12...788b379. Read the comment docs.

@fengxsong
Copy link
Collaborator Author

The usage scenario is that we want to use lvscare static pod to do load balancing on the control plane. Without this function, we must maintained net link manually, like

# setup
sudo ip link add dev lvscare type dummy
sudo ip addr add 10.54.0.2/32 dev lvscare
# cleanup
sudo ip link delete lvscare

If these rules are missing, when ipvs forwards tcp requests to the real backend on the local machine, no route to host error will occured.

@@ -42,6 +43,9 @@ func (care *LvsCare) RegisterFlags(fs *pflag.FlagSet) {
fs.BoolVar(&care.RunOnce, "run-once", false, "run once mode, creating ipvs rules and routes and exit")
fs.StringVar(&care.VirtualServer, "vs", "", "virtual server like 10.54.0.2:6443")
fs.StringSliceVar(&care.RealServer, "rs", []string{}, "real server like 192.168.0.2:6443")
fs.StringVar(&care.IfaceName, "iface", "lvscare", "name of interface to created if needed, "+
Copy link
Collaborator

Choose a reason for hiding this comment

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

The default is empty. If not, it may affect the function.

@cuisongliu cuisongliu merged commit c0771cf into labring:main Jul 21, 2022
@fengxsong fengxsong deleted the feat_lvscare_create_dummy_iface branch July 21, 2022 11:44
cuisongliu added a commit to cuisongliu/sealos that referenced this pull request Jul 21, 2022
* Update go1.18 to support workspace (labring#1350)

* Update go1.18 to support workspace

Signed-off-by: zzjin <[email protected]>

* fix linter vendor

Signed-off-by: zzjin <[email protected]>

* update develop guide about workspace. (labring#1352)

Signed-off-by: zzjin <[email protected]>

* refactor: clean flag of lvscare (labring#1354)

* refactor: clean flag of lvscare

Signed-off-by: fengxsong <[email protected]>

* fix: ci lints

Signed-off-by: fengxsong <[email protected]>

* docs: remove badges for lvscare (labring#1358)

Signed-off-by: Mercurio <[email protected]>

* ci: fix sync_code trigger paths (labring#1360)

Signed-off-by: Mercurio <[email protected]>

* fix(main): delete logger for isLocal (labring#1359)

Signed-off-by: cuisongliu <[email protected]>

* fix(main): sync is exists (labring#1361)

Signed-off-by: cuisongliu <[email protected]>

* add & init sealos desktop frontend project (labring#1357)

* init frontend project

* impl part of  dashboard page layout

* logger support fulltext color (labring#1362)

* support service modules: auth (labring#1347)

1. add first auth service
2. update workspace to support service/auth
3. move soem code to auth pkg and auth service

Signed-off-by: zzjin <[email protected]>

* feature(main): local ip not ping (labring#1363)

Signed-off-by: cuisongliu <[email protected]>

* feat: auto create dummy link if needed (labring#1367)

* feat: auto create dummy link if needed

Signed-off-by: fengxsong <[email protected]>

* fix: make iface arg defaults to empty

Signed-off-by: fengxsong <[email protected]>

* fix(main): unexpected end of file (labring#1372)

* update pull request template to supress showing (labring#1371)

Signed-off-by: zzjin <[email protected]>

* perf: singleton just fine (labring#1374)

Signed-off-by: fengxsong <[email protected]>

Co-authored-by: zzjin <[email protected]>
Co-authored-by: fengxsong <[email protected]>
Co-authored-by: Mercurio <[email protected]>
Co-authored-by: cuisongliu <[email protected]>
Co-authored-by: 马斯洛 <[email protected]>
Co-authored-by: xuehaipeng <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants