From 05af66ef77a3fc7464687139d7b6963f2e9b540b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=87=E6=85=95?= Date: Tue, 17 Oct 2017 10:11:59 +0800 Subject: [PATCH 1/3] update hostport doc --- docs/concepts/configuration/overview.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/concepts/configuration/overview.md b/docs/concepts/configuration/overview.md index f9151eca8c..27fbc350eb 100644 --- a/docs/concepts/configuration/overview.md +++ b/docs/concepts/configuration/overview.md @@ -45,7 +45,9 @@ This is a living document. If you think of something that is not on this list bu 2. Create a service; 3. Then scale up the replication controller. -- Don't use `hostPort` unless it is absolutely necessary (for example: for a node daemon). It specifies the port number to expose on the host. When you bind a Pod to a `hostPort`, there are a limited number of places to schedule a pod due to port conflicts— you can only schedule as many such Pods as there are nodes in your Kubernetes cluster. +- Don't use `hostPort` unless it is absolutely necessary (for example: for a node daemon). It specifies the port number to expose on the host. When you bind a Pod to a `hostPort`, there are a limited number of places to schedule a pod due to port conflicts. The conflict comes from being limited to a single `hostIP:hostPort:protocol` combination. Different `hostIP:hostPort:protocol` combinations mean different requirements. For example, a pod that binds tcp 80 host port on 127.0.0.1 does not conflict with another pod that binds tcp 80 port on 127.0.0.2. + + Special notes on hostIP and protocol, if you don't specify the hostIP and protocol explicitly, kubernetes will give you 0.0.0.0 and tcp as default hostIP and protocol. And "0.0.0.0" is a wildcard hostIP that will occupy all <_,hostPort,protocol> on the node the pod is scheduled on. Specifically, it will occupy all for all IPs on the host. If you only need access to the port for debugging purposes, you can use the [kubectl proxy and apiserver proxy](/docs/tasks/access-kubernetes-api/http-proxy-access-api/) or [kubectl port-forward](/docs/tasks/access-application-cluster/port-forward-access-application-cluster/). You can use a [Service](/docs/concepts/services-networking/service/) object for external service access. From 3f98c8bd2aa6095975c15a0a7e0ec5d1470ce0f2 Mon Sep 17 00:00:00 2001 From: Qiming Date: Mon, 27 Nov 2017 20:28:44 +0800 Subject: [PATCH 2/3] Update overview.md --- docs/concepts/configuration/overview.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/docs/concepts/configuration/overview.md b/docs/concepts/configuration/overview.md index 27fbc350eb..c3673a1386 100644 --- a/docs/concepts/configuration/overview.md +++ b/docs/concepts/configuration/overview.md @@ -45,9 +45,17 @@ This is a living document. If you think of something that is not on this list bu 2. Create a service; 3. Then scale up the replication controller. -- Don't use `hostPort` unless it is absolutely necessary (for example: for a node daemon). It specifies the port number to expose on the host. When you bind a Pod to a `hostPort`, there are a limited number of places to schedule a pod due to port conflicts. The conflict comes from being limited to a single `hostIP:hostPort:protocol` combination. Different `hostIP:hostPort:protocol` combinations mean different requirements. For example, a pod that binds tcp 80 host port on 127.0.0.1 does not conflict with another pod that binds tcp 80 port on 127.0.0.2. +- Don't use `hostPort` unless it is absolutely necessary (for example: for a node daemon). + It specifies the port number to expose on the host. + When you bind a Pod to a `hostPort`, there are a limited number of places to schedule a pod due to port conflicts. + The conflict comes from the requirement of an unique combination. + Different combinations mean different requirements. + For example, a pod that binds to host port 80 on 127.0.0.1 with TCP protocol has no conflict with another Pod that binds to host port 80 on 127.0.0.2 with TCP protocol. - Special notes on hostIP and protocol, if you don't specify the hostIP and protocol explicitly, kubernetes will give you 0.0.0.0 and tcp as default hostIP and protocol. And "0.0.0.0" is a wildcard hostIP that will occupy all <_,hostPort,protocol> on the node the pod is scheduled on. Specifically, it will occupy all for all IPs on the host. + *Special notes on hostIP and protocol*: If you don't specify the hostIP and protocol explicitly, + kubernetes will give you 0.0.0.0 and tcp as the default hostIP and protocol, + where "0.0.0.0" is a wildcard IP that will match all <*,hostPort,protocol> on the node the pod is scheduled on. + Specifically, it will match all tuples for all IPs on the host. If you only need access to the port for debugging purposes, you can use the [kubectl proxy and apiserver proxy](/docs/tasks/access-kubernetes-api/http-proxy-access-api/) or [kubectl port-forward](/docs/tasks/access-application-cluster/port-forward-access-application-cluster/). You can use a [Service](/docs/concepts/services-networking/service/) object for external service access. From 4d77e7993f875c7bf355e4305e5e0ceaf99e5ea3 Mon Sep 17 00:00:00 2001 From: Qiming Date: Mon, 27 Nov 2017 20:30:10 +0800 Subject: [PATCH 3/3] Update overview.md --- docs/concepts/configuration/overview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/concepts/configuration/overview.md b/docs/concepts/configuration/overview.md index c3673a1386..fb045fbfab 100644 --- a/docs/concepts/configuration/overview.md +++ b/docs/concepts/configuration/overview.md @@ -53,7 +53,7 @@ This is a living document. If you think of something that is not on this list bu For example, a pod that binds to host port 80 on 127.0.0.1 with TCP protocol has no conflict with another Pod that binds to host port 80 on 127.0.0.2 with TCP protocol. *Special notes on hostIP and protocol*: If you don't specify the hostIP and protocol explicitly, - kubernetes will give you 0.0.0.0 and tcp as the default hostIP and protocol, + kubernetes will use 0.0.0.0 and TCP as the default hostIP and protocol, where "0.0.0.0" is a wildcard IP that will match all <*,hostPort,protocol> on the node the pod is scheduled on. Specifically, it will match all tuples for all IPs on the host.