Commit Graph

595 Commits (f538d6019dbe20a161e5475f910f4b64ff8cd569)

Author SHA1 Message Date
k8s-merge-robot 7b4851b9ae Merge pull request #21274 from derekwaynecarr/kubelet_eviction
Automatic merge from submit-queue

out of resource killing (memory)

Adds the core framework for low-resource killing in the kubelet.

Implements support for out of memory killing.

Related:
https://github.com/kubernetes/kubernetes/pull/18724

<!-- Reviewable:start -->
---
This change is [<img src="http://reviewable.k8s.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](http://reviewable.k8s.io/reviews/kubernetes/kubernetes/21274)
<!-- Reviewable:end -->
2016-05-17 10:15:32 -07:00
k8s-merge-robot 59b7b1c550 Merge pull request #24921 from feiskyer/merge-exec
Automatic merge from submit-queue

Remove RunInContainer interface in Kubelet Runtime interface

According to #24689, we should merge RunInContainer and ExecInContainer in the container runtime interface. 

@yujuhong  @kubernetes/sig-node
2016-05-15 02:58:15 -07:00
derekwaynecarr edc76f6d4f out of resource killing (memory) 2016-05-14 11:34:45 -04:00
Yifan Gu 9d5bcf4251 rkt: Add tests for GarbageCollect(). 2016-05-13 15:13:52 -07:00
k8s-merge-robot 399b086620 Merge pull request #23684 from luxas/auto_label_arch
Automatic merge from submit-queue

Automatically add node labels beta.kubernetes.io/{os,arch}

Proposal: #17981
As discussed in #22623:
> @davidopp: #9044 says cloud provider but can also cover platform stuff.

Adds a label `beta.kubernetes.io/platform` to `kubelet` that informs about the os/arch it's running on.
Makes it easy to specify `nodeSelectors` for different arches in multi-arch clusters.

```console
$ kubectl get no --show-labels
NAME        STATUS    AGE       LABELS
127.0.0.1   Ready     1m        beta.kubernetes.io/platform=linux-amd64,kubernetes.io/hostname=127.0.0.1
$ kubectl describe no
Name:			127.0.0.1
Labels:			beta.kubernetes.io/platform=linux-amd64,kubernetes.io/hostname=127.0.0.1
CreationTimestamp:	Thu, 31 Mar 2016 20:39:15 +0300
```
@davidopp @vishh @fgrzadkowski @thockin @wojtek-t @ixdy @bgrant0607 @dchen1107 @preillyme
2016-05-13 13:25:34 -07:00
derekwaynecarr 6fefb428c1 Add killPodNow to kubelet 2016-05-12 19:17:08 -04:00
Saad Ali 25f37007aa Merge pull request #24846 from pmorie/kubelet-test-loc
Reduce LOC in kubelet tests
2016-05-12 15:52:27 -07:00
Saad Ali 870a1634b1 Merge pull request #24722 from derekwaynecarr/kubelet_testing
Code cleanups in kubelet_test.go
2016-05-12 15:51:00 -07:00
k8s-merge-robot 08440b5dcc Merge pull request #24836 from Clarifai/gpu-impl
Automatic merge from submit-queue

WIP v0 NVIDIA GPU support

```release-note
* Alpha support for scheduling pods on machines with NVIDIA GPUs whose kubelets use the `--experimental-nvidia-gpus` flag, using the alpha.kubernetes.io/nvidia-gpu resource 
```

Implements part of #24071 for  #23587

I am not familiar with the scheduler enough to know what to do with the scores. Mostly punting for now.

Missing items from the implementation plan: limitranger, rkt support, kubectl
support and docs

cc @erictune @davidopp @dchen1107 @vishh @Hui-Zhi @gopinatht
2016-05-12 14:04:15 -07:00
k8s-merge-robot fd3ef234de Merge pull request #23711 from dcbw/kubenet-promiscuous
Automatic merge from submit-queue

kubenet: set bridge promiscuous mode based on hairpinMode

Closes: https://github.com/kubernetes/kubernetes/issues/23657
Closes: https://github.com/kubernetes/kubernetes/issues/20475

<!-- Reviewable:start -->
---
This change is [<img src="http://reviewable.k8s.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](http://reviewable.k8s.io/reviews/kubernetes/kubernetes/23711)
<!-- Reviewable:end -->
2016-05-12 10:33:18 -07:00
Dan Williams b749902b42 kubenet: set bridge promiscuous mode based on hairpinMode
Closes: https://github.com/kubernetes/kubernetes/issues/23657
Closes: https://github.com/kubernetes/kubernetes/issues/20475
2016-05-12 10:02:33 -05:00
Saad Ali 4b564c95d7 Merge pull request #25325 from swagiaal/attacher-interface-update
Update Attacher/Detacher interfaces.
2016-05-11 11:36:19 -07:00
Lucas Käldström c28524fbab Add operatingsystem/architecture as node labels. Also, display that in status 2016-05-10 20:38:57 +03:00
k8s-merge-robot def7639457 Merge pull request #25245 from pmorie/kubelet/cadvisor
Automatic merge from submit-queue

Reduce kubelet LOC: extract cadvisor

Step 2 of #25028 

@yujuhong @kubernetes/sig-node
2016-05-09 21:09:42 -07:00
Rudi Chiarito 362c763fca WIP v0 NVIDIA GPU support
Implements part of #24071

I am not familiar with the scheduler enough to know what to do with the scores. Punting for now.

Missing items from the implementation plan: limitranger, rkt support, kubectl
support and user docs
2016-05-09 19:20:05 -04:00
Sami Wagiaalla 5258392e6a Update Attacher/Detacher interfaces.
- Expand arguments for Attach/Detach interfaces
- Run waitForDetach asynchronously
2016-05-09 17:18:08 -04:00
derekwaynecarr a7dfdeb63e Few cleanups in kubelet_test.go 2016-05-09 16:25:50 -04:00
k8s-merge-robot 545d56a63b Merge pull request #24810 from derekwaynecarr/sources_cleanup
Automatic merge from submit-queue

Clean-up sources ready tracking in kubelet

moved sources ready tracking behind an interface, made it thread-safe.
2016-05-09 05:48:09 -07:00
k8s-merge-robot d4b1b6776a Merge pull request #24557 from swagiaal/attacher-interface
Automatic merge from submit-queue

 Abstract node side functionality of attachable plugins

- Create PhysicalAttacher interface to abstract MountDevice and
  WaitForAttach.
- Create PhysicalDetacher interface to abstract WaitForDetach and
  UnmountDevice.
- Expand unit tests to check that Attach, Detach, WaitForAttach,
  WaitForDetach, MountDevice, and UnmountDevice get call where
  appropriet.

Physical{Attacher,Detacher} are working titles suggestions welcome. Some other thoughts:
- NodeSideAttacher or NodeAttacher.
- AttachWatcher
- Call this Attacher and call the Current Attacher CloudAttacher.
- DeviceMounter (although there are way too many things called Mounter right now :/)

This is to address: https://github.com/kubernetes/kubernetes/pull/21709#issuecomment-192035382

@saad-ali
2016-05-08 14:04:44 -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
derekwaynecarr 582e662581 Clean-up sources ready tracking 2016-05-06 12:11:29 -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
Paul Morie bc5d7a1bca Reduce kubelet LOC: extract cadvisor 2016-05-06 00:26:48 -04: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 265fdd9344 add NetworkStatus in NetworkPlugin interface for kubelet to consume 2016-05-04 13:46:31 -07:00
Sami Wagiaalla 71e7dba845 Abstract node side functionality of attachable plugins
- Expand Attacher/Detacher interfaces to break up work more
  explicitly.
- Add arguments to all functions to avoid having implementers store
  the data needed for operations.
- Expand unit tests to check that Attach, Detach, WaitForAttach,
  WaitForDetach, MountDevice, and UnmountDevice get call where
  appropriet.
2016-05-04 10:18:39 -04:00
Paul Morie 7521503ab9 Reduce kubelet LOC: extract getters 2016-05-04 02:25:22 -04:00
Paul Morie d1e0e726f2 Reduce LOC in kubelet tests 2016-05-03 22:45:08 -04:00
Random-Liu 4cca5b2290 Use fake clock in TestGetPodsToSync to fix flake. 2016-05-02 16:05:36 -07:00
feisky 831203c19b Remove RunInContainer interface in Kuberlete Runtime interface 2016-05-01 20:21:15 +08:00
derekwaynecarr 033ae3e37e Define interfaces for kubelet observing admission, sync loop, sync pod 2016-04-29 10:16:03 -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
gmarek e0712f7e57 Fix MaxPods feature in scheduler 2016-04-22 22:49:50 +02:00
Chao Xu 8537095415 use fully qualified resource in fake clients actions 2016-04-20 19:44:40 -07:00
Dan Williams 8086d64131 kubenet: hook pod bandwidth resources up to shaper 2016-04-19 15:32:46 -05:00
Lantao Liu 41953bae49 Add unit test for generateAPIPodStatus 2016-04-12 16:37:26 -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 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
saadali 79012f6d53 Rename volume.Builder to Mounter and volume.Cleaner to Unmounter 2016-03-25 11:29:58 -07:00
goltermann 34d4eaea08 Fixing several (but not all) go vet errors. Most are around string formatting, or unreachable code. 2016-03-22 17:26:50 -07:00
harry b0900bf0d4 Refactor diff into sub pkg 2016-03-21 20:21:39 +08:00
Paul Morie 5194c12d9e Fix flake in pod IP as env var e2e 2016-03-10 16:32:03 -05:00
k8s-merge-robot fa0bf812d6 Merge pull request #22467 from Random-Liu/push-down-runtime-version-check
Auto commit by PR queue bot
2016-03-05 22:34:19 -08:00
Random-Liu 07b21c50fa Add Status in runtime interface and use it for runtime health check. 2016-03-04 21:26:41 -08:00
Abhishek Shah a3c00aadd5 Specify hostname, subdomain via annotation on podspec.
The hostname is a DNS A record, if the subdomain maps to a service name
in the same namespace
2016-03-04 13:28:33 -08:00
Yu-Ju Hong 4846c1e1b2 pleg: add an internal clock for testability
Also add tests for the health check.
2016-03-01 17:53:03 -08:00
Saad Ali f9b1a33b12 Merge pull request #21953 from timstclair/testing
Move kubelet test-only files to test-only packages
2016-03-01 15:48:10 -08:00