-
Notifications
You must be signed in to change notification settings - Fork 39.8k
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
Add Host field to TCPSocketAction #42902
Add Host field to TCPSocketAction #42902
Conversation
Hi @louyihua. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please follow instructions at https://github.com/kubernetes/kubernetes/wiki/CLA-FAQ to sign the CLA. Once you've signed, please reply here (e.g. "I signed it!") and we'll verify. Thanks.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
[APPROVALNOTIFIER] This PR is NOT APPROVED The following people have approved this PR: louyihua Needs approval from an approver in each of these OWNERS Files: We suggest the following people: |
9cf4cf1
to
8b685cc
Compare
8b685cc
to
2c718e8
Compare
2c718e8
to
c0abd6c
Compare
@k8s-bot tell me a joke |
@louyihua: What do you call a fake noodle? An impasta. In response to this comment:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
@smarterclayton |
@kubernetes/sig-network-pr-reviews ptal |
We generally recommend keeping real code changes and autogenerated changes in separate commit for easier reviewing. This is an API change so cc @kubernetes/api-reviewers. Assigning to @thockin to triage since this a network related API change. |
@k8s-bot ok to test |
2a5cec5
to
51fbf95
Compare
51fbf95
to
8155931
Compare
Always fail on the aws e2e with strange error :( |
I would also add: diff --git a/pkg/kubectl/describe.go b/pkg/kubectl/describe.go
index 0359b9c..c63654d 100644
--- a/pkg/kubectl/describe.go
+++ b/pkg/kubectl/describe.go
@@ -1123,7 +1123,7 @@ func DescribeProbe(probe *api.Probe) string {
url.Path = probe.HTTPGet.Path
return fmt.Sprintf("http-get %s %s", url.String(), attrs)
case probe.TCPSocket != nil:
- return fmt.Sprintf("tcp-socket :%s %s", probe.TCPSocket.Port.String(), attrs)
+ return fmt.Sprintf("tcp-socket %s:%s %s", probe.TCPSocket.Host, probe.TCPSocket.Port.String(), attrs)
}
return fmt.Sprintf("unknown %s", attrs)
} |
Currently, TCPSocketAction always uses Pod's IP in connection. But when a pod uses the host network, sometimes firewall rules may prevent kubelet from connecting through the Pod's IP. This PR introduces the 'Host' field for TCPSocketAction, and if it is set to non-empty string, the probe will be performed on the configured host rather than the Pod's IP. This gives users an opportunity to explicitly specify 'localhost' as the target for the above situations.
8155931
to
64f2b0c
Compare
@jwendell |
@louyihua no problem. I was also working on that feature, for the last 3 days at least, and just saw this PR. The only difference to my work was that chunk above. |
@thockin |
Automatic merge from submit-queue (batch tested with PRs 42998, 42902, 42959, 43020, 42948) |
Currently, TCPSocketAction always uses Pod's IP in connection. But when a pod uses the host network, sometimes firewall rules may prevent kubelet from connecting through the Pod's IP.
This PR introduces the 'Host' field for TCPSocketAction, and if it is set to non-empty string, the probe will be performed on the configured host rather than the Pod's IP. This gives users an opportunity to explicitly specify 'localhost' as the target for the above situations.