{"action":"closed","issue":{"url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/6133","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/6133/labels{/name}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/6133/comments","events_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/6133/events","html_url":"https://github.com/GoogleCloudPlatform/kubernetes/issues/6133","id":64906966,"number":6133,"title":"Document API/system design principles and patterns","user":{"login":"bgrant0607","id":7725777,"avatar_url":"https://avatars.githubusercontent.com/u/7725777?v=3","gravatar_id":"","url":"https://api.github.com/users/bgrant0607","html_url":"https://github.com/bgrant0607","followers_url":"https://api.github.com/users/bgrant0607/followers","following_url":"https://api.github.com/users/bgrant0607/following{/other_user}","gists_url":"https://api.github.com/users/bgrant0607/gists{/gist_id}","starred_url":"https://api.github.com/users/bgrant0607/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bgrant0607/subscriptions","organizations_url":"https://api.github.com/users/bgrant0607/orgs","repos_url":"https://api.github.com/users/bgrant0607/repos","events_url":"https://api.github.com/users/bgrant0607/events{/privacy}","received_events_url":"https://api.github.com/users/bgrant0607/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/labels/area/documentation","name":"area/documentation","color":"5319e7"},{"url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/labels/kind/design","name":"kind/design","color":"50cba5"},{"url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/labels/priority/P1","name":"priority/P1","color":"eb6420"},{"url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/labels/team/any","name":"team/any","color":"d2b48c"}],"state":"closed","locked":false,"assignee":{"login":"bgrant0607","id":7725777,"avatar_url":"https://avatars.githubusercontent.com/u/7725777?v=3","gravatar_id":"","url":"https://api.github.com/users/bgrant0607","html_url":"https://github.com/bgrant0607","followers_url":"https://api.github.com/users/bgrant0607/followers","following_url":"https://api.github.com/users/bgrant0607/following{/other_user}","gists_url":"https://api.github.com/users/bgrant0607/gists{/gist_id}","starred_url":"https://api.github.com/users/bgrant0607/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bgrant0607/subscriptions","organizations_url":"https://api.github.com/users/bgrant0607/orgs","repos_url":"https://api.github.com/users/bgrant0607/repos","events_url":"https://api.github.com/users/bgrant0607/events{/privacy}","received_events_url":"https://api.github.com/users/bgrant0607/received_events","type":"User","site_admin":false},"milestone":null,"comments":5,"created_at":"2015-03-28T06:15:53Z","updated_at":"2015-04-15T23:17:59Z","closed_at":"2015-04-15T23:17:59Z","body":"Related to #5476, #2003, #1007, #5620, and other issues.\r\n\r\nThe PR creation rate and number of contributors are both growing. In order to scale the effort, we need to better document the patterns we want additions to the system and API to follow, so that we can better parallelize the design and review effort. I'm filing this issue to solicit important principles and patterns to document. I volunteer to create the actual document and/or presentation slides.\r\n\r\nWhat do you think isn't sufficiently covered by existing design docs and/or isn't sufficiently discoverable? What principles/patterns do you find yourself explaining over and over again? What properties would you be unhappy to have violated/degraded/changed by new PRs? \r\n\r\nI'm thinking more about reasonably general issues rather than implementation-oriented invariants that apply to very specific/narrow parts of the code. \r\n\r\nExamples (some areas, some principles):\r\n* Declarative APIs, desired state and current state\r\n* Level-based operation: Functionality must be level-based, meaning the system must operate correctly given the desired state and the current/observed state, regardless of how many intermediate state updates may have been missed. Edge-based behavior must be just an optimization.\r\n* Status must be 100% reconstructable by observation. Any history kept must be just an optimization and not required for correct operation.\r\n* Phase, Reason, Message, Conditions, etc. vs. a single state machine with lots of states\r\n* Composable, a la carte functionality\r\n* Transparent, no glass to break\r\n* More generally, [Eric Raymond's 17 UNIX rules](https://en.wikipedia.org/wiki/Unix_philosophy#Eric_Raymond.E2.80.99s_17_Unix_Rules)\r\n* Only the apiserver should communicate with etcd/store, and not other components (scheduler, kubelet, etc.).\r\n* Compromising a single node shouldn't compromise the cluster (not that we've achieved that yet)\r\n* Components should continue to do what they're told in the absence of new instructions.  \r\n* Open world assumption: continually verify assumptions and gracefully adapt to external events and/or actors (example: we allow users to kill pods under control of a replication controller; it just replaces them)\r\n* Don't assume a component's decisions will not be overridden or rejected, nor for the component to always understand why. For example, etcd may reject writes. Kubelet may reject pods. The scheduler may not be able to schedule pods.\r\n* When to use labels vs. annotations vs. object references\r\n* Watch vs. polling\r\n* Bootstrapping-related principles\r\n\r\nLet's brainstorm first, and argue and prioritize afterward.\r\n\r\n@smarterclayton @derekwaynecarr @thockin @erictune @lavalamp "}}