community icon indicating copy to clipboard operation
community copied to clipboard

There should be a kubernetes contributor guide

Open pmorie opened this issue 9 years ago • 56 comments

I've been working on the service-catalog incubator repo for around the last 11 months. The service-catalog is an extension project shaped similarly to kubernetes from an architectural perspective:

  • It has a distinct API server that is used via the aggregator
  • The API server is backed by a controller that has the same state-reconciler architecture as the controllers in the core
  • It uses the kubernetes apiserver and apimachinery projects as dependencies

The people participating in the SIG were initially largely unfamiliar with our architectural patterns and conventions. This was a bit jarring for me as a Kubernetes OG - as has been written elsewhere, we have a lot of knowledge transmitted as oral history that isn't written down. One big takeaway from this experience is that it would be extremely useful to have a developer guide for kubernetes and projects like the service-catalog that use the same patterns and have a goal of becoming first class projects under the kubernetes github org.

We have fragments of this knowledge written down already, mostly living in the contributors/devel directory in this repo:

... amongst others. However, these pieces are sprinkled in with a bunch of other stuff that lives in the same directory which is very specific to certain niche topics.

These pieces also don't tell all of the story. For example, the API conventions document doesn't address certain aspects of API design doctrine like how to differentiate behavioral modes for resources (see #859).

In our experience so far in the catalog incubator, we have tended to spend a lot of time discussing these topics which have been resolved already in the minds of many senior core contributors.

It would be great to have these pieces brought together into a coherent whole that is maintained as we evolve conventions. Ideally, someone new to the community would be able to read this guide and have a more than minimal grounding in the concepts necessary to understand existing code and a good idea of how to get started thinking 'the kubernetes way'. In addition to making it easier to onboard new community members, it would help conserve time for SIGs forming around new concepts in the community.

I think this cuts across a number of SIGs:

  • API machinery
  • Architecture
  • Contributor experience

If we have broad interest in creating a guide like this, it might be effective to create a short-term working group to handle bootstrapping the effort of creating the skeleton of the guide from the existing pieces, identifying gaps, and working with the people knowledgeable about those gaps to close them.

Of course, such a document is only useful in the long-term if it is kept up to date, so I think there will be a long-term investment and culture-shift necessary to maintain the dev guide.

Some examples of similar documentation from other projects:

pmorie avatar Aug 09 '17 17:08 pmorie

I've asserted before that major structural changes to the code should include "developer docs". Things like "how to write a controller" are not immediately clear (especially since at times certain controllers have used legacy patterns, while others have used new patters), and changes to the standard patterns can be unclear to developers less involved in the nitty-gritty parts of the code base (e.g. the change to shared informers).

I'm not suggesting that every nook and cranny of the codebase needs devel docs, but a general "here's the lay of the land, plus the metro system for major cities" would help out new contributors a lot, IMO.

DirectXMan12 avatar Aug 09 '17 19:08 DirectXMan12

I love this and would like to help.

I think about this as three pieces:

  1. So you want to extend kubernetes? Here are all the ways you can do that, which to use, and more detailed docs for each one. (Aggregated Apiservers, CRDs, Initializers, Flex Volume plugins, Cloud Provider plugins, Operator patterns, etc). This is targeted at devs that that want to tweak kubernetes, but typically don't contribute on github.com/kubernetes/kubernetes. I call this "Top Level SDK Docs". Core Devs might want to reads this. These should be on http://kubernetes.io.

  2. Kubernetes API Conventions. This is mandatory stuff for people developing in github.com/kubernetes/kubernetes, and strongly suggested for people writing API extensions (CRD/Aggregated APIservers). These should be on http://kubernetes.io too.

  3. Kubernetes Core Developer Docs. Much smaller audience than the two previous ones. This is about anything you need to know to develop on github.com/kubernetes/kubernetes and closely affiliated repos. Stuff like generated code and go style and CI/CD and releasing and so on. This can go on http://github.com/kubernetes/community

erictune avatar Aug 10 '17 00:08 erictune

@kubernetes/sig-contributor-experience-proposals

0xmichalis avatar Aug 10 '17 07:08 0xmichalis

I'm interested in collaborating on API related topics:

  • What do Kubernetes APIs look like (describe HTTP structure)
  • How are the APIs organized in the code base
  • Difference between internal and versioned/external types
  • What are GroupVersionResource and GroupVersionKind
  • When might you want to add a new API type, group, and/or version
  • Where to add new APIs (core, CRD, extension apiserver)
  • What is a clientset, how to generate, how to use
  • What is a lister, how to generate, how to use
  • What is a shared informer, how to generate, how to use
  • Tying all of the above together into how to write a controller

I would also be happy to share "how I work", which I realize is quite opinionated and is not something we can necessarily prescribe, but I think it could be useful to new contributors.

cc @bradamant3

ncdc avatar Aug 10 '17 12:08 ncdc

@castrojo we might need some assistance organizing this effort

ncdc avatar Aug 10 '17 12:08 ncdc

Love to help when I get back from holiday, in the meantime recommend cc'ing in @kubernetes/sig-docs-maintainers

castrojo avatar Aug 10 '17 13:08 castrojo

+1;

  1. I would be happy to contribute as well.... Can we put automation in place for this that tests the snippets and API contructs don't bit rot?

  2. It seems like dev doc should focus on controllers, extensions, API stuff as the higher priority .

  3. Possibly even some exersizes with the sections could be valuable for onboarding new engineers to cloud native places where kube extensions or support is a part of the daily grind.

On Aug 10, 2017, at 8:45 AM, Andy Goldstein [email protected] wrote:

@castrojo we might need some assistance organizing this effort

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

jayunit100 avatar Aug 10 '17 13:08 jayunit100

/cc

I love working on onboarding docs of this type. A couple months ago I reworked development.md and I have a 1-page "welcome to Kubernetes" doc under review here https://github.com/kubernetes/community/pull/883. I would gladly contribute to any other onboarding docs.

alexandercampbell avatar Aug 10 '17 16:08 alexandercampbell

P.S. I'm totally willing to contribute to these docs -- I'm not just here to complain ;-). I'm especially interested in aggregated API servers (I've already written docs in this area in the apiserver-builder repo) and core mechanics.

DirectXMan12 avatar Aug 10 '17 17:08 DirectXMan12

We're actually working on adding a user journey portal to kubernetes.io, which should be tighter onboarding paths for different types of users. I think this would fit nicely into that and would love to coordinate w/ you folks who are offering to contribute to the docs. We should discuss this in more detail at the next SIG-Docs meeting.

Andrew (@chenopis)

On Thu, Aug 10, 2017 at 10:47 AM Solly Ross [email protected] wrote:

P.S. I'm totally willing to contribute to these docs -- I'm not just here to complain ;-). I'm especially interested in aggregated API servers (I've already written docs in this area in the apiserver-builder repo) and core mechanics.

— You are receiving this because you are on a team that was mentioned. Reply to this email directly, view it on GitHub https://github.com/kubernetes/community/issues/892#issuecomment-321624247, or mute the thread https://github.com/notifications/unsubscribe-auth/AXpjrY8Ti1Un0czJOKY8GtBB8eixoM_jks5sW0IjgaJpZM4OyXgU .

--

Andrew Chen, Google Inc Tech Writer for Kubernetes [email protected]

chenopis avatar Aug 10 '17 17:08 chenopis

Count me in.

pwittrock avatar Aug 10 '17 20:08 pwittrock

/assign @chenopis

chenopis avatar Aug 10 '17 20:08 chenopis

@chenopis not sure where you were planning to start, but I started (locally) what Other Folks call a content audit, with an eye to roughing out IA/a TOC based on current content, proposed revisions, and identified gaps ^^

Bradamant3 avatar Aug 10 '17 20:08 Bradamant3

/assign @zacharysarah

zacharysarah avatar Aug 10 '17 21:08 zacharysarah

@zacharysarah: GitHub didn't allow me to assign the following users: zacharysarah.

Note that only kubernetes members can be assigned.

In response to this:

/assign @zacharysarah

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

k8s-ci-robot avatar Aug 10 '17 21:08 k8s-ci-robot

Round 2:

/assign @zacharysarah

zacharysarah avatar Aug 10 '17 22:08 zacharysarah

As a kubernetes outsider, I'm more than willing to gently rant about I've learned about API Servers and code-generation thereof if somebody else wants to write it down or ask me questions in an office hour or something.

MHBauer avatar Aug 11 '17 03:08 MHBauer

@ncdc I'm very interested in how other people, especially kube insiders work.

MHBauer avatar Aug 11 '17 03:08 MHBauer

This is related to https://github.com/kubernetes/kubernetes.github.io/issues/4548.

chenopis avatar Aug 11 '17 07:08 chenopis

This overlaps with #350

bgrant0607 avatar Aug 11 '17 16:08 bgrant0607