Skip to content
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

Moving /apis handler to generic api server #20532

Merged
merged 1 commit into from
Feb 5, 2016

Conversation

nikhiljindal
Copy link
Contributor

Moving the /apis handler to generic api server.

cc @brendandburns @kubernetes/sig-api-machinery

@k8s-github-robot k8s-github-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Feb 3, 2016
@k8s-github-robot
Copy link

Labelling this PR as size/M

@k8s-bot
Copy link

k8s-bot commented Feb 3, 2016

GCE e2e test build/test passed for commit 5e56389b9160a4b89aff80811210e8cdacf3594d.

@k8s-bot
Copy link

k8s-bot commented Feb 4, 2016

GCE e2e test build/test passed for commit 974d2eead2b383564566c02125f3a0b54c380393.

@smarterclayton
Copy link
Contributor

If I want to run a third party API server, do I want to install /apis? I would think I don't. Probably should put this behind a boolean and default it to "not".

@nikhiljindal
Copy link
Contributor Author

Why not?

/apis is where discovery information about all the groups supported by that server will be listed.
Discovery summarizer will use that to summarize all groups in the cluster (#20358) and dynamic client will use it to talk to the server directly.

@smarterclayton
Copy link
Contributor

Why is the summarizer talking to /apis on other servers and not talking directly to the individual group descriptions?

@nikhiljindal
Copy link
Contributor Author

Sorry, read group descriptions from where?

The config file for discovery summarizer only contains server URLs and the summarizer is able to gather all the information from there.

Whats wrong with getting groups information from /apis? Thats what I think the dynamic client does as well. cc @krousey

@smarterclayton
Copy link
Contributor

I don't like a model that assumes that every third party API group exposes /apis. I don't think it's required (it's a nice property, but not fundamental), I don't think every API server will be exposed at the root, and I don't think the summarizer is aggregating "servers that look exactly like a Kube server". I might be ok with the summarizer taking a URL + optional path and based on the returned object type summarizing them - but I don't think that summarizer should assume /apis/ at the root.

@smarterclayton
Copy link
Contributor

I would expect the summarizer to fetch groups, not API servers, identified at paths (APIGroup).

@nikhiljindal
Copy link
Contributor Author

  • In current implementation, Summarizer reads a config file with list of servers and then fetches groups from those servers.
  • Yes, we can remove the /apis assumption from the summarizer. I can just add another field groupsDiscoveryPath to the FederatedServers struct. If present, the summarizer will fetch that path instead of /apis.
  • But, it is not clear to me how a dynamic client will interact with such a server. One way is to fetch that path using discovery API, but then we will need a fixed path for that :)

FWIW, the proposal specified it as one of the constraints that all federated servers need to list the supported groupVersions at /apis: https://github.com/kubernetes/kubernetes/blob/master/docs/proposals/federated-api-servers.md#constraints, since that is what clients today use to discover all the groups supported by a server.

@smarterclayton
Copy link
Contributor

In the proposal I read should as "It's good that they do" - I guess I
want to pin this down to the minimum possible thing.

A dynamic client would call the summarizer, then walk to the APIGroup
endpoint. It shouldn't be walking from the summarizer /apis, to the third
party /apis, to the group api. One of the key design goals discussed (i
don't see it in the proposal, but i think it's just something we forgot to
add) is that a client should be able to hit /apis on the summarizer, and
then if any group is unrecognized, jump directly to that group and get the
list of resources, versions, and the swagger link. So we do 1+N calls at
most where N is number of APIGroups, and each APIGroup is something
cacheable.

On Wed, Feb 3, 2016 at 9:45 PM, Nikhil Jindal notifications@github.com
wrote:

  • In current implementation, Summarizer reads a config file with list
    of servers and then fetches groups from those servers.
  • Yes, we can remove the /apis assumption from the summarizer. I can
    just add another field groupsDiscoveryPath to the FederatedServers
    struct. If present, the summarizer will fetch that path instead of
    /apis.
  • But, it is not clear to me how a dynamic client will interact with
    such a server. One way is to fetch that path using discovery API, but then
    we will need a fixed path for that :)

FWIW, the proposal specified it as one of the constraints that all
federated servers need to list the supported groupVersions at /apis:
https://github.com/kubernetes/kubernetes/blob/master/docs/proposals/federated-api-servers.md#constraints,
since that is what clients today use to discover all the groups supported
by a server.


Reply to this email directly or view it on GitHub
#20532 (comment)
.

@nikhiljindal
Copy link
Contributor Author

Yes.
When there is a summarizer, clients get groups discovery from summarizer's /apis and then jump directly to the group endpoint.

But we also want to support clients talking directly to a particular server, without talking to the summarizer first.
In that case, they talk to federated server's /apis to get groups discovery and then jump directly to the group endpoint.

Basically, the client should work same - when its talking directly to a single server and when its talking to a federated server via summarizer and proxy.

@nikhiljindal
Copy link
Contributor Author

Have updated the code to register the handler at APIGroupPrefix which is passed as part of config, instead of hardcoding to "/apis" (which is what I should have done at the first place).

So while we should continue the important discussion we are having, I believe, this PR should be fine irrespective.

@k8s-bot
Copy link

k8s-bot commented Feb 4, 2016

GCE e2e test build/test passed for commit 173f1cafee0569e30327fd7250e56b928c18b02a.

@smarterclayton
Copy link
Contributor

I don't think the summarizer should include all groups automatically

  • as a concrete example, having two summarizers (one is prod, one is
    preproduction / testing of new features), or organizations choosing
    not to expose group X, or forcing group X to go through a proxy /
    firewall (this is actually something we have people doing today who
    require higher level of auth / security for certain APIs).

So summarizer pointing to the API group endpoint vs API groups makes
it more granular.

@smarterclayton
Copy link
Contributor

smarterclayton commented Feb 4, 2016 via email

@nikhiljindal
Copy link
Contributor Author

To clarify, are you saying that instead of reading a list of server URLs from a config file and fetching the api groups automatically, summarizer should directly get a list of api groups in the config file?

I discussed this with @lavalamp and he pointed out that this will not work for dynamic groups, for ex: the third party groups.

@k8s-bot
Copy link

k8s-bot commented Feb 5, 2016

GCE e2e build/test failed for commit d267ab5.

@smarterclayton
Copy link
Contributor

I that it's more common for folks to want to expose some of these APIs, not
all of them. I doubt most people are going to want to summarize
extensions, third party, etc without them being whitelisted. I'd prefer
not to have the dynamic path be the only story, since it either requires
you run your groups on individual API servers or have only way of exposing
them.

On Thu, Feb 4, 2016 at 9:40 PM, Kubernetes Bot notifications@github.com
wrote:

GCE e2e build/test failed for commit d267ab5
d267ab5
.


Reply to this email directly or view it on GitHub
#20532 (comment)
.

@k8s-github-robot
Copy link

@nikhiljindal
You must link to the test flake issue which caused you to request this manual re-test.
Re-test requests should be in the form of: k8s-bot test this issue: #<number>
Here is the list of open test flakes.

@k8s-bot
Copy link

k8s-bot commented Feb 5, 2016

GCE e2e build/test failed for commit d267ab5.

@nikhiljindal
Copy link
Contributor Author

@k8s-bot: test this github issue: #20646

@nikhiljindal
Copy link
Contributor Author

@k8s-bot: test this issue: #20646

@nikhiljindal
Copy link
Contributor Author

@k8s-bot: test this issue #20646

@nikhiljindal
Copy link
Contributor Author

@k8s-bot test this issue: #20646

@lavalamp
Copy link
Member

lavalamp commented Feb 5, 2016

@smarterclayton Are you OK with a world where we make it easiest to put all your groups in /apis, but also offer exceptions in the discovery summarizer?

I think if we only offer a per-group whitelist, that's very inconvenient because it means you always have to restart two components to turn on a new api. I can definitely see why some people would want that control. Maybe we can hash this out in the PR that adds the config format for the discovery summarizer.

It looks like this PR is just about making /apis easier--I think your comments are actually about the discovery summarizer, not this PR, is that correct? If so, this LGTM

@nikhiljindal
Copy link
Contributor Author

Yes. In my discovery summarizer PR (#20358), the summarizer is reading a list of FederatedServers from the config file. The FederatedServer struct just has a ServerAddress for now. In future, we can easily add filtering options (whitelist or blacklist) for groups.

@k8s-bot
Copy link

k8s-bot commented Feb 5, 2016

GCE e2e test build/test passed for commit d267ab5.

@smarterclayton
Copy link
Contributor

We can move the discussion to summarizer. I think the assumption that
/apis is available on every kubernetes compatible server is a bad one, and
assuming anything about server paths in real world environments is also
fraught. So my problem isn't with the existence of /apis, it's assuming
(and requiring) /apis to make sense.

On Fri, Feb 5, 2016 at 1:58 PM, Kubernetes Bot notifications@github.com
wrote:

GCE e2e test build/test passed for commit d267ab5
d267ab5
.


Reply to this email directly or view it on GitHub
#20532 (comment)
.

@nikhiljindal
Copy link
Contributor Author

Yes. I can make the /apis path configurable in the summarizer config.
Will update that PR once #20626 is merged.

Adding the LGTM tag as per comments above.

Thanks! :)

@nikhiljindal nikhiljindal added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 5, 2016
nikhiljindal added a commit that referenced this pull request Feb 5, 2016
Moving /apis handler to generic api server
@nikhiljindal nikhiljindal merged commit 4606d14 into kubernetes:master Feb 5, 2016
openshift-publish-robot pushed a commit to openshift/kubernetes that referenced this pull request Aug 21, 2018
External graph library and company

Origin-commit: d87f18a5ba69e652bab6615c4467b41073ddacf9
openshift-publish-robot pushed a commit to openshift/kubernetes that referenced this pull request Jan 29, 2019
External graph library and company

Origin-commit: d87f18a5ba69e652bab6615c4467b41073ddacf9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants