-
Notifications
You must be signed in to change notification settings - Fork 40k
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
kubeadm: Turn off insecure apiserver access on localhost:8080 #42066
kubeadm: Turn off insecure apiserver access on localhost:8080 #42066
Conversation
cmd/kubeadm/app/master/manifests.go
Outdated
@@ -304,7 +304,7 @@ func getAPIServerCommand(cfg *kubeadmapi.MasterConfiguration, selfHosted bool) [ | |||
} | |||
|
|||
command = append(getComponentBaseCommand(apiServer), | |||
"--insecure-bind-address=127.0.0.1", | |||
"--insecure-port=0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this disable or randomly selects a port?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to get the "randomly selects a port" behavior? It would be useful for testing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to get the "randomly selects a port" behavior? It would be useful for testing.
I think that belongs outside this layer. See https://github.com/kubernetes/kubernetes/pull/42059/files#diff-a8c1e5100912cb27840594582aa0904bR66 as an example of how to wire it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TBH -- this is a little confusing. Generally setting a port to 0 means "randomly select port". But that isn't a kubeadm issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
This one also depends on #41882 |
Applying lgtm given the general consensus in the Slack discussion, but this depends on two PRs in the Submit Queue yet, so it can't/shouldn't be merged until this one can rebase upon them |
cmd/kubeadm/app/master/manifests.go
Outdated
@@ -304,7 +304,7 @@ func getAPIServerCommand(cfg *kubeadmapi.MasterConfiguration, selfHosted bool) [ | |||
} | |||
|
|||
command = append(getComponentBaseCommand(apiServer), | |||
"--insecure-bind-address=127.0.0.1", | |||
"--insecure-port=0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TBH -- this is a little confusing. Generally setting a port to 0 means "randomly select port". But that isn't a kubeadm issue.
The release note should specify that this is for kubeadm only. Also -- have you tested this? With 1.5, the admission controllers talk to the api server via a loopback address. They use the insecure port by default. If the insecure port is turned off you need to specify a new flag (the poorly named |
That is no longer necessary. We ensure the loopback connection is secured without the user having to provide a localhost cert. |
Admission, controllers, and scheduler are all running against the secured port in CI, but agree that this needs to be tested specifically with kubeadm |
eb5d45c
to
e6f2457
Compare
Removing do-not-merge on this. |
@k8s-bot gce etcd3 e2e test this |
This is super exciting. |
e6f2457
to
3f59284
Compare
Removing do-not-merge since #41772 is merged, this one is rebased and ready to merge! |
[APPROVALNOTIFIER] This PR is APPROVED The following people have approved this PR: jbeda, luxas Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
@k8s-bot test this |
Automatic merge from submit-queue |
What this PR does / why we need it:
ref: kubernetes/kubeadm#181
depends on: #41897
Which issue this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close that issue when PR gets merged): fixes #Special notes for your reviewer:
Release note:
@jbeda @liggitt @deads2k @pires @lukemarsden @mikedanese @errordeveloper