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

Integrate ip_vs_mh scheduler into kube-router #564

Merged
merged 3 commits into from
Nov 12, 2018

Conversation

inju-song
Copy link
Contributor

Implement #554

kube-router supports setting ip_vs_mh scheduler.

  • usage: kube-router.io/service.scheduler: mh

ip_vs_mh provides two scheduler flags.

  • flag-1: destiantion fallback
  • flag-2: source hashing with address and port

(Please see here for ip_vs_mh details)

So I add a service annotation feature to set ip_vs_mh with the flags through kube-router.

  • usage: kube-router.io/service.schedflags: flag-1 or flag-1, flag-2
  • Any combination of these flags are available .

If the ip_vs_mh is set with scheduler flags, you can see the ipvs service like below.

TCP  172.24.3.177:80 mh (flag-1,flag-2)

@murali-reddy
Copy link
Member

thanks @inju-song for your work on kernel support for Maglev hashing and integration into kube-router.

Could you please point to me details on the kernel requirements and also how to test the hashing?

@inju-song
Copy link
Contributor Author

@murali-reddy
ip_vs_mh is integrated into kernel since v4.18, so the required kernel version is v4.18 or later for using ip_vs_mh.

You can test ip_vs_mh by setting some annotations in kubernetes service like below.

For maglev hashing scheduling use:
kubectl annotate service my-service "kube-router.io/service.scheduler=mh"

For maglev hashing scheduling flags use:
kubectl annotate service my-service "kube-router.io/service.schedflags=flag-1, flag-2"

The flags can be set only when mh scheduler is set. If the scheduler is not set, setting flags will be ignored. Of course, only one flag can be set also.

It also supports tunnel forwarding mode, so we can use ip_vs_mh in dsr mode. However ipvsAddFWMarkService() only can set rr when dsr mode service created at first time, you should update mh schedule after setting extrenalIP and dsr annotation for using mh in tunnel mode.

@murali-reddy murali-reddy merged commit cf9bf47 into cloudnativelabs:master Nov 12, 2018
@murali-reddy
Copy link
Member

murali-reddy commented Nov 12, 2018

LGTM.

@inju-song thanks for the PR

I will try to explore the possibilities of kube-router DSR functionality along with Maglev hashing.

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