Add Host field to TCPSocketAction

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.
This commit is contained in:
Lou Yihua
2017-03-11 02:34:31 +08:00
parent 5e29e1ee05
commit 63f1b077dc
4 changed files with 13 additions and 3 deletions

View File

@@ -1391,6 +1391,9 @@ type TCPSocketAction struct {
// Required: Port to connect to.
// +optional
Port intstr.IntOrString
// Optional: Host name to connect to, defaults to the pod IP.
// +optional
Host string
}
// ExecAction describes a "run in container" action.