Commit Graph

1191 Commits (660050631eb9e16650dcd1795014c0577eb49bb9)

Author SHA1 Message Date
Robert Bailey b274c5b7de Merge pull request #24843 from derekwaynecarr/graceperiod_override
Allow KillPod to take a gracePeriodOverride
2016-05-06 15:17:56 -07:00
Robert Bailey 2493a9de62 Merge pull request #24959 from Random-Liu/fix-flaky-unit-test
Use fake clock in TestGetPodsToSync.
2016-05-06 14:14:02 -07:00
Robert Bailey 2c678f1ec1 Merge pull request #25053 from yujuhong/rm_cahce_update
kubelet: do not force update the runtime cache
2016-05-06 14:11:38 -07:00
Robert Bailey 303f059efa Merge pull request #24817 from pmorie/clarify-orphaned-cleanup
Clarify orphaned volume cleanup
2016-05-06 13:52:33 -07:00
Robert Bailey 1474145db1 Merge pull request #24823 from derekwaynecarr/fix-kubelet-typo
Fix function name typo in kubelet
2016-05-06 13:28:45 -07:00
derekwaynecarr 7bab6999d4 Allow KillPod to take a gracePeriodOverride 2016-05-06 12:14:43 -04:00
k8s-merge-robot 16159b8bd0 Merge pull request #24344 from derekwaynecarr/kubelet-lifecycle-callouts
Automatic merge from submit-queue

Define interfaces for kubelet pod admission and eviction

There is too much code and logic in `kubelet.go` that makes it hard to test functions in discrete pieces.

I propose an interface that an internal module can implement that will let it make an admission decision for a pod.  If folks are ok with the pattern, I want to move the a) predicate checking, b) out of disk, c) eviction preventing best-effort pods being admitted into their own dedicated handlers that would be easier for us to mock test.  We can then just write tests to ensure that the `Kubelet` calls a call-out, and we can write easier unit tests to ensure that dedicated handlers do the right thing.

The second interface I propose was a `PodEvictor` that is invoked in the main kubelet sync loop to know if pods should be pro-actively evicted from the machine.  The current active deadline check should move into a simple evictor implementation, and I want to plug the out of resource killer code path as an implementation of the same interface.

 @vishh @timothysc - if you guys can ack on this, I will add some unit testing to ensure we do the call-outs.

/cc @kubernetes/sig-node @kubernetes/rh-cluster-infra
2016-05-06 08:53:35 -07:00
k8s-merge-robot 66ef87347e Merge pull request #24968 from wojtek-t/remove_node_name
Automatic merge from submit-queue

Remove nodeName from predicate signature.

With this approach, I'm getting the initial throughput (in empty cluster) in 1000-node cluster of ~95pods/s.
Which is ~30% improvement.

@kubernetes/sig-scalability
2016-05-06 04:09:13 -07:00
k8s-merge-robot 346ddc52c2 Merge pull request #24748 from Random-Liu/cleanup-with-new-engine-api
Automatic merge from submit-queue

Kubelet: Cleanup with new engine api

Finish step 2 of #23563

This PR:
1) Cleanup go-dockerclient reference in the code.
2) Bump up the engine-api version.
3) Cleanup the code with new engine-api.

Fixes #24076.
Fixes #23809.

/cc @yujuhong
2016-05-06 03:16:53 -07:00
Wojciech Tyczynski a51f266ebf Remove nodeName from predicate signature. 2016-05-06 11:23:37 +02:00
k8s-merge-robot 03e7e08e70 Merge pull request #25124 from pmorie/kubelet-getters
Automatic merge from submit-queue

Reduce kubelet LOC: extract getters

Step 1 of #25028 as discussed in @kubernetes/sig-node meeting
2016-05-05 16:52:09 -07:00
Minhan Xia 04b80f7fb8 rename Status interface to GetPodNetworkStatus 2016-05-04 13:46:31 -07:00
Minhan Xia 265fdd9344 add NetworkStatus in NetworkPlugin interface for kubelet to consume 2016-05-04 13:46:31 -07:00
Paul Morie 7521503ab9 Reduce kubelet LOC: extract getters 2016-05-04 02:25:22 -04:00
Random-Liu 4cca5b2290 Use fake clock in TestGetPodsToSync to fix flake. 2016-05-02 16:05:36 -07:00
Yu-Ju Hong 43fc67a5f6 kubelet: do not force update the runtime cache
Pod workers don't rely on the old runtime cache to sync pods anymore. There is
no need to force update the cache on every container event.
2016-05-02 15:10:00 -07:00
Clayton Coleman fdb110c859
Fix the rest of the code 2016-04-29 17:12:10 -04:00
Random-Liu 3876972d3f Clean up go-dockerclient reference. 2016-04-29 13:32:19 -07:00
derekwaynecarr 033ae3e37e Define interfaces for kubelet observing admission, sync loop, sync pod 2016-04-29 10:16:03 -04:00
k8s-merge-robot ad67363c12 Merge pull request #24362 from ArtfulCoder/hostname-field
Automatic merge from submit-queue

Promote Pod Hostname & Subdomain to fields (were annotations)

Deprecating the podHostName, subdomain and PodHostnames annotations and created corresponding new fields for them on PodSpec and Endpoints types.

Annotation doc: #22564
Annotation code: #20688
2016-04-29 01:06:45 -07:00
k8s-merge-robot 492762d394 Merge pull request #24911 from pmorie/kubelet-godoc
Automatic merge from submit-queue

Add godoc for some kubelet funcs

Chipping away at that old boulder

@kubernetes/sig-node
2016-04-28 14:52:45 -07:00
Paul Morie b9f0e8c610 Add godoc for some kubelet funcs 2016-04-28 17:03:37 -04:00
Abhishek Shah 8a3ed48808 Added Hostname and Subdomain field to Pod.Spec 2016-04-28 10:56:56 -07:00
k8s-merge-robot 00308f7a9f Merge pull request #24598 from wojtek-t/improve_scheduler_predicates
Automatic merge from submit-queue

Store node information in NodeInfo

This is significantly improving scheduler throughput.

On 1000-node cluster:
- empty cluster: ~70pods/s
- full cluster: ~45pods/s
Drop in throughput is mostly related to priority functions, which I will be looking into next (I already have some PR #24095, but we need for more things before).

This is roughly ~40% increase.
However, we still need better understanding of predicate function, because in my opinion it should be even faster as it is now. I'm going to look into it next week.

@gmarek @hongchaodeng @xiang90
2016-04-28 02:17:59 -07:00
Paul Morie 11113a00d7 Clarify log messages for orphaned volume cleanup 2016-04-27 13:20:43 -04:00
k8s-merge-robot 7e430f543b Merge pull request #24545 from swagiaal/rename-cleaner-tuple
Automatic merge from submit-queue

Rename cleanerTuple to cleaner

Rename cleanerTuple to cleaner.
This is a follow up to address: https://github.com/kubernetes/kubernetes/pull/19503#discussion_r49538769

@saad-ali
2016-04-27 09:51:26 -07:00
derekwaynecarr ec5670fd73 Fix function name typo in kubelet 2016-04-26 17:29:44 -04:00
k8s-merge-robot a586177360 Merge pull request #23740 from dcbw/kubenet-shaper
Automatic merge from submit-queue

kubenet: hook pod bandwidth resources up to shaper

@bprashanth @thockin Last bit for shaping.
2016-04-25 22:15:42 -07:00
Vishnu kannan e566948a75 Track image storage usage for docker containers
add image fs info to summary stats API.
Adding node e2e test for image stats.

Signed-off-by: Vishnu kannan <vishnuk@google.com>
2016-04-25 16:00:34 -07:00
Wojciech Tyczynski 1835c8528d Store node information in NodeInfo 2016-04-25 10:08:05 +02:00
Euan Kemp a6718f5969 rkt: Implement pod `FinishedAt`
This is implemented via touching a file on stop as a hook in the systemd
unit. The ctime of this file is then used to get the `finishedAt` time
in the future.
In addition, this changes the `startedAt` and `createdAt` to use the api
server's results rather than the annotations it previously used.

It's possible we might want to move this into the api in the future.

Fixes #23887
2016-04-22 15:34:55 -07:00
Sami Wagiaalla 234d599763 Rename cleanerTuple to cleaner 2016-04-20 14:38:40 -04:00
Dan Williams 8086d64131 kubenet: hook pod bandwidth resources up to shaper 2016-04-19 15:32:46 -05:00
k8s-merge-robot bf69b2a862 Merge pull request #24302 from therc/patch-1
Automatic merge from submit-queue

Remove dead code in kubelet.go
2016-04-16 00:00:29 -07:00
k8s-merge-robot ea932c0956 Merge pull request #21224 from Random-Liu/add-unit-test-for-convert-function
Automatic merge from submit-queue

Kubelet: Better-defined Container Waiting state

For issue #20478 and #21125.

This PR corrected logic and add unit test for `ShouldContainerBeRestarted()`, cleaned up `Waiting` state related code and added unit test for `generateAPIPodStatus()`.

Fixes #20478
Fixes #17971

@yujuhong
2016-04-14 23:05:55 -07:00
Rudi C 43d2b572ef Remove dead code in kubelet.go
The only call to this was removed in #20204 by @HaiyangDING

cc @vishh
2016-04-14 20:17:22 -04:00
k8s-merge-robot 9c0a0833b3 Merge pull request #23532 from yifan-gu/lifecycle
Automatic merge from submit-queue

rkt: Add pre-stop lifecycle hooks for rkt.

When a pod is being terminated, the pre-stop hooks of all the containers
will be run before the containers are stopped.


cc @yujuhong @Random-Liu @sjpotter
2016-04-14 06:34:10 -07:00
Lantao Liu b49357be22 Cleanup the waiting state related code 2016-04-12 16:37:26 -07:00
Yifan Gu cc4336829d rkt: Add pre-stop lifecycle hooks for rkt.
When a pod is being terminated, the pre-stop hooks of all the containers
will be run before the containers are stopped.
2016-04-12 13:10:51 -07:00
k8s-merge-robot e93c0d727f Merge pull request #20204 from HaiyangDING/predlib
Automatic merge from submit-queue

Move predicates into library

This PR tries to implement #12744 

Any suggestions/ideas are welcome. @davidopp 

current state: integration test fails if including podCount check in Kubelet.
    
DONE:
    1. refactor all predicates: predicates return fitOrNot(bool) and error(Error) in which the latter is of type PredicateFailureError or InsufficientResourceError
    2. GeneralPredicates() is a predicate function, which includes serveral other predicate functions (PodFitsResource, PodFitsHost, PodFitsHostPort). It is registered as one of the predicates in DefaultAlgorithmProvider, and is also called in canAdmitPod() in Kubelet and should be called by other components (like rescheduler, etc if necessary. See discussion in issue #12744
TODO:
    1. determine which predicates should be included in GeneralPredicates()
    2. separate GeneralPredicates() into: a.) GeneralPredicatesEvictPod() and b.) GeneralPredicatesNotEvictPod()
    3. DaemonSet should use GeneralPredicates()
2016-04-12 07:44:45 -07:00
HaiyangDING 41ed85479a move predicates into library (address #12744)
DONE:
1. refactor all predicates: predicates return fitOrNot(bool) and error(Error) in which the latter is of type
	PredicateFailureError or InsufficientResourceError. (For violation of either MaxEBSVolumeCount or
        MaxGCEPDVolumeCount, returns one same error type as ErrMaxVolumeCountExceeded)
2. GeneralPredicates() is a predicate function, which includes serveral other predicate functions (PodFitsResource,
        PodFitsHost, PodFitsHostPort). It is registered as one of the predicates in DefaultAlgorithmProvider, and
        is also called in canAdmitPod() in Kubelet and should be called by other components (like rescheduler, etc)
        if necessary. See discussion in issue #12744
3. remove podNumber check from GeneralPredicates
4. HostName is now verified in Kubelet's canAdminPod(). add TestHostNameConflicts in kubelet_test.go
5. add getNodeAnyWay() method in Kubelet to get node information in standaloneMode

TODO:
1. determine which predicates should be included in GeneralPredicates()
2. separate GeneralPredicates() into:
	a. GeneralPredicatesEvictPod() and
	b. GeneralPredicatesNotEvictPod()
3. DaemonSet should use GeneralPredicates()
2016-04-11 00:57:03 +08:00
harry 5fe773d37c Add flow control pkg
Refactor pkg names in flow control related files
2016-04-03 11:28:03 +08:00
k8s-merge-robot b43ccd6e2b Merge pull request #23506 from Random-Liu/new-docker-client
Automatic merge from submit-queue

Kubelet: Start using the official docker engine-api

For #23563.

This is the **first step** in the roadmap of switching to docker [engine-api](https://github.com/docker/engine-api).
In this PR, I keep the old `DockerInterface` and implement it with the new engine-api.
With this approach, we could switch to engine-api with minimum change, so that we could:
* Test the engine-api without huge refactoring.
* Send following PRs to refactor functions in `DockerInterface` separately so as to avoid a huge change in one PR.

I've tested this PR locally, it passed all the node conformance test:
```
make test_e2e_node

Ran 19 of 19 Specs in 823.395 seconds
SUCCESS! -- 19 Passed | 0 Failed | 0 Pending | 0 Skipped PASS

Ginkgo ran 1 suite in 13m49.429979585s
Test Suite Passed
```
And it also passed the jenkins gce e2e test:
```
go run hack/e2e.go -test -v --test_args="--ginkgo.skip=\[Slow\]|\[Serial\]|\[Disruptive\]|\[Flaky\]|\[Feature:.+\]"

Ran 161 of 268 Specs in 4570.214 seconds
SUCCESS! -- 161 Passed | 0 Failed | 0 Pending | 107 Skipped PASS

Ginkgo ran 1 suite in 1h16m16.325934558s
Test Suite Passed
2016/03/25 15:12:42 e2e.go:196: Step 'Ginkgo tests' finished in 1h16m18.918754301s
```

I'm writing the design document, and will post the switching roadmap in an umbrella issue soon.

@kubernetes/sig-node
2016-04-02 04:51:33 -07:00
derekwaynecarr eeeccd0a67 A pod never terminated if a container image registry was unavailable 2016-04-01 13:42:23 -04:00
Dan Williams fb97b8cdaa Implement network plugin capabilities hook and shaping capability
Allow network plugins to declare that they handle shaping and that
Kuberenetes should not.  Will be first used by openshift-sdn which
handles shaping through OVS, but this triggers a warning when
kubelet notices the bandwidth annotations.
2016-03-30 11:51:21 -05:00
Yifan Gu d4dc037bf7 rkt: Add '--hostname' support for rkt.
Add GeneratePodHostNameAndDomain() to RuntimeHelper to
get the hostname of the pod from kubelet.

Also update the logging flag to change the journal match from
_HOSTNAME to _MACHINE_ID.
2016-03-28 17:06:14 -07:00
Yifan Gu d814d973ff rkt: Bump rkt required version. Get options from api service. 2016-03-28 17:06:14 -07:00
Random-Liu d2524bf291 Start using docker engine-api 2016-03-28 15:39:11 -07:00
k8s-merge-robot 2205a30348 Merge pull request #23368 from saad-ali/renameBuilderCleaner
Auto commit by PR queue bot
2016-03-26 13:01:25 -07:00
goltermann 32d569d6c7 Fixing all the "composite literal uses unkeyed fields" Vet errors. 2016-03-25 15:25:09 -07:00