Skip to content
This repository has been archived by the owner on Dec 20, 2024. It is now read-only.

feature: get LocalIP from supernode HTTP _ping API first rather than … #1402

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Komey
Copy link
Contributor

@Komey Komey commented Jun 28, 2020

feature: get LocalIP from supernode HTTP _ping API first rather than TCP connection due to Kube-service in ipvs-mod will get cluster IP for LocalAddr

Ⅰ. Describe what this PR did

  1. supernode _ping API will return remote address
  2. dfclient will query supernode/_ping to get localIP
  3. if the localIP not in dfclient network interfaces will fallback to use TCP Dial connection

Ⅱ. Does this pull request fix one issue?

fixes #1399

Ⅲ. Why don't you add test cases (unit test/integration test)? (你真的觉得不需要加测试吗?)

×

Ⅳ. Describe how to verify it

  1. k8s cluster within kube-proxy run in ipvs mod
  2. dfclient connect to supernode in service cluster ip
  3. dfclient will get log like Connect to supernode get self IP: %s

Ⅴ. Special notes for reviews

…TCP connection due to Kube-service in ipvs-mod will get cluster IP for LocalAddr

Signed-off-by: komey <[email protected]>
Signed-off-by: komey <[email protected]>
Signed-off-by: komey <[email protected]>
if code, body, e = api.HTTPClient.Get(url, api.Timeout); e != nil {
return "", e
}
if !httputils.HTTPStatusOk(code) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the StatusOK(200) the only case to judge whether a node could be pinged?

I don't think we should use HTTP protocol (which is level 7) to test the connection.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dfget got Supernode’s Service Cluster IP as peer ip in k8s cluster
3 participants