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

Umbrella: Improvements to API documentation #19680

Open
tonybaloney opened this issue Jan 15, 2016 · 25 comments
Open

Umbrella: Improvements to API documentation #19680

tonybaloney opened this issue Jan 15, 2016 · 25 comments
Labels
area/api Indicates an issue on api area. kind/documentation Categorizes issue or PR as related to documentation. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/docs Categorizes an issue or PR as relevant to SIG Docs. wg/api-expression Categorizes an issue or PR as relevant to WG API Expression.

Comments

@tonybaloney
Copy link

the public API documentation on kubernetes.io is very challenging to understand compared with projects like Docker, OpenStack.

The first and most challenging issue is that all of the API operations
are listed on one massive page, there isn't any grouping or index. I
have to use the browser find to search within the page and guess what
I'm looking for.

The second issue is that the docs are automatically generated so a lot
of the descriptions are not helpful, for example "proxy PUT requests
to Pod" : PUT /api/v1/proxy/namespaces/{namespace}/pods/{name} - I
have no idea what this does or what it is supposed to do.

Third issue is that the models 'required' for each of the fields are
not entirely correct. I was trying to create a pod. The docs say :
http://kubernetes.io/v1.1/docs/api-reference/v1/definitions.html#_v1_pod
that a pod spec is required, but none of the fields are required.
The API returns and gives an error saying fields are missing. I had to
use trial and error to discover which fields are required at a minimum
(turns out, metadata.name, containers[0].name and
containers[0].image).

@caesarxuchao
@brendandburns
@bgrant0607

@caesarxuchao caesarxuchao self-assigned this Jan 16, 2016
@caesarxuchao
Copy link
Member

Thanks @tonybaloney. I'll send fixes next week.

@bgrant0607 bgrant0607 added team/api priority/backlog Higher priority than priority/awaiting-more-evidence. kind/documentation Categorizes issue or PR as related to documentation. area/api Indicates an issue on api area. labels Jan 20, 2016
@bgrant0607
Copy link
Member

Related: #14924, #11933, #16095

The problem with PodSpec is that the same type is shared between Pod and PodTemplate.

@caesarxuchao
Copy link
Member

The problem with PodSpec is that the same type is shared between Pod and PodTemplate.

@bgrant0607, I don't think this affects if the fields of PodSpec are required, because the validation functions of Pod and PodTemlate both call the same function to validate PodSpec: here and here.

What's our convention for fields that "one of the fields needs to be specified", like this one? Shall we mark both as not required?

@thockin
Copy link
Member

thockin commented Jan 20, 2016

We have to mark them both as optional. AFAIK we have no real way to denote
one-of. Maybe we need a new field tag like 'oneof:foobar' and only one
field tagged as such must be set.
On Jan 20, 2016 1:15 PM, "Chao Xu" notifications@github.com wrote:

The problem with PodSpec is that the same type is shared between Pod and
PodTemplate.

@bgrant0607 https://github.com/bgrant0607, I don't think this affects
if the fields of PodSpec are required, because the validation functions
of Pod and PodTemlate both call the same function to validate PodSpec:
here
https://github.com/kubernetes/kubernetes/blob/master/pkg/api/validation/validation.go#L1310
and here
https://github.com/kubernetes/kubernetes/blob/master/pkg/api/validation/validation.go#L1679
.

What's our convention for fields that "one of the fields needs to be
specified", like this one
https://github.com/kubernetes/kubernetes/blob/master/pkg/api/validation/validation.go#L2163?
Shall we mark both as not required?


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

@bgrant0607 bgrant0607 changed the title Improvements to public API documentation Umbrella: Improvements to public API documentation Feb 26, 2016
@bgrant0607 bgrant0607 added priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. and removed priority/backlog Higher priority than priority/awaiting-more-evidence. labels Feb 26, 2016
@bgrant0607 bgrant0607 changed the title Umbrella: Improvements to public API documentation Umbrella: Improvements to API documentation Feb 26, 2016
@nikhiljindal
Copy link
Contributor

Another problem is that we use the same Pod model for different operations like create and update and the validations for both are different.

@bgrant0607 bgrant0607 added the sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. label Mar 3, 2016
@bgrant0607 bgrant0607 added this to the next-candidate milestone Mar 3, 2016
@bgrant0607
Copy link
Member

Also #22389

We've reached the point where we desperately need good API documentation.

cc @lavalamp

@bgrant0607
Copy link
Member

Need to replace out-of-date design docs and proposals: #22797

@bgrant0607
Copy link
Member

Example API documentation needed: content type: #22904

@bgrant0607
Copy link
Member

kubernetes/website#650

@bgrant0607
Copy link
Member

Another issue: example value for each field

@timbunce
Copy link

timbunce commented Jul 12, 2016

The Elasticsearch API documentation is worth a look as an example.

I especially appreciate that it's easy to switch between versions for a given page, e.g. here's the cluster page for version 1.5. At the top of the page is a clear message saying it's an old version and giving a link to the current. On the right is a drop-down making it trivial to switch to other versions of those docs.

Also worth noting is that every section has an "edit" icon inviting readers to correct mistakes (via github edit workflow).

@bgrant0607
Copy link
Member

I don't remember whether it is specifically mentioned somewhere else, but we need a developer-facing version of:
https://github.com/kubernetes/kubernetes/blob/master/docs/devel/api-conventions.md

@zhangxiaoyu-zidif
Copy link
Contributor

@zhangxiaoyu-zidif
Copy link
Contributor

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or @fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 3, 2018
@bgrant0607
Copy link
Member

/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 23, 2018
@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 23, 2018
@thockin
Copy link
Member

thockin commented Apr 29, 2018

/lifecycle frozen
/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot added lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Apr 29, 2018
@sftim
Copy link
Contributor

sftim commented Mar 12, 2020

Following #19680 (comment) I've logged issue #89094

@tonybaloney
Copy link
Author

@thockin this issue is getting a little old :-) Should I close it?

@sftim
Copy link
Contributor

sftim commented Dec 15, 2022

/wg api-expression

@k8s-ci-robot k8s-ci-robot added the wg/api-expression Categorizes an issue or PR as relevant to WG API Expression. label Dec 15, 2022
@sftim
Copy link
Contributor

sftim commented Dec 15, 2022

I think this issue is worth keeping. However, @tonybaloney, perhaps you'd be willing to update the issue description to account for the changes / improvements / regressions since you opened it?

@thockin
Copy link
Member

thockin commented Dec 19, 2022

I think it's still a real issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api Indicates an issue on api area. kind/documentation Categorizes issue or PR as related to documentation. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/docs Categorizes an issue or PR as relevant to SIG Docs. wg/api-expression Categorizes an issue or PR as relevant to WG API Expression.
Projects
None yet
Development

No branches or pull requests