-
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
federated api servers: Adding a discovery summarizer server #20358
federated api servers: Adding a discovery summarizer server #20358
Conversation
dfa7ef8
to
53d0cf9
Compare
@k8s-bot ok to test |
@lavalamp Can you please take a look once? For now, I have redefined the discovery types in I redefined the type instead of changing the existing one since that is unversioned and I did not want to make too many changes to that. WDYT? |
// The IP address of the server that is serving this group. | ||
// TODO: Support returning both internal and external IP addresses: | ||
// http://issues.k8s.io/20229 | ||
ServerIP string `json:"serverIP"` |
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.
Why are we assuming this is an API address. This should be a HostName that can also be 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.
you are right. Will rename to HostName
I don't like summarizer and server not having the same types. I think that defeats the purpose of this API originally, which is that clients just hit a discovery doc. Having two... isn't much discovery. |
Yeah, I agree, I think it has to have the same types. But the concern is that we're stuck with whatever we add, so we'd better get it right. |
ok then, how about I add Does that sound good? |
0f1dafa
to
a9def28
Compare
Have updated the code so that the summarizer now reads a list of serverAddresses and list of paths exposed by each server. It then fetches the groups exposed by all servers and provides a summarized view. Groups exposed at same path by multiple servers are summarized together at same path. For ex: if there are 2 servers: one supporting /api and /apis and other supporting /oapi and /apis, then the summarizer will support 3 paths: /api which will list resources from server1/api; /apis which will list resources from both - server1/apis and server2/apis; and /oapi which will list resources from server2/oapi. In future, we can easily extend the FederatedAPIServer struct to include the list of groupVersions themselves, in which case the summarizer will use that list rather than fetching the group versions from the server. @lavalamp @smarterclayton PTAL |
a9def28
to
02dd9f8
Compare
Can one of the admins verify that this patch is reasonable to test? (reply "ok to test", or if you trust the user, reply "add to whitelist") If this message is too spammy, please complain to ixdy. |
@@ -0,0 +1,35 @@ | |||
/* |
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.
Move to cmd/kube-discover
. Or plugin/cmd/kube-discover?
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.
Moved to cmd/kubernetes-discover
.
Chose kubernetes-discover
over kube-discover
as per comment here: #23509 (comment)
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.
Doesn't seem moved?
Sorry for delay. Hopefully that's enough for a first pass :) |
return &apiVersions, nil | ||
} | ||
|
||
func writeRawJSON(statusCode int, object interface{}, w http.ResponseWriter) { |
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 don't like that these have to be duplicated - add a TODO that common response negotiation and version handling should be split out of pkg/apiserver into a more fundamental package.
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.
Added a TODO to share this with kubernetes apiserver.
8521b14
to
400a7ba
Compare
limitations under the License. | ||
*/ | ||
|
||
package main |
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.
Any reason not to put this directly in the cmd/kubernetes-discovery directory?
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 can, but you didnt like types.go directly in top level directory so I thought you might not like this directly at top level directory as well :)
I can move it there if you think thats better.
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 think it's OK for the main.go file to be top level. :)
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.
Moved to top level
Just a few final comments. |
a9ff150
to
bc5abcc
Compare
Updated code as per comments |
LGTM-- good to get this started! |
@nikhiljindal |
@k8s-bot e2e test this issue: #IGNORE |
@nikhiljindal |
@k8s-bot unit test this issue: #IGNORE |
bc5abcc
to
65c1dc8
Compare
Fixed the test by changing the port so that it does not conflict with examples/apiserver. |
As per logs all tests seem to have passed, not sure why it says FAILED at the end :) |
GCE e2e build/test passed for commit 65c1dc8. |
Automatic merge from submit-queue |
…containers UPSTREAM: 65549: Fix flexvolume in containerized kubelets Origin-commit: 4b8fef9c7c9971e1857e901c4bdc7a18f60188ac
…containers UPSTREAM: 65549: Fix flexvolume in containerized kubelets Origin-commit: 4b8fef9c7c9971e1857e901c4bdc7a18f60188ac
Ref #20229
The server reads a config file to get the list of federated servers and then surfaces the combined discovery information at
/api
and/apis
.cc @kubernetes/sig-api-machinery @lavalamp
This change is