{"action":"created","comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/73349828","id":73349828,"diff_hunk":"@@ -0,0 +1,587 @@\n+/*\n+Copyright 2016 The Kubernetes Authors.\n+\n+Licensed under the Apache License, Version 2.0 (the \"License\");\n+you may not use this file except in compliance with the License.\n+You may obtain a copy of the License at\n+\n+    http://www.apache.org/licenses/LICENSE-2.0\n+\n+Unless required by applicable law or agreed to in writing, software\n+distributed under the License is distributed on an \"AS IS\" BASIS,\n+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+See the License for the specific language governing permissions and\n+limitations under the License.\n+*/\n+\n+package disruption\n+\n+import (\n+\t\"fmt\"\n+\t\"time\"\n+\n+\t\"k8s.io/kubernetes/pkg/api\"\n+\t\"k8s.io/kubernetes/pkg/api/unversioned\"\n+\t\"k8s.io/kubernetes/pkg/apis/extensions\"\n+\t\"k8s.io/kubernetes/pkg/apis/policy\"\n+\t\"k8s.io/kubernetes/pkg/client/cache\"\n+\t\"k8s.io/kubernetes/pkg/client/record\"\n+\tclient \"k8s.io/kubernetes/pkg/client/unversioned\"\n+\t\"k8s.io/kubernetes/pkg/controller\"\n+\t\"k8s.io/kubernetes/pkg/controller/framework\"\n+\t\"k8s.io/kubernetes/pkg/runtime\"\n+\t\"k8s.io/kubernetes/pkg/types\"\n+\t\"k8s.io/kubernetes/pkg/util/intstr\"\n+\t\"k8s.io/kubernetes/pkg/util/wait\"\n+\t\"k8s.io/kubernetes/pkg/util/workqueue\"\n+\t\"k8s.io/kubernetes/pkg/watch\"\n+\n+\t\"github.com/golang/glog\"\n+)\n+\n+const statusUpdateRetries = 2\n+\n+type updater func(*policy.PodDisruptionBudget) error\n+\n+type DisruptionController struct {\n+\tkubeClient *client.Client\n+\n+\tpdbStore      cache.Store\n+\tpdbController *framework.Controller\n+\tpdbLister     cache.StoreToPodDisruptionBudgetLister\n+\n+\tpodController framework.ControllerInterface\n+\tpodLister     cache.StoreToPodLister\n+\n+\trcIndexer    cache.Indexer\n+\trcController *framework.Controller\n+\trcLister     cache.StoreToReplicationControllerLister\n+\n+\trsStore      cache.Store\n+\trsController *framework.Controller\n+\trsLister     cache.StoreToReplicaSetLister\n+\n+\tdStore      cache.Store\n+\tdController *framework.Controller\n+\tdLister     cache.StoreToDeploymentLister\n+\n+\tqueue *workqueue.Type\n+\n+\tbroadcaster record.EventBroadcaster\n+\trecorder    record.EventRecorder\n+\n+\tgetUpdater func() updater\n+}\n+\n+// This is used to return (controller, scale) pairs from the controller finder\n+// functions.\n+type controllerAndScale struct {\n+\ttypes.UID\n+\tscale int32\n+}\n+\n+// This is a simple function interface that maps a pod to a list of controllers\n+// and their scale.\n+type podControllerFinder func(*api.Pod) ([]controllerAndScale, error)\n+\n+func NewDisruptionController(podInformer framework.SharedIndexInformer, kubeClient *client.Client) *DisruptionController {\n+\tdc := &DisruptionController{\n+\t\tkubeClient:    kubeClient,\n+\t\tpodController: podInformer.GetController(),\n+\t\tqueue:         workqueue.New(),\n+\t\tbroadcaster:   record.NewBroadcaster(),\n+\t}\n+\tdc.recorder = dc.broadcaster.NewRecorder(api.EventSource{Component: \"controllermanager\"})\n+\n+\tdc.getUpdater = func() updater { return dc.writePdbStatus }\n+\n+\tdc.podLister.Indexer = podInformer.GetIndexer()\n+\n+\tpodInformer.AddEventHandler(framework.ResourceEventHandlerFuncs{\n+\t\tAddFunc:    dc.addPod,\n+\t\tUpdateFunc: dc.updatePod,\n+\t\tDeleteFunc: dc.deletePod,\n+\t})\n+\n+\tdc.pdbStore, dc.pdbController = framework.NewInformer(\n+\t\t&cache.ListWatch{\n+\t\t\tListFunc: func(options api.ListOptions) (runtime.Object, error) {\n+\t\t\t\treturn dc.kubeClient.Policy().PodDisruptionBudgets(api.NamespaceAll).List(options)\n+\t\t\t},\n+\t\t\tWatchFunc: func(options api.ListOptions) (watch.Interface, error) {\n+\t\t\t\treturn dc.kubeClient.Policy().PodDisruptionBudgets(api.NamespaceAll).Watch(options)\n+\t\t\t},\n+\t\t},\n+\t\t&policy.PodDisruptionBudget{},\n+\t\t30*time.Second,\n+\t\tframework.ResourceEventHandlerFuncs{\n+\t\t\tAddFunc:    dc.addDb,\n+\t\t\tUpdateFunc: dc.updateDb,\n+\t\t\tDeleteFunc: dc.removeDb,\n+\t\t},\n+\t)\n+\tdc.pdbLister.Store = dc.pdbStore\n+\n+\tdc.rcIndexer, dc.rcController = framework.NewIndexerInformer(\n+\t\t&cache.ListWatch{\n+\t\t\tListFunc: func(options api.ListOptions) (runtime.Object, error) {\n+\t\t\t\treturn dc.kubeClient.ReplicationControllers(api.NamespaceAll).List(options)\n+\t\t\t},\n+\t\t\tWatchFunc: func(options api.ListOptions) (watch.Interface, error) {\n+\t\t\t\treturn dc.kubeClient.ReplicationControllers(api.NamespaceAll).Watch(options)\n+\t\t\t},\n+\t\t},\n+\t\t&api.ReplicationController{},\n+\t\t30*time.Second,\n+\t\tframework.ResourceEventHandlerFuncs{},\n+\t\tcache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},\n+\t)\n+\n+\tdc.rcLister.Indexer = dc.rcIndexer\n+\n+\tdc.rsStore, dc.rsController = framework.NewInformer(\n+\t\t&cache.ListWatch{\n+\t\t\tListFunc: func(options api.ListOptions) (runtime.Object, error) {\n+\t\t\t\treturn dc.kubeClient.Extensions().ReplicaSets(api.NamespaceAll).List(options)\n+\t\t\t},\n+\t\t\tWatchFunc: func(options api.ListOptions) (watch.Interface, error) {\n+\t\t\t\treturn dc.kubeClient.Extensions().ReplicaSets(api.NamespaceAll).Watch(options)\n+\t\t\t},\n+\t\t},\n+\t\t&extensions.ReplicaSet{},\n+\t\t30*time.Second,\n+\t\tframework.ResourceEventHandlerFuncs{},\n+\t)\n+\n+\tdc.rsLister.Store = dc.rsStore\n+\n+\tdc.dStore, dc.dController = framework.NewInformer(\n+\t\t&cache.ListWatch{\n+\t\t\tListFunc: func(options api.ListOptions) (runtime.Object, error) {\n+\t\t\t\treturn dc.kubeClient.Extensions().Deployments(api.NamespaceAll).List(options)\n+\t\t\t},\n+\t\t\tWatchFunc: func(options api.ListOptions) (watch.Interface, error) {\n+\t\t\t\treturn dc.kubeClient.Extensions().Deployments(api.NamespaceAll).Watch(options)\n+\t\t\t},\n+\t\t},\n+\t\t&extensions.Deployment{},\n+\t\t30*time.Second,\n+\t\tframework.ResourceEventHandlerFuncs{},\n+\t)\n+\n+\tdc.dLister.Store = dc.dStore\n+\n+\treturn dc\n+}\n+\n+// TODO(mml): When controllerRef is implemented (#2210), we *could* simply\n+// return controllers without their scales, and access scale type-generically\n+// via the scale subresource.  That may not be as much of a win as it sounds,\n+// however.  We are accessing everything through the pkg/client/cache API that\n+// we have to set up and tune to the types we know we'll be accessing anyway,\n+// and we may well need further tweaks just to be able to access scale\n+// subresources.\n+func (dc *DisruptionController) finders() []podControllerFinder {\n+\treturn []podControllerFinder{dc.getPodReplicationControllers, dc.getPodDeployments, dc.getPodReplicaSets}\n+}\n+\n+/* getPodReplicaSets finds replicasets which have no matching deployments.\n+ */\n+func (dc *DisruptionController) getPodReplicaSets(pod *api.Pod) ([]controllerAndScale, error) {\n+\tcas := []controllerAndScale{}\n+\trss, err := dc.rsLister.GetPodReplicaSets(pod)\n+\t// GetPodReplicaSets returns an error only if no ReplicaSets are found.  We\n+\t// don't return that as an error to the caller.\n+\tif err != nil {\n+\t\treturn cas, nil\n+\t}\n+\tcontrollerScale := map[types.UID]int32{}\n+\tfor _, rs := range rss {\n+\t\t// GetDeploymentsForReplicaSet returns an error only if no matching\n+\t\t// deployments are found.\n+\t\t_, err := dc.dLister.GetDeploymentsForReplicaSet(&rs)\n+\t\tif err == nil { // A deployment was found, so this finder will not count this RS.\n+\t\t\tcontinue\n+\t\t}\n+\t\tcontrollerScale[rs.UID] = rs.Spec.Replicas\n+\t}\n+\n+\tfor uid, scale := range controllerScale {\n+\t\tcas = append(cas, controllerAndScale{UID: uid, scale: scale})\n+\t}\n+\n+\treturn cas, nil\n+}\n+\n+/* getPodDeployments finds deployments for any replicasets which are being managed by deployments.\n+ */\n+func (dc *DisruptionController) getPodDeployments(pod *api.Pod) ([]controllerAndScale, error) {\n+\tcas := []controllerAndScale{}\n+\trss, err := dc.rsLister.GetPodReplicaSets(pod)\n+\t// GetPodReplicaSets returns an error only if no ReplicaSets are found.  We\n+\t// don't return that as an error to the caller.\n+\tif err != nil {\n+\t\treturn cas, nil\n+\t}\n+\tcontrollerScale := map[types.UID]int32{}\n+\tfor _, rs := range rss {\n+\t\t// GetDeploymentsForReplicaSet returns an error only if no matching\n+\t\t// deployments are found.  We don't return that as an error to the caller.\n+\t\tds, err := dc.dLister.GetDeploymentsForReplicaSet(&rs)\n+\t\tif err != nil {\n+\t\t\treturn cas, nil\n+\t\t}\n+\t\tfor _, d := range ds {\n+\t\t\tcontrollerScale[d.UID] = d.Spec.Replicas\n+\t\t}\n+\t}\n+\n+\tfor uid, scale := range controllerScale {\n+\t\tcas = append(cas, controllerAndScale{UID: uid, scale: scale})\n+\t}\n+\n+\treturn cas, nil\n+}\n+\n+func (dc *DisruptionController) getPodReplicationControllers(pod *api.Pod) ([]controllerAndScale, error) {\n+\tcas := []controllerAndScale{}\n+\trcs, err := dc.rcLister.GetPodControllers(pod)\n+\tif err == nil {\n+\t\tfor _, rc := range rcs {\n+\t\t\tcas = append(cas, controllerAndScale{UID: rc.UID, scale: rc.Spec.Replicas})\n+\t\t}\n+\t}\n+\treturn cas, nil\n+}\n+\n+func (dc *DisruptionController) Run(stopCh <-chan struct{}) {\n+\tglog.Infof(\"Starting disruption controller\")\n+\tif dc.kubeClient != nil {\n+\t\tglog.V(0).Infof(\"Sending events to api server.\")\n+\t\tdc.broadcaster.StartRecordingToSink(dc.kubeClient.Events(\"\"))\n+\t} else {\n+\t\tglog.V(0).Infof(\"No api server defined - no events will be sent to API server.\")\n+\t}\n+\tgo dc.pdbController.Run(stopCh)\n+\tgo dc.podController.Run(stopCh)\n+\tgo dc.rcController.Run(stopCh)\n+\tgo dc.rsController.Run(stopCh)\n+\tgo dc.dController.Run(stopCh)\n+\tgo wait.Until(dc.worker, time.Second, stopCh)\n+\t<-stopCh\n+\tglog.Infof(\"Shutting down disruption controller\")\n+}\n+\n+func (dc *DisruptionController) addDb(obj interface{}) {\n+\tpdb := obj.(*policy.PodDisruptionBudget)\n+\tglog.Infof(\"add DB %q\", pdb.Name)\n+\tdc.enqueuePdb(pdb)\n+}\n+\n+func (dc *DisruptionController) updateDb(old, cur interface{}) {\n+\tpdb := cur.(*policy.PodDisruptionBudget)\n+\tglog.Infof(\"update DB %q\", pdb.Name)\n+\tdc.enqueuePdb(pdb)\n+}\n+\n+func (dc *DisruptionController) removeDb(obj interface{}) {\n+\tpdb := obj.(*policy.PodDisruptionBudget)\n+\tglog.Infof(\"remove DB %q\", pdb.Name)\n+\tdc.enqueuePdb(pdb)\n+}\n+\n+func (dc *DisruptionController) addPod(obj interface{}) {\n+\tpod := obj.(*api.Pod)\n+\tglog.Infof(\"addPod called on pod %q\", pod.Name)\n+\tpdb := dc.getPdbForPod(pod)\n+\tif pdb == nil {\n+\t\tglog.Infof(\"No matching pdb for pod %q\", pod.Name)\n+\t\treturn\n+\t}\n+\tglog.Infof(\"addPod %q -> PDB %q\", pod.Name, pdb.Name)\n+\tdc.enqueuePdb(pdb)\n+}\n+\n+func (dc *DisruptionController) updatePod(old, cur interface{}) {\n+\tpod := cur.(*api.Pod)\n+\tglog.Infof(\"updatePod called on pod %q\", pod.Name)\n+\tpdb := dc.getPdbForPod(pod)\n+\tif pdb == nil {\n+\t\tglog.Infof(\"No matching pdb for pod %q\", pod.Name)\n+\t\treturn\n+\t}\n+\tglog.Infof(\"updatePod %q -> PDB %q\", pod.Name, pdb.Name)\n+\tdc.enqueuePdb(pdb)\n+}\n+\n+func (dc *DisruptionController) deletePod(obj interface{}) {\n+\tpod := obj.(*api.Pod)\n+\tglog.Infof(\"deletePod called on pod %q\", pod.Name)\n+\tpdb := dc.getPdbForPod(pod)\n+\tif pdb == nil {\n+\t\tglog.Infof(\"No matching pdb for pod %q\", pod.Name)\n+\t\treturn\n+\t}\n+\tglog.Infof(\"deletePod %q -> PDB %q\", pod.Name, pdb.Name)\n+\tdc.enqueuePdb(pdb)\n+}\n+\n+func (dc *DisruptionController) enqueuePdb(pdb *policy.PodDisruptionBudget) {\n+\tkey, err := controller.KeyFunc(pdb)\n+\tif err != nil {\n+\t\tglog.Errorf(\"Cound't get key for PodDisruptionBudget object %+v: %v\", pdb, err)\n+\t\treturn\n+\t}\n+\tdc.queue.Add(key)\n+}\n+\n+func (dc *DisruptionController) getPdbForPod(pod *api.Pod) *policy.PodDisruptionBudget {\n+\t// GetPodPodDisruptionBudgets returns an error only if no\n+\t// PodDisruptionBudgets are found.  We don't return that as an error to the\n+\t// caller.\n+\tpdbs, err := dc.pdbLister.GetPodPodDisruptionBudgets(pod)\n+\tif err != nil {\n+\t\tglog.Infof(\"No PodDisruptionBudgets found for pod %v, PodDisruptionBudget controller will avoid syncing.\", pod.Name)\n+\t\treturn nil\n+\t}\n+\n+\tif len(pdbs) > 1 {\n+\t\tmsg := fmt.Sprintf(\"Pod %q/%q matches multiple PodDisruptionBudgets.  Chose %q arbitrarily.\", pod.Namespace, pod.Name, pdbs[0].Name)\n+\t\tglog.Warning(msg)\n+\t\tdc.recorder.Event(pod, api.EventTypeWarning, \"MultiplePodDisruptionBudgets\", msg)\n+\t}\n+\treturn &pdbs[0]\n+}\n+\n+func (dc *DisruptionController) getPodsForPdb(pdb *policy.PodDisruptionBudget) ([]*api.Pod, error) {\n+\tsel, err := unversioned.LabelSelectorAsSelector(pdb.Spec.Selector)\n+\tif sel.Empty() {\n+\t\treturn []*api.Pod{}, nil\n+\t}\n+\tif err != nil {\n+\t\treturn []*api.Pod{}, err\n+\t}\n+\tpodList, err := dc.podLister.Pods(pdb.Namespace).List(sel)\n+\tif err != nil {\n+\t\treturn []*api.Pod{}, err\n+\t}\n+\tpods := []*api.Pod{}\n+\tfor _, p := range podList.Items {\n+\t\tobj, err := api.Scheme.DeepCopy(p)\n+\t\tif err != nil {\n+\t\t\treturn []*api.Pod{}, err\n+\t\t}\n+\t\tpod := obj.(api.Pod)\n+\t\tpods = append(pods, &pod)\n+\t}\n+\treturn pods, nil\n+}\n+\n+func (dc *DisruptionController) worker() {\n+\tfor {\n+\t\tfunc() {\n+\t\t\tkey, quit := dc.queue.Get()\n+\t\t\tif quit {\n+\t\t\t\treturn\n+\t\t\t}\n+\t\t\tdefer dc.queue.Done(key)\n+\t\t\tglog.Infof(\"Syncing PodDisruptionBudget %q\", key.(string))\n+\t\t\tif err := dc.sync(key.(string)); err != nil {\n+\t\t\t\tglog.Errorf(\"Error syncing PodDisruptionBudget %v, requeuing: %v\", key.(string), err)\n+\t\t\t\t// TODO(mml): In order to be safe in the face of a total inability to write state\n+\t\t\t\t// changes, we should write an expiration timestamp here and consumers\n+\t\t\t\t// of the PDB state (the /evict subresource handler) should check that\n+\t\t\t\t// any 'true' state is relatively fresh.\n+\n+\t\t\t\t// TODO(mml): file an issue to that effect\n+\t\t\t\tdc.queue.Add(key)\n+\t\t\t}\n+\t\t}()\n+\t}\n+}\n+\n+func (dc *DisruptionController) sync(key string) error {\n+\tstartTime := time.Now()\n+\tdefer func() {\n+\t\tglog.V(4).Infof(\"Finished syncing PodDisruptionBudget %q (%v)\", key, time.Now().Sub(startTime))\n+\t}()\n+\n+\tobj, exists, err := dc.pdbLister.Store.GetByKey(key)\n+\tif !exists {\n+\t\treturn err\n+\t}\n+\tif err != nil {\n+\t\tglog.Errorf(\"Unable to retrieve PodDisruptionBudget %v from store: %v\", key, err)\n+\t\treturn err\n+\t}\n+\n+\tpdb := obj.(*policy.PodDisruptionBudget)\n+\n+\tif err := dc.trySync(pdb); err != nil {\n+\t\treturn dc.failSafe(pdb)\n+\t}\n+\n+\treturn nil\n+}\n+\n+func (dc *DisruptionController) trySync(pdb *policy.PodDisruptionBudget) error {\n+\tpods, err := dc.getPodsForPdb(pdb)\n+\tif err != nil {\n+\t\treturn err\n+\t}\n+\n+\texpectedCount, desiredHealthy, err := dc.getExpectedPodCount(pdb, pods)\n+\tif err != nil {\n+\t\treturn err\n+\t}\n+\n+\tcurrentHealthy := dc.countHealthyPods(pdb, pods)\n+\terr = dc.updatePdbSpec(pdb, currentHealthy, desiredHealthy, expectedCount)\n+\n+\treturn err\n+}\n+\n+func (dc *DisruptionController) getExpectedPodCount(pdb *policy.PodDisruptionBudget, pods []*api.Pod) (expectedCount, desiredHealthy int32, err error) {\n+\terr = nil\n+\tif pdb.Spec.MinAvailable.Type == intstr.Int {\n+\t\tdesiredHealthy = pdb.Spec.MinAvailable.IntVal\n+\t\texpectedCount = int32(len(pods))\n+\t} else if pdb.Spec.MinAvailable.Type == intstr.String {\n+\t\t// When the user specifies a fraction of pods that must be available, we\n+\t\t// use as the fraction's denominator\n+\t\t// SUM_{all c in C} scale(c)\n+\t\t// where C is the union of C_p1, C_p2, ..., C_pN\n+\t\t// and each C_pi is the set of controllers controlling the pod pi\n+\n+\t\t// k8s only defines what will happens when 0 or 1 controllers control a\n+\t\t// given pod.  We explicitly exclude the 0 controllers case here, and we\n+\t\t// report an error if we find a pod with more than 1 controller.  Thus in\n+\t\t// practice each C_pi is a set of exactly 1 controller.\n+\n+\t\t// A mapping from controllers to their scale.\n+\t\tcontrollerScale := map[types.UID]int32{}\n+\n+\t\t// 1. Find the controller(s) for each pod.  If any pod has 0 controllers,\n+\t\t// that's an error.  If any pod has more than 1 controller, that's also an\n+\t\t// error.\n+\t\tfor _, pod := range pods {\n+\t\t\tcontrollerCount := 0\n+\t\t\tfor _, finder := range dc.finders() {\n+\t\t\t\tvar controllers []controllerAndScale\n+\t\t\t\tcontrollers, err = finder(pod)\n+\t\t\t\tif err != nil {\n+\t\t\t\t\treturn\n+\t\t\t\t}\n+\t\t\t\tfor _, controller := range controllers {\n+\t\t\t\t\tcontrollerScale[controller.UID] = controller.scale\n+\t\t\t\t\tcontrollerCount++\n+\t\t\t\t}\n+\t\t\t}\n+\t\t\tif controllerCount == 0 {\n+\t\t\t\terr = fmt.Errorf(\"Asked for percentage, but found no controllers for pod %q\", pod.Name)\n+\t\t\t\treturn\n+\t\t\t} else if controllerCount > 1 {\n+\t\t\t\terr = fmt.Errorf(\"Pod %q has %v>1 controllers\", pod.Name, controllerCount)\n+\t\t\t\treturn\n+\t\t\t}\n+\t\t}\n+\n+\t\t// 2. Add up all the controllers.\n+\t\texpectedCount = 0\n+\t\tfor _, count := range controllerScale {\n+\t\t\texpectedCount += count\n+\t\t}\n+\n+\t\t// 3. Do the math.\n+\t\tvar dh int\n+\t\tdh, err = intstr.GetValueFromIntOrPercent(&pdb.Spec.MinAvailable, int(expectedCount), true)\n+\t\tif err != nil {\n+\t\t\treturn\n+\t\t}\n+\t\tdesiredHealthy = int32(dh)\n+\t}\n+\n+\treturn\n+}\n+\n+func (dc *DisruptionController) countHealthyPods(pdb *policy.PodDisruptionBudget, pods []*api.Pod) (currentHealthy int32) {\n+\tcurrentHealthy = 0\n+\n+Pod:\n+\tfor _, pod := range pods {\n+\t\tfor _, c := range pod.Status.Conditions {\n+\t\t\tif c.Type == api.PodReady && c.Status == api.ConditionTrue {\n+\t\t\t\tcurrentHealthy++\n+\t\t\t\tcontinue Pod\n+\t\t\t}\n+\t\t}\n+\t}\n+\n+\treturn\n+}\n+\n+func (dc *DisruptionController) failSafe(pdb *policy.PodDisruptionBudget) error {\n+\tobj, err := api.Scheme.DeepCopy(*pdb)\n+\tif err != nil {\n+\t\treturn err\n+\t}\n+\tnewPdb := obj.(policy.PodDisruptionBudget)\n+\tnewPdb.Status.PodDisruptionAllowed = false","path":"pkg/controller/disruption/disruption.go","position":527,"original_position":529,"commit_id":"060e34b64ea7734db478e225040178afa508cfb0","original_commit_id":"f41f9dbe115f70c0645770db92e33dd6a7046781","user":{"login":"smarterclayton","id":1163175,"avatar_url":"https://avatars.githubusercontent.com/u/1163175?v=3","gravatar_id":"","url":"https://api.github.com/users/smarterclayton","html_url":"https://github.com/smarterclayton","followers_url":"https://api.github.com/users/smarterclayton/followers","following_url":"https://api.github.com/users/smarterclayton/following{/other_user}","gists_url":"https://api.github.com/users/smarterclayton/gists{/gist_id}","starred_url":"https://api.github.com/users/smarterclayton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smarterclayton/subscriptions","organizations_url":"https://api.github.com/users/smarterclayton/orgs","repos_url":"https://api.github.com/users/smarterclayton/repos","events_url":"https://api.github.com/users/smarterclayton/events{/privacy}","received_events_url":"https://api.github.com/users/smarterclayton/received_events","type":"User","site_admin":false},"body":"The Godoc for the API field can certainly be several sentences long, explaining more details about the implications you describe here.  The Godoc for disruption budget the type can be several paragraphs, and go into more detail about how it's used.  That's at least documentation available in the CLI (to `kubectl explain disruptionbudget`)","created_at":"2016-08-03T14:37:46Z","updated_at":"2016-08-03T14:37:46Z","html_url":"https://github.com/kubernetes/kubernetes/pull/25921#discussion_r73349828","pull_request_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/25921","_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/73349828"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/25921#discussion_r73349828"},"pull_request":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/25921"}}},"pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/25921","id":70777481,"html_url":"https://github.com/kubernetes/kubernetes/pull/25921","diff_url":"https://github.com/kubernetes/kubernetes/pull/25921.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/25921.patch","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/25921","number":25921,"state":"open","locked":false,"title":"Implement DisruptionController.","user":{"login":"mml","id":3115,"avatar_url":"https://avatars.githubusercontent.com/u/3115?v=3","gravatar_id":"","url":"https://api.github.com/users/mml","html_url":"https://github.com/mml","followers_url":"https://api.github.com/users/mml/followers","following_url":"https://api.github.com/users/mml/following{/other_user}","gists_url":"https://api.github.com/users/mml/gists{/gist_id}","starred_url":"https://api.github.com/users/mml/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mml/subscriptions","organizations_url":"https://api.github.com/users/mml/orgs","repos_url":"https://api.github.com/users/mml/repos","events_url":"https://api.github.com/users/mml/events{/privacy}","received_events_url":"https://api.github.com/users/mml/received_events","type":"User","site_admin":false},"body":"Part of #12611\n\nThis currently also includes a pending commit from #25895","created_at":"2016-05-19T22:43:49Z","updated_at":"2016-08-03T14:37:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"53cee9fe2bbde31ca4a4bd636bb09c9a353b7413","assignee":{"login":"davidopp","id":8264113,"avatar_url":"https://avatars.githubusercontent.com/u/8264113?v=3","gravatar_id":"","url":"https://api.github.com/users/davidopp","html_url":"https://github.com/davidopp","followers_url":"https://api.github.com/users/davidopp/followers","following_url":"https://api.github.com/users/davidopp/following{/other_user}","gists_url":"https://api.github.com/users/davidopp/gists{/gist_id}","starred_url":"https://api.github.com/users/davidopp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidopp/subscriptions","organizations_url":"https://api.github.com/users/davidopp/orgs","repos_url":"https://api.github.com/users/davidopp/repos","events_url":"https://api.github.com/users/davidopp/events{/privacy}","received_events_url":"https://api.github.com/users/davidopp/received_events","type":"User","site_admin":false},"assignees":[{"login":"davidopp","id":8264113,"avatar_url":"https://avatars.githubusercontent.com/u/8264113?v=3","gravatar_id":"","url":"https://api.github.com/users/davidopp","html_url":"https://github.com/davidopp","followers_url":"https://api.github.com/users/davidopp/followers","following_url":"https://api.github.com/users/davidopp/following{/other_user}","gists_url":"https://api.github.com/users/davidopp/gists{/gist_id}","starred_url":"https://api.github.com/users/davidopp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidopp/subscriptions","organizations_url":"https://api.github.com/users/davidopp/orgs","repos_url":"https://api.github.com/users/davidopp/repos","events_url":"https://api.github.com/users/davidopp/events{/privacy}","received_events_url":"https://api.github.com/users/davidopp/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/25921/commits","review_comments_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/25921/comments","review_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/25921/comments","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/060e34b64ea7734db478e225040178afa508cfb0","head":{"label":"mml:db.controller","ref":"db.controller","sha":"060e34b64ea7734db478e225040178afa508cfb0","user":{"login":"mml","id":3115,"avatar_url":"https://avatars.githubusercontent.com/u/3115?v=3","gravatar_id":"","url":"https://api.github.com/users/mml","html_url":"https://github.com/mml","followers_url":"https://api.github.com/users/mml/followers","following_url":"https://api.github.com/users/mml/following{/other_user}","gists_url":"https://api.github.com/users/mml/gists{/gist_id}","starred_url":"https://api.github.com/users/mml/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mml/subscriptions","organizations_url":"https://api.github.com/users/mml/orgs","repos_url":"https://api.github.com/users/mml/repos","events_url":"https://api.github.com/users/mml/events{/privacy}","received_events_url":"https://api.github.com/users/mml/received_events","type":"User","site_admin":false},"repo":{"id":45429185,"name":"kubernetes","full_name":"mml/kubernetes","owner":{"login":"mml","id":3115,"avatar_url":"https://avatars.githubusercontent.com/u/3115?v=3","gravatar_id":"","url":"https://api.github.com/users/mml","html_url":"https://github.com/mml","followers_url":"https://api.github.com/users/mml/followers","following_url":"https://api.github.com/users/mml/following{/other_user}","gists_url":"https://api.github.com/users/mml/gists{/gist_id}","starred_url":"https://api.github.com/users/mml/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mml/subscriptions","organizations_url":"https://api.github.com/users/mml/orgs","repos_url":"https://api.github.com/users/mml/repos","events_url":"https://api.github.com/users/mml/events{/privacy}","received_events_url":"https://api.github.com/users/mml/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mml/kubernetes","description":"Container Cluster Manager from Google","fork":true,"url":"https://api.github.com/repos/mml/kubernetes","forks_url":"https://api.github.com/repos/mml/kubernetes/forks","keys_url":"https://api.github.com/repos/mml/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mml/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mml/kubernetes/teams","hooks_url":"https://api.github.com/repos/mml/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/mml/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/mml/kubernetes/events","assignees_url":"https://api.github.com/repos/mml/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/mml/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/mml/kubernetes/tags","blobs_url":"https://api.github.com/repos/mml/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mml/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mml/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/mml/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mml/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/mml/kubernetes/languages","stargazers_url":"https://api.github.com/repos/mml/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/mml/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/mml/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/mml/kubernetes/subscription","commits_url":"https://api.github.com/repos/mml/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/mml/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/mml/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/mml/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/mml/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/mml/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mml/kubernetes/merges","archive_url":"https://api.github.com/repos/mml/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mml/kubernetes/downloads","issues_url":"https://api.github.com/repos/mml/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/mml/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/mml/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/mml/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mml/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/mml/kubernetes/releases{/id}","deployments_url":"https://api.github.com/repos/mml/kubernetes/deployments","created_at":"2015-11-02T23:37:23Z","updated_at":"2016-04-05T23:13:38Z","pushed_at":"2016-08-02T19:22:56Z","git_url":"git://github.com/mml/kubernetes.git","ssh_url":"git@github.com:mml/kubernetes.git","clone_url":"https://github.com/mml/kubernetes.git","svn_url":"https://github.com/mml/kubernetes","homepage":"http://kubernetes.io","size":299205,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"kubernetes:master","ref":"master","sha":"e5890d9ea5d9e32682d866bf2b224b33b0ab7a5f","user":{"login":"kubernetes","id":13629408,"avatar_url":"https://avatars.githubusercontent.com/u/13629408?v=3","gravatar_id":"","url":"https://api.github.com/users/kubernetes","html_url":"https://github.com/kubernetes","followers_url":"https://api.github.com/users/kubernetes/followers","following_url":"https://api.github.com/users/kubernetes/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes/subscriptions","organizations_url":"https://api.github.com/users/kubernetes/orgs","repos_url":"https://api.github.com/users/kubernetes/repos","events_url":"https://api.github.com/users/kubernetes/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes/received_events","type":"Organization","site_admin":false},"repo":{"id":20580498,"name":"kubernetes","full_name":"kubernetes/kubernetes","owner":{"login":"kubernetes","id":13629408,"avatar_url":"https://avatars.githubusercontent.com/u/13629408?v=3","gravatar_id":"","url":"https://api.github.com/users/kubernetes","html_url":"https://github.com/kubernetes","followers_url":"https://api.github.com/users/kubernetes/followers","following_url":"https://api.github.com/users/kubernetes/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes/subscriptions","organizations_url":"https://api.github.com/users/kubernetes/orgs","repos_url":"https://api.github.com/users/kubernetes/repos","events_url":"https://api.github.com/users/kubernetes/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kubernetes/kubernetes","description":"Production-Grade Container Scheduling and Management","fork":false,"url":"https://api.github.com/repos/kubernetes/kubernetes","forks_url":"https://api.github.com/repos/kubernetes/kubernetes/forks","keys_url":"https://api.github.com/repos/kubernetes/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kubernetes/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kubernetes/kubernetes/teams","hooks_url":"https://api.github.com/repos/kubernetes/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/kubernetes/kubernetes/events","assignees_url":"https://api.github.com/repos/kubernetes/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/kubernetes/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/kubernetes/kubernetes/tags","blobs_url":"https://api.github.com/repos/kubernetes/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kubernetes/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kubernetes/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/kubernetes/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/kubernetes/kubernetes/languages","stargazers_url":"https://api.github.com/repos/kubernetes/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/kubernetes/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/kubernetes/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/kubernetes/kubernetes/subscription","commits_url":"https://api.github.com/repos/kubernetes/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/kubernetes/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/kubernetes/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/kubernetes/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kubernetes/kubernetes/merges","archive_url":"https://api.github.com/repos/kubernetes/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kubernetes/kubernetes/downloads","issues_url":"https://api.github.com/repos/kubernetes/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/kubernetes/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/kubernetes/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/kubernetes/kubernetes/releases{/id}","deployments_url":"https://api.github.com/repos/kubernetes/kubernetes/deployments","created_at":"2014-06-06T22:56:04Z","updated_at":"2016-08-03T13:25:48Z","pushed_at":"2016-08-03T14:33:01Z","git_url":"git://github.com/kubernetes/kubernetes.git","ssh_url":"git@github.com:kubernetes/kubernetes.git","clone_url":"https://github.com/kubernetes/kubernetes.git","svn_url":"https://github.com/kubernetes/kubernetes","homepage":"http://kubernetes.io","size":512809,"stargazers_count":15929,"watchers_count":15929,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":5040,"mirror_url":null,"open_issues_count":4102,"forks":5040,"open_issues":4102,"watchers":15929,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/25921"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/25921"},"issue":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/25921"},"comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/25921/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/25921/comments"},"review_comment":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/25921/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes/kubernetes/statuses/060e34b64ea7734db478e225040178afa508cfb0"}}}}
{"actor":{"display_login":"smarterclayton"}}