Commit Graph

1158 Commits (2599607a6412bde1d70d65ed1ec60fc80d1c6a8a)

Author SHA1 Message Date
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
saadali 79012f6d53 Rename volume.Builder to Mounter and volume.Cleaner to Unmounter 2016-03-25 11:29:58 -07:00
k8s-merge-robot 8f71655bcc Merge pull request #23325 from MurgaNikolay/master
Auto commit by PR queue bot
2016-03-22 11:47:38 -07:00
Nikolay Murga 70b918a2c0 Fix hairpin mode 2016-03-22 13:00:18 +02:00
Yu-Ju Hong deafa44d61 kubelet: send all recevied pods in one update
The kubelet sync loop relies on getting one update as the signal that the
specific source is ready. This change ensures that we don't send multiple
updates (ADD, UPDATE) for the first batch of pods. This is required to prevent
the cleanup routine from killing pods prematurely.
2016-03-17 14:24:35 -07:00
Brian Grant c6b4518aed Merge pull request #22666 from pmorie/pod-ip-flake-redux
Fix flake in pod IP as env var e2e
2016-03-11 09:42:40 -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 55530bc8f7 Merge pull request #22664 from bprashanth/cleanup-hairpin
Auto commit by PR queue bot
2016-03-08 05:36:18 -08:00
Prashanth Balasubramanian 544d0a5c05 Cleanup hairpin flag in the kubelet. 2016-03-07 11:55:09 -08:00
Xiaogang Xin e2eccddc6f kubernetes/kubernetes#22625 Fix issue of out-of-date `Terminating` mirror pod status
- During `kubelet` `syncPod`, check mirror pod `DeletionTimestamp` value to determine whether re-create mirror pod for running static pod.
2016-03-07 13:42:41 +08: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
k8s-merge-robot 357a9d1fdf Merge pull request #22033 from yifan-gu/rkt_get_status
Auto commit by PR queue bot
2016-03-05 10:46:47 -08:00
k8s-merge-robot 663f7b8a4c Merge pull request #22487 from vishh/node-status-cpu-hardcap
Auto commit by PR queue bot
2016-03-05 02:32:33 -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
Vishnu kannan c54ba12faa Update node status to include the absense of cpu hardcapping.
Signed-off-by: Vishnu kannan <vishnuk@google.com>
2016-03-04 10:33:56 -08:00
k8s-merge-robot c8038a7751 Merge pull request #22311 from vishh/22198
Auto commit by PR queue bot
2016-03-03 20:55:20 -08:00
k8s-merge-robot eb15cd9f7e Merge pull request #21851 from timstclair/gc
Auto commit by PR queue bot
2016-03-03 11:39:12 -08:00
k8s-merge-robot 3f16f5f2b8 Merge pull request #22233 from yujuhong/pleg_health
Auto commit by PR queue bot
2016-03-03 11:01:26 -08:00
Vishnu kannan f9129b02a5 Start for real background tasks in container manager.
Signed-off-by: Vishnu kannan <vishnuk@google.com>
2016-03-02 14:55:26 -08:00
Tim St. Clair 3ad59de829 Garbage collect containers for deleted pods 2016-03-02 14:35:17 -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
Yu-Ju Hong 94368df91a kubelet: monitor the health of pleg
PLEG is reponsible for listing the pods running on the node. If it's hung
due to non-responsive container runtime or internal bugs, we should restart
kubelet.
2016-03-01 17:24:27 -08:00
Dawn Chen a90ac42dd8 Kill docker daemon after configing cbr0 if flag --babysit-daemon is true so that babysitter process can restart it again with proper configurations and checkpoint file. 2016-03-01 16:46:31 -08:00
Saad Ali 4183ac174b Merge pull request #21408 from krousey/unversioned_breakup
Move restclient to it's own package
2016-02-29 14:03:09 -08:00
Kris e664ef922f Move restclient to its own package 2016-02-29 12:05:13 -08:00
Yu-Ju Hong 866c52c8a9 kubelet: fix duplicated status updates at pod cleanup
cleanupTerminatedPods is responsible for checking whether a pod has been
terminated and force a status update to trigger the pod deletion. However, this
function is called in the periodic clenup routine, which runs every 2 seconds.
In other words, it forces a status update for each non-running (and not yet
deleted in the apiserver) pod. When batch deleting tens of pods, the rate of
new updates surpasses what the status manager can handle, causing numerous
redundant requests (and the status channel to be full).

This change forces a status update only when detecting the DeletionTimestamp is
set for a terminated pod. Note that for other non-terminated pods, the pod
workers should be responsible for setting the correct status after killling all
the containers.
2016-02-28 13:20:40 -08:00
Yifan Gu 168ec8b80f kubelet: Sort the container statuses in convertStatusToAPIStatus(). 2016-02-26 11:27:03 -08:00
Sami Wagiaalla 8c21967dd8 Only call Detacher after the final unmount 2016-02-25 14:11:07 -05:00
k8s-merge-robot dcbeacded0 Merge pull request #21521 from mesosphere/jdef_kubelet_options1
Auto commit by PR queue bot
2016-02-24 18:35:10 -08:00
Marek Grabowski 4f12103354 Revert "kubelet: fix duplicated status updates at pod cleanup" 2016-02-24 17:57:57 +01:00
Yu-Ju Hong a68f534264 kubelet: fix duplicated status updates at pod cleanup
cleanupTerminatedPods is responsible for checking whether a pod has been
terminated and force a status update to trigger the pod deletion. However, this
function is called in the periodic clenup routine, which runs every 2 seconds.
In other words, it forces a status update for each non-running (and not yet
deleted in the apiserver) pod. When batch deleting tens of pods, the rate of
new updates surpasses what the status manager can handle, causing numerous
redundant requests (and the status channel to be full).

This change forces a status update only when detecting the DeletionTimestamp is
set for a terminated pod. Note that for other non-terminated pods, the pod
workers should be responsible for setting the correct status after killling all
the containers.
2016-02-23 01:03:04 -08:00
Prashanth Balasubramanian c97e8df65b Stricter checking of HAIRPIN_FLAG in salt. 2016-02-21 14:43:43 -08:00
Prashanth Balasubramanian 2e8ff81de1 Teach the kubelet about --hairpin-mode=promiscuous-bridge. 2016-02-20 22:40:54 -08:00