-
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
[WIP] Uber api server #21190
[WIP] Uber api server #21190
Conversation
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. |
1 similar comment
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. |
Labelling this PR as size/XXL |
@jianhuiz Reference to proposal or issue? Please also see: |
Also note that we're frozen while trying to converge the 1.2 release at the moment. |
@bgrant0607 the proposal is #19313. I can take this one. |
Thanks @quinton-hoole. Let me know when you want to discuss the API. @lavalamp and/or @caesarxuchao may have suggestions about how to factor the apiserver code. |
PR needs rebase |
"runtime" | ||
"time" | ||
|
||
"k8s.io/kubernetes/cmd/uber-apiserver/app" |
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.
Should you reconsider the package name as ube instead of uber? same pattern with kubernetes -> kube
I'm swamped today. I will try to look at this tomorrow. |
Hi, @jianhuiz
Would you please give us some suggestion? @quinton-hoole |
Regarding the test failure at https://github.com/kubernetes/kubernetes/blob/master/pkg/apimachinery/registered/registered.go#L170)
All this happens because that now we have two apiservers but other packages and the scripts are dedicated to work with only the kube-apiserver. Advises? |
@jianhuiz PR needs rebase |
ParameterCodec: api.ParameterCodec, | ||
NegotiatedSerializer: api.Codecs, | ||
} | ||
if err := m.InstallAPIGroup(&apiGroupInfo); err != nil { |
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.
Call InstallAPIGroups() It does more than just calling InstallAPIGroup.
It also adds swagger support. We can potentially add more stuff there as we move more logic to genericapiserver.
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.
InstallAPIGroups() however can be called only once (due to this swagger support) which had been called in master.New()
Since ube-apiserver were to be compatible with uber-apiserver for most of the APIs, those codes are duplicated from uber-apiserver as suggested. I'd rather not to make much changes but try to keep sync with uber-apiserver while it's in refactoring. I therefore call InstallAPIGroup() instead to avoid installing swagger twice.
I disagree that swagger (as well as other potential stuff) should be put inside InstallAPIGroups() which makes the functions behaviors surprises than they look. It would be better move them to init() like the installGroupsDiscoveryHandler()
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.
We cant move the swagger stuff to init since it has to be called after all api groups have been added.
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.
It can be modified to be re-installable, or lazy installed, or It can be moved to Run()
Rather than having InstallAPIGroups() can be called only once and all APIs have to be installed at that time.
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 moving it to Run is reasonable.
#23554.
Thanks!
I have added some comments in the code. This is a huge PR which we should split. Its going to be hard for anyone to understand or review this and going to be hard for you to keep in sync. I think we can have one PR that just adds the ubernetes server (cmd/ube-apiserver code). Does that sound reasonable to you? |
glog.Fatalf("Failure to start kubelet client: %v", err) | ||
} | ||
|
||
apiGroupVersionOverrides, err := parseRuntimeConfig(s) |
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 so that you know there is #23067 which is refactoring a few things here
Also, so that you know, there is another option than to duplicate cmd/api-server: We can start with code as in https://github.com/kubernetes/kubernetes/blob/master/examples/apiserver/apiserver.go. That will give us an apiserver to start with. We can add our group and api objects, etc. That will save us from keeping the duplicate code in sync (as i pointed there are PRs in flight that are changing that code) cc @lavalamp |
@nikhiljindal I personaly wouldn't mind either way, and didn't see either way is better than the other, I just don't want to struggle with the ongoing refactoring and would like to focus on the api objects to support the development of the cluster controler, u7s scheduler, etc. I think I can catch up with the apiserver it self later (when the refactoring of generic apiserver becomes clear) |
Automatic merge from submit-queue duplicate kube-apiserver to federated-apiserver duplicate the kube-apiserver source code to ube-apiserver and update references cluster specific api objects will be in separate PRs #19313, #21190 #21190 (comment) @nikhiljindal
Automatic merge from submit-queue genericapiserver: Moving InstallSwaggerAPI to Run Ref #21190 (comment) Moving InstallSwaggerAPI() from InstallAPIGroups() to Run(). This allows the use of InstallAPIGroups() multiple times or using InstallAPIGroup() directly. cc @jianhuiz @kubernetes/sig-api-machinery
create separate uber api server with cluster api object added
duplicate /cmd/kube-apiserver and /pkg/master/ as suggested
@quinton-hoole, @deepak-vij, @XiaoningDing, @alfred-huangjian
#19313
#20733