-
Notifications
You must be signed in to change notification settings - Fork 39.7k
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
apiserver: get rid of ReadWritePort in config #65830
apiserver: get rid of ReadWritePort in config #65830
Conversation
@sttts: Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
0ba9dad
to
759f6e5
Compare
@sttts: Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
pkg/master/controller.go
Outdated
@@ -79,6 +79,15 @@ type Controller struct { | |||
|
|||
// NewBootstrapController returns a controller for watching the core capabilities of the master | |||
func (c *completedConfig) NewBootstrapController(legacyRESTStorage corerest.LegacyRESTStorage, serviceClient coreclient.ServicesGetter, nsClient coreclient.NamespacesGetter, eventClient coreclient.EventsGetter) *Controller { | |||
publicServicePort := 443 // this is the legacy behaviour. Without a secure port, we cannot serve the kubernetes service correctly though. |
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.
This seems weird. If we require it, why not simply fail early if we have no secure 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.
just replicating the old behaviour here. Am fine with failing as well. In other words: do not allow zero with --secure-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.
What's the behavior previously when --secure-port
is set to 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.
Then https://github.com/kubernetes/kubernetes/pull/65830/files#diff-01f8ed603e3f5cc358d0394c0ab0cb00L51 was skipped and the default value of 443 was staying.
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.
Yes, I tested this. And it is really not grace. In this case, kube-apiserver creates kubernetes service and with its own endpoints, but can not access.
In other words: do not allow zero with --secure-port.
+1
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.
Fixed
4835dad
to
3595746
Compare
host = net.JoinHostPort(host, strconv.Itoa(port)) | ||
} else { | ||
// last way out: 443. This is the legacy behaviour for this case. | ||
host = net.JoinHostPort(host, strconv.Itoa(443)) |
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.
Can we error here in instead?
if s == nil || s.Listener == nil { | ||
return "", 0, fmt.Errorf("no listener found") | ||
} | ||
host, portStr, err := net.SplitHostPort(s.Listener.Addr().String()) |
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.
lost this error.
minor comments, lgtm otherwise, but the lost error needs handling. |
6dcc9a4
to
15e7b0f
Compare
f980b50
to
a06de13
Compare
a06de13
to
6bb3aba
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: deads2k, sttts 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 |
/test all [submit-queue is verifying that this PR is safe to merge] |
/test pull-kubernetes-e2e-kops-aws |
@sttts: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
Automatic merge from submit-queue (batch tested with PRs 65830, 65780, 65961). If you want to cherry-pick this change to another branch, please follow the instructions here. |
/cc @caesarxuchao |
Executing removal TODO by making the read write port logic explicit, and not hidden deep in the secure serving code.
Preparation for #65832