-
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
Adding hostname to groups discovery information #20626
Adding hostname to groups discovery information #20626
Conversation
Labelling this PR as size/XS |
GCE e2e test build/test passed for commit 8607da2200e16a68fb9004c8d56f4b4e793df2ec. |
GCE e2e test build/test passed for commit 64b6b8cf1ba86ecf83cbd1b473befba39a234589. |
Can you also add the master change needed to populate this field? I think you want that in 1.2, also. |
64b6b8c
to
23093cc
Compare
Labelling this PR as size/M |
@@ -298,6 +298,8 @@ const ( | |||
// +protobuf.options.(gogoproto.goproto_stringer)=false | |||
type APIVersions struct { | |||
TypeMeta `json:",inline"` | |||
// public hostname of the server that is serving this group. | |||
PublicHostname string `json:"publicHostname"` |
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.
I'd like to be consistent with service terminology, which is "External" rather than "Public":
https://github.com/kubernetes/kubernetes/blob/master/pkg/api/v1/types.go#L1740
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.
And are we also going to want the 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.
And path prefix?
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.
And would we want to allow an IP?
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.
Will change to External.
Yes, it can have IP and port as well.
Do we want to call it public? What does "public" mean? Do we use "public" On Thu, Feb 4, 2016 at 3:09 PM, Nikhil Jindal notifications@github.com
|
You are right @smarterclayton. @bgrant0607 also said the same thing. He suggested renaming public to external (which is what we use in ServiceSpec: https://github.com/kubernetes/kubernetes/blob/master/pkg/api/v1/types.go#L1740). But on discussing further with @lavalamp and @bgrant0607, we decided to replace the external address field with a CIDRToAddressMap. |
GCE e2e test build/test passed for commit 56557fbe7f70e30869d2e66aca7ef8dbe1ecac76. |
Wow.... that's... interesting. It uh... is certainly flexible.... :) On Thu, Feb 4, 2016 at 7:43 PM, Kubernetes Bot notifications@github.com
|
Will this map to IPv6 cleanly? On Thu, Feb 4, 2016 at 7:49 PM, Clayton Coleman ccoleman@redhat.com wrote:
|
It looks like you have the wrong port on the external address, I thought 6443 was the one we listen on, but we actually should be advertising 443? I forget how it's connected. |
@@ -321,6 +323,15 @@ type APIGroup struct { | |||
// preferredVersion is the version preferred by the API server, which | |||
// probably is the storage version. | |||
PreferredVersion GroupVersionForDiscovery `json:"preferredVersion,omitempty"` | |||
// a map of CIDR to address of the server that is serving this group. Clients can use the appropriate address as per the CIDR that they match. | |||
CIDRToAddressMap []CIDRToAddress `json:"cidrToAddressMap"` |
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.
@thockin we need you to bless this type.
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.
How about ServerAddressByClientCIDR?
I believe CIDRs are still things for IPv6, so it should. Also this would On Thu, Feb 4, 2016 at 4:49 PM, Clayton Coleman notifications@github.com
|
I'm ok with the map, I don't know how humans will understand it (it's awful On Thu, Feb 4, 2016 at 8:03 PM, Daniel Smith notifications@github.com
|
56557fb
to
f178c16
Compare
Updated to use ServiceReadWritePort instead of ReadWritePort which switched the address to use 443 instead of 6443 port. |
GCE e2e build/test failed for commit f178c1631a9f26d55a7f98fcbbce3fb25b59a289. |
hdrRealIp := hdr.Get("X-Real-Ip") | ||
if hdrRealIp != "" { | ||
ip := net.ParseIP(hdrRealIp) | ||
return ip |
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.
If ip is nil here, I think you should keep going also.
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.
Done
641d34c
to
00b1fd9
Compare
Renamed ServerAddressByClientCIDRMap to ServerAddressByClientCIDRs and pushed updated code as per comments. |
GCE e2e test build/test passed for commit 641d34ca3647ccbb6b753dda06af3270fbc99d30. |
GCE e2e build/test failed for commit c1c0dcc7bd815e064fd8d29c03b74c489c98e3cb. |
GCE e2e test build/test passed for commit 00b1fd9de3217a74c3c7a44e4dda168e13d2363c. |
PR needs rebase |
LGTM |
00b1fd9
to
20ce4ae
Compare
Rebased. Readding the LGTM tag |
GCE e2e test build/test passed for commit 20ce4ae. |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
GCE e2e test build/test passed for commit 20ce4ae. |
Automatic merge from submit-queue |
Auto commit by PR queue bot
Added the release note label |
Automatic merge from submit-queue Fixing logic to generate ExternalHost in genericapiserver @ncdc pointed it out (https://kubernetes.slack.com/archives/sig-api-machinery/p1464974528000139) that lines 305 and 306 dont match. We should be using ReadWritePort instead of ServiceReadWritePort in line 306. #20626 seems to be the culprit PR.
Based on #20358 (comment)
Ref #20229
Adding a publicHostname field to groups discovery information.
To be used by dynamic client talking to a cluster with federated api servers.
cc @bgrant0607 @lavalamp @smarterclayton @kubernetes/sig-api-machinery