Skip to content
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

Move host-network services off of port 8080 #9355

Merged
merged 2 commits into from
Jun 16, 2020

Conversation

johngmyers
Copy link
Member

I am unable to test the node-local-dns change.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 13, 2020
@@ -129,7 +130,7 @@ func (s *healthCheckServer) proxyRequest(w http.ResponseWriter, forwardRequest *
}

func run() error {
listen := ":8080"
listen := fmt.Sprintf(":%d", wellknownports.KubeAPIServerHealthCheck)
Copy link
Member

Choose a reason for hiding this comment

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

Just to make sure, does the health check have to listen to all ips? I did a quick check to see where reqs were coming from and seemed to be all localhost. It was a very quick test though.

Copy link
Member Author

Choose a reason for hiding this comment

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

This PR is not changing that aspect.

Copy link
Member

Choose a reason for hiding this comment

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

Fair enough

@@ -129,7 +130,7 @@ func (s *healthCheckServer) proxyRequest(w http.ResponseWriter, forwardRequest *
}

func run() error {
listen := ":8080"
listen := fmt.Sprintf(":%d", wellknownports.KubeAPIServerHealthCheck)
Copy link
Member

Choose a reason for hiding this comment

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

Fair enough

@@ -14233,7 +14233,7 @@ data:
force_tcp
}
prometheus :9253
health {{ KubeDNS.NodeLocalDNS.LocalIP }}:8080
health {{ KubeDNS.NodeLocalDNS.LocalIP }}:{{ NodeLocalDNSHealthCheck }}
Copy link
Member

Choose a reason for hiding this comment

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

I was wondering if this should be configurable in the cluster spec. Then you can use the well-known port as default in components/kubedns.go instead of adding the template function. Just a thought.

Copy link
Member Author

Choose a reason for hiding this comment

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

What is the use case for making this port configurable?

Incidentally, I wonder if we could have kops automatically default the value of clusterDNS in kubelet and masterKubelet to 169.254.20.10 when needed rather than just mentioning it in documentation.

Copy link
Member

Choose a reason for hiding this comment

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

Well. Both can conflict with other things, so it isn't unreasonable to have this configurable, I think.

Copy link
Member Author

Choose a reason for hiding this comment

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

Our approach is to reserve ports in wellknownports. If anything else runs in host network and conflicts with those, the other things are what have to move.

Copy link
Member

Choose a reason for hiding this comment

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

It is still a breaking change in kops. That said, it is something we need to do, so maybe we should just reserve a range of ports for kops usage.

I think it's a good idea also to make it as easy as possible to turn on NodeLocalDNS as possible. Can we change the defaulting logic when nodelocal dns is enabled, but continue to honor an explicit value if the user sets one?

@olemarkus
Copy link
Member

Can confirm that this fixes #9245

@@ -126,7 +127,7 @@ spec:
func (b *KubeApiserverBuilder) buildHealthcheckSidecar() (*corev1.Pod, error) {
// TODO: pull from bundle
bundle := "(embedded kube-apiserver-healthcheck manifest)"
manifest := []byte(defaultManifest)
manifest := []byte(fmt.Sprintf(defaultManifest, wellknownports.KubeAPIServerHealthCheck))
Copy link
Member

Choose a reason for hiding this comment

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

Nit: I normally try to avoid using Sprintf with our templates, favoring {{ HealthCheckPort }} and strings.ReplaceAll, because the %d is harder to read, and has more gotchas (repeated placeholders don't work, it's vaguely possible that a % placeholder could appear 'accidentally')

@@ -14233,7 +14233,7 @@ data:
force_tcp
}
prometheus :9253
health {{ KubeDNS.NodeLocalDNS.LocalIP }}:8080
health {{ KubeDNS.NodeLocalDNS.LocalIP }}:{{ NodeLocalDNSHealthCheck }}
Copy link
Member

Choose a reason for hiding this comment

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

It is still a breaking change in kops. That said, it is something we need to do, so maybe we should just reserve a range of ports for kops usage.

I think it's a good idea also to make it as easy as possible to turn on NodeLocalDNS as possible. Can we change the defaulting logic when nodelocal dns is enabled, but continue to honor an explicit value if the user sets one?

@justinsb
Copy link
Member

Looks good to me; one nit that %d in a template is maybe hard to use; one idea as to whether we should pre-reserve a range of ports to avoid collisions.

/approve
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 16, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: johngmyers, justinsb

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 16, 2020
@hakman
Copy link
Member

hakman commented Jun 16, 2020

/retest

@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

1 similar comment
@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@johngmyers
Copy link
Member Author

/retest

1 similar comment
@johngmyers
Copy link
Member Author

/retest

@johngmyers
Copy link
Member Author

@justinsb I thought pkg/wellknownports was us reserving a range of ports for kops. We perhaps might be more explicit about reserving ~3900-4099 for kops use.

I do think we should enable NodeLocalDNS by default when using CoreDNS.

@k8s-ci-robot k8s-ci-robot merged commit eb39ab7 into kubernetes:master Jun 16, 2020
@k8s-ci-robot k8s-ci-robot added this to the v1.19 milestone Jun 16, 2020
@johngmyers johngmyers deleted the move-port branch June 16, 2020 16:10
k8s-ci-robot added a commit that referenced this pull request Jun 16, 2020
…55-upstream-release-1.18

Automated cherry pick of #9355: Move kube-apiserver-healthcheck to port 3990
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/documentation area/nodeup cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants