Lightweight Kubernetes
 
 
 
 
Go to file
Kubernetes Submit Queue 7f0004de5a Merge pull request #44379 from guangyouyu/garyyu_master
Automatic merge from submit-queue

Bugfix: cloud-controller-manager routeController.run() block in WaitForCacheSync

**What this PR does / why we need it**:
cloud-controller-manager routeController.run not run in goroutine will block to  wait nodeListerSynced because sharedInformers not started


**Special notes for your reviewer**:

cloud-controller-manager routeController.run  should run in goroutine like the same code in kube-controller-manager,or it will block to  wait nodeListerSynced,but sharedInformers not startd.

```go
//controller-manager.go:197
func StartControllers(s *options.CloudControllerManagerServer, kubeconfig *restclient.Config, rootClientBuilder, clientBuilder controller.ControllerClientBuilder, stop <-chan struct{}, recorder record.EventRecorder, cloud cloudprovider.Interface) error {
	// Function to build the kube client object
	client := func(serviceAccountName string) clientset.Interface {
		return rootClientBuilder.ClientOrDie(serviceAccountName)
	}
	versionedClient := client("shared-informers")
	sharedInformers := informers.NewSharedInformerFactory(versionedClient, resyncPeriod(s)())
ocateNodeCIDRs && s.ConfigureCloudRoutes {
		if routes, ok := cloud.Routes(); !ok {
			glog.Warning("configure-cloud-routes is set, but cloud provider does not support routes. Will not configure cloud provider routes.")
		} else {
			routeController := routecontroller.New(routes, client("route-controller"), sharedInformers.Core().V1().Nodes(), s.ClusterName, clusterCIDR)
                       //should run in goroutine
----->		routeController.Run(stop, s.RouteReconciliationPeriod.Duration)
			time.Sleep(wait.Jitter(s.ControllerStartInterval.Duration, ControllerStartJitter))
		}
	} else {
		glog.Infof("Will not configure cloud provider routes for allocate-node-cidrs: %v, configure-cloud-routes: %v.", s.AllocateNodeCIDRs, s.ConfigureCloudRoutes)
	}

---> 	sharedInformers.Start(stop)

	select {}
}



//routecontroller.go:77
func (rc *RouteController) Run(stopCh <-chan struct{}, syncPeriod time.Duration) {
	defer utilruntime.HandleCrash()

	glog.Info("Starting the route controller")
       //will block
--->   	if !cache.WaitForCacheSync(stopCh, rc.nodeListerSynced) {
		utilruntime.HandleError(fmt.Errorf("timed out waiting for caches to sync"))
		return
	}

	go wait.NonSlidingUntil(func() {
		if err := rc.reconcileNodeRoutes(); err != nil {
			glog.Errorf("Couldn't reconcile node routes: %v", err)
		}
	}, syncPeriod, wait.NeverStop)
}
```
2017-04-12 23:58:57 -07:00
.github PR template: Update links to kubernetes/community repo 2017-03-17 12:23:58 -04:00
Godeps Merge pull request #42884 from soltysh/issue41655 2017-04-12 14:46:38 -07:00
api Regenerate files 2017-04-10 09:00:48 -04:00
build Bump K8S_GOLANG_EDGE_VERSION to 1.8.1 2017-04-07 14:51:18 -04:00
cluster Merge pull request #44064 from ixdy/get-kube-ci 2017-04-12 13:39:00 -07:00
cmd Merge pull request #44379 from guangyouyu/garyyu_master 2017-04-12 23:58:57 -07:00
docs Regenerate files 2017-04-10 09:00:48 -04:00
examples Merge pull request #43396 from rootfs/iscsi-chap 2017-04-07 14:09:42 -07:00
federation Merge pull request #44380 from justinsb/route53_avoid_panic 2017-04-12 22:26:19 -07:00
hack Merge pull request #43831 from jayunit100/local-up-conformance 2017-04-12 20:44:02 -07:00
hooks
logo Updated top level owners file to match new format 2017-01-19 11:29:16 -08:00
pkg Merge pull request #44391 from ncdc/reduce-rc-logging 2017-04-12 23:13:22 -07:00
plugin Merge pull request #43698 from sttts/sttts-non-global-admission-plugin-registry 2017-04-12 04:12:11 -07:00
staging Merge pull request #43085 from sttts/sttts-duplicated-meta-conversions 2017-04-12 07:01:09 -07:00
test Merge pull request #43548 from lukaszo/ds-avail 2017-04-12 21:39:00 -07:00
third_party Add forked etcd 2.2.1 code to allow rollback to 2.2.1 version 2017-02-10 13:56:01 +01:00
translations Extract a bunch more strings from kubectl 2017-04-06 20:12:50 -07:00
vendor Merge pull request #42884 from soltysh/issue41655 2017-04-12 14:46:38 -07:00
.bazelrc Add verify-gofmt as a Bazel test. 2017-02-10 17:00:28 -08:00
.gazelcfg.json Generate a dummy BUILD file in _output/local/go to keep Bazel out of trouble 2017-01-05 22:05:17 -08:00
.generated_files Move .generated_docs to docs/ so docs OWNERS can review / approve 2017-02-16 10:11:57 -08:00
.gitattributes
.gitignore Add cscope related files into .gitignore. 2016-12-21 10:35:14 +08:00
BUILD.bazel Adds fstype support in storage class for Photon Cloud Provider. 2017-04-04 12:17:52 -07:00
CHANGELOG.md Modify change log to warn user of the hostpid bug 2017-04-10 08:56:37 -07:00
CONTRIBUTING.md Close kubernetes/community#420 2017-03-08 09:59:30 -08:00
LICENSE
Makefile test/e2e_node: prepull images with CRI 2017-04-01 10:18:56 +02:00
Makefile.generated_files Remove a from each codegen path 2016-12-30 18:44:32 -08:00
OWNERS Add wojtec to global approvers 2017-01-25 11:57:00 -06:00
OWNERS_ALIASES Merge pull request #42953 from kargakis/rm-myself 2017-04-03 01:50:58 -07:00
README.md Update link in README after docs migration 2017-03-30 12:43:39 -07:00
Vagrantfile
WORKSPACE Bump rules_go to latest 2017-04-03 16:03:23 -07:00
code-of-conduct.md
labels.yaml

README.md

Kubernetes

Submit Queue Widget GoDoc Widget


Kubernetes is an open source system for managing containerized applications across multiple hosts, providing basic mechanisms for deployment, maintenance, and scaling of applications.

Kubernetes builds upon a decade and a half of experience at Google running production workloads at scale using a system called Borg, combined with best-of-breed ideas and practices from the community.

Kubernetes is hosted by the Cloud Native Computing Foundation (CNCF). If you are a company that wants to help shape the evolution of technologies that are container-packaged, dynamically-scheduled and microservices-oriented, consider joining the CNCF. For details about who's involved and how Kubernetes plays a role, read the CNCF announcement.


To start using Kubernetes

See our documentation on kubernetes.io.

Try our interactive tutorial.

Take a free course on Scalable Microservices with Kubernetes.

To start developing Kubernetes

The community repository hosts all information about building Kubernetes from source, how to contribute code and documentation, who to contact about what, etc.

If you want to build Kubernetes right away there are two options:

You have a working Go environment.
$ go get -d k8s.io/kubernetes
$ cd $GOPATH/src/k8s.io/kubernetes
$ make
You have a working Docker environment.
$ git clone https://github.com/kubernetes/kubernetes
$ cd kubernetes
$ make quick-release

If you are less impatient, head over to the developer's documentation.

Support

If you need support, start with the troubleshooting guide and work your way through the process that we've outlined.

That said, if you have questions, reach out to us one way or another.

Analytics