Production-Grade Container Scheduling and Management
Go to file
Kubernetes Submit Queue 9590b94f7c Merge pull request #45070 from alindeman/container-heap
Automatic merge from submit-queue

Uses container/heap for DelayingQueue

The current implementation of DelayingQueue doesn't perform very well when a large number of items (at random delays) are inserted. The original authors seemed to be aware of this and noted it in a `TODO` comment. This is my attempt at switching the implementation to use a priority queue based on `container/heap`.

Benchmarks from before the change:
```
╰─ go test -bench=. -benchmem | tee /tmp/before.txt
BenchmarkDelayingQueue_AddAfter-8         300000            256824 ns/op             520 B/op          3 allocs/op
PASS
ok      k8s.io/kubernetes/staging/src/k8s.io/client-go/util/workqueue   77.237s
```

After:
```
╰─ go test -bench=. -benchmem | tee /tmp/after.txt
BenchmarkDelayingQueue_AddAfter-8         500000              3519 ns/op             406 B/op          4 allocs/op
PASS
ok      k8s.io/kubernetes/staging/src/k8s.io/client-go/util/workqueue   2.969s
```

Comparison:
```
╰─ benchcmp /tmp/before.txt /tmp/after.txt
benchmark                             old ns/op     new ns/op     delta
BenchmarkDelayingQueue_AddAfter-8     256824        3519          -98.63%

benchmark                             old allocs     new allocs     delta
BenchmarkDelayingQueue_AddAfter-8     3              4              +33.33%

benchmark                             old bytes     new bytes     delta
BenchmarkDelayingQueue_AddAfter-8     520           406           -21.92%
```

I also find the `container/heap`-based code a bit more easy to understand. The implementation of the PriorityQueue is based on the documentation for `container/heap`.

Feedback definitely welcomed. This is one of my first contributions.

```release-note
NONE
```
2017-05-15 07:06:03 -07:00
.github PR template: Update links to kubernetes/community repo 2017-03-17 12:23:58 -04:00
api Merge pull request #41162 from MrHohn/esipp-ga 2017-05-12 15:00:46 -07:00
build Only tag release containers if the name is different. 2017-05-04 18:43:23 -07:00
cluster Merge pull request #45730 from shyamjvs/remove-kubemark-sh 2017-05-12 12:12:48 -07:00
cmd Merge pull request #45692 from caesarxuchao/limit-client-go-package-import-2 2017-05-12 16:04:37 -07:00
docs Merge pull request #41162 from MrHohn/esipp-ga 2017-05-12 15:00:46 -07:00
examples Merge pull request #45469 from jianglingxia/jlx-0508 2017-05-09 21:16:26 -07:00
federation Merge pull request #45798 from shashidharatd/federated-service 2017-05-15 00:47:17 -07:00
Godeps adding support for gpus in node e2e 2017-05-13 16:35:54 -07:00
hack Adding verify-federation-api-reference-docs.sh 2017-05-14 17:20:24 -07:00
hooks
logo
pkg Merge pull request #45741 from DirectXMan12/bug/incorrect-autoscaling-discovery-version 2017-05-15 05:35:49 -07:00
plugin Initialize scheduler cache with assigned non-terminated pods before scheduling. 2017-05-10 01:50:38 +08:00
staging Merge pull request #45070 from alindeman/container-heap 2017-05-15 07:06:03 -07:00
test Fix federated service reconcilation issue due to addition of ExternalTrafficPolicy field to v1.Service 2017-05-15 10:30:51 +05:30
third_party autogenerated 2017-04-14 10:40:57 -07:00
translations Extract a bunch more strings from kubectl 2017-04-06 20:12:50 -07:00
vendor adding support for gpus in node e2e 2017-05-13 16:35:54 -07:00
.bazelrc
.gazelcfg.json Add go_genrule for zz_generated.openapi.go. 2017-04-25 17:51:36 -07:00
.generated_files
.gitattributes
.gitignore Remove verify_gen_openapi make rule. 2017-04-25 17:41:33 -07:00
BUILD.bazel Rename //:ci-artifacts rule to //:push-build, and add a deprecated alias 2017-05-02 16:48:16 -07:00
CHANGELOG.md Update CHANGELOG.md for v1.6.3. 2017-05-10 10:27:49 -07:00
code-of-conduct.md
CONTRIBUTING.md
labels.yaml Update labels.yaml with sig labels 2017-04-28 14:27:32 -07:00
LICENSE
Makefile adding support for gpus in node e2e 2017-05-13 16:35:54 -07:00
Makefile.generated_files Remove verify_gen_openapi make rule. 2017-04-25 17:41:33 -07:00
OWNERS
OWNERS_ALIASES Merge pull request #42953 from kargakis/rm-myself 2017-04-03 01:50:58 -07:00
README.md Adjust the link to the right troubleshooting doc page 2017-04-13 08:20:39 +00:00
Vagrantfile
WORKSPACE Update repo-infra dependency to support multiple upload paths 2017-05-03 16:05:15 -07:00

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