Document better why we use hostPort on node-exporter

Signed-off-by: ArthurSens <arthursens2005@gmail.com>
This commit is contained in:
ArthurSens
2022-02-02 22:56:43 +00:00
parent 755d27bb46
commit fb92a6dbe0
2 changed files with 7 additions and 1 deletions

View File

@@ -201,6 +201,12 @@ function(params) {
// used by the service is tied to the proxy container. We *could*
// forgo declaring the host port, however it is important to declare
// it so that the scheduler can decide if the pod is schedulable.
//
// Although hostPort might not seem necessary, kubernetes adds it anyway
// when running with 'hostNetwork'. We might as well make sure it works
// the way we want.
//
// See also: https://github.com/kubernetes/kubernetes/blob/1945829906546caf867992669a0bfa588edf8be6/pkg/apis/core/v1/defaults.go#L402-L411
ports: [
{ name: 'https', containerPort: ne._config.port, hostPort: ne._config.port },
],