Commit Graph

1311 Commits (0efd03810cc695bd4bcd622bd4693d66841a3d4e)

Author SHA1 Message Date
k8s-merge-robot 72f6493376 Merge pull request #27349 from resouer/delete
Automatic merge from submit-queue

Generates DELETE pod update operations

fixes #27105

Generates DELETE pod update operations  to make the code and log more intuitive.

1. main refactoring is in `kubelet/config`
2. kubelet will log if it received DELETE, just like other OPs

cc @Random-Liu :)
2016-07-12 01:04:35 -07:00
Harry Zhang 0d5dddcb71 Add DELETE event type
Signed-off-by: Harry Zhang <harryz@hyper.sh>

Combine delete with update
2016-07-12 14:08:01 +08:00
k8s-merge-robot 5067af159e Merge pull request #28715 from euank/kubelet-trim-dead-code
Automatic merge from submit-queue

kubelete: delete a few bits of dead code

Less is more.
2016-07-11 11:40:47 -07:00
k8s-merge-robot 0aa90bd63b Merge pull request #28705 from pmorie/rm-getref
Automatic merge from submit-queue

Remove unnecessary calls to api.GetReference

These calls are unnecessary, can be removed.  `Eventf` and others just call `GetReference` on the object they are passed.

cc @kubernetes/sig-node
2016-07-11 11:07:26 -07:00
k8s-merge-robot 10141ebc21 Merge pull request #28757 from resouer/nit-fix
Automatic merge from submit-queue

Remove no needed todo

ref #19645 #13418

Remove comment about refactoring pod cleanup since we have agree to keep it.

cc @yujuhong
2016-07-11 09:57:16 -07:00
k8s-merge-robot d6e84cc2e9 Merge pull request #28570 from kevinjkj/kevinjkj-patch-3
Automatic merge from submit-queue

Optimizing the processing flow of HandlePodAdditions and canAdmitPod …

Optimizing the processing flow of HandlePodAdditions and canAdmitPod methods. If the following loop body in canAdmitPod method is removed, the detection speed can be improved, and the change is very small.
------
otherPods := []*api.Pod{}
	for _, p := range pods {
		if p != pod {
			otherPods = append(otherPods, p)
		}
	}
------
2016-07-10 23:11:00 -07:00
Harry Zhang 1ad9235993 Remove no needed todo 2016-07-11 13:40:45 +08:00
Kevin Wang 09344c1ffc Optimizing the processing flow of HandlePodAdditions and canAdmitPod methods.
Signed-off-by: Kevin Wang <wang.kanghua@zte.com.cn>

change the note for the canAdmitPod method.

Signed-off-by: Kevin Wang <wang.kanghua@zte.com.cn>

gofmt kubelet.go

Signed-off-by: Kevin Wang <wang.kanghua@zte.com.cn>
2016-07-11 10:34:51 +08:00
k8s-merge-robot a261776f3e Merge pull request #28670 from wojtek-t/scheduler_metadata
Automatic merge from submit-queue

Add meta field to predicate signature to avoid computing the same things multiple times

This PR only uses it to avoid computing QOS of a pod for every node from scratch.

Ref #28590
2016-07-09 22:28:14 -07:00
Euan Kemp 26e0f50504 kubelet: delete unused code 2016-07-08 15:15:43 -07:00
Paul Morie 5ca51e4047 Remove unnecessary calls to api.GetReference 2016-07-08 16:53:33 -04:00
Paul Morie 5c836f3582 Extract kubelet network code into its own file 2016-07-08 15:18:07 -04:00
Wojciech Tyczynski 6890868823 Add meta field to predicates signature 2016-07-08 12:25:48 +02:00
k8s-merge-robot f1a6685b71 Merge pull request #24705 from derekwaynecarr/port_active_deadline
Automatic merge from submit-queue

Move ActiveDeadlineSeconds implementation into a kubelet sync observer

The first commit is from: https://github.com/kubernetes/kubernetes/pull/24344

The second commit moves the code for enforcement around active deadlines into a kubelet sync observer pattern.  It groups code that used to be scattered across the kubelet.

<!-- 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/24705)
<!-- Reviewable:end -->
2016-07-07 12:49:02 -07:00
k8s-merge-robot 4da14c8a64 Merge pull request #28204 from thockin/cleanup-third_party
Automatic merge from submit-queue

Cleanup third party (pt 2)

Move forked-and-hacked golang code to the forked/ directory.  Remove ast/build/parse code that is now in stdlib.  Remove unused shell2junit
2016-07-07 12:13:14 -07:00
derekwaynecarr c162fec94d Move ActiveDeadlineSeconds to use lifecycle observers 2016-07-07 13:43:55 -04:00
saadali 0dd17fff22 Reorganize volume controllers and manager 2016-07-01 18:50:25 -07:00
k8s-merge-robot 536622fd07 Merge pull request #27923 from kevinjkj/kevinjkj-patch-2-1
Automatic merge from submit-queue

fix return value
2016-06-30 21:14:15 -07:00
k8s-merge-robot ab37fbf4c2 Merge pull request #28258 from vishh/28231
Automatic merge from submit-queue

[kubelet] Allow opting out of automatic cloud provider detection in kubelet. By default kubelet will auto-detect cloud providers

fixes #28231
2016-06-30 12:27:26 -07:00
Vishnu Kannan ea789e8612 Allow opting out of automatic cloud provider detection in kubelet
Signed-off-by: Vishnu Kannan <vishnuk@google.com>
Signed-off-by: Vishnu kannan <vishnuk@google.com>
2016-06-29 18:04:29 -07:00
David McMahon ef0c9f0c5b Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
k8s-merge-robot c6fa861688 Merge pull request #28160 from saad-ali/waitForGracefulTerm
Automatic merge from submit-queue

Volume manager must verify containers terminated before deleting for ungracefully terminated pods

A pod is removed from volume manager (triggering unmount) when it is deleted from the kubelet pod manager. Kubelet deletes the pod from pod manager as soon as it receives a delete pod request. As long as the graceful termination period is non-zero, this happens after kubelet has terminated all containers for the pod. However, when graceful termination period for a pod is set to zero, the volume is deleted from pod manager *before* its containers are terminated.

This  can result in volumes getting unmounted from a pod before all containers have exited when graceful termination is set to zero.

This PR prevents that from happening by only deleting a volume from volume manager once it is deleted from the pod manager AND the kubelet containerRuntime status indicates all containers for the pod have exited. Because we do not want to call containerRuntime too frequently, we introduce a delay in the `findAndRemoveDeletedPods()` method to prevent it from executing more frequently than every two seconds.

Fixes https://github.com/kubernetes/kubernetes/issues/27691

Running test in tight loop to verify fix.
2016-06-29 01:33:31 -07:00
Tim Hockin 8c42c08363 move forked golang code to a common dir with LICENSE 2016-06-28 22:57:45 -07:00
Tim Hockin 37bda2dbf2 Move hacked golang os code to forked/ dir 2016-06-28 22:16:59 -07:00
Saad Ali c723d9e5c4 Volume manager verify containers terminated before deleting 2016-06-28 21:38:59 -07:00
saadali e06b32b1ef Mark VolumeInUse before checking if it is Attached
Ensure that kublet marks VolumeInUse before checking if it is Attached.
Also ensures that the attach/detach controller always fetches a fresh
copy of the node object before detach (instead ofKubelet relying on node
informer cache).
2016-06-28 14:05:59 -07:00
k8s-merge-robot a43aa608a1 Merge pull request #27508 from aaronlevy/dapi-hostip
Automatic merge from submit-queue

Kubelet can retrieve host IP even when apiserver has not been contacted

fixes https://github.com/kubernetes/kubernetes/issues/26590, fixes https://github.com/kubernetes/kubernetes/issues/6558

Right now the kubelet expects to get the hostIP from the kubelet's local nodeInfo cache. However, this will be empty if there is no api-server (or the apiServer has not yet been contacted).

In the case of static pods, this change means the downward api can now be used to populate hostIP.
2016-06-25 23:29:05 -07:00
Kanghua Wang b694fc0688 fix return value
// matchesNodeSelector returns true if pod matches node's labels.
Whether this return value should be false?
2016-06-23 16:14:55 +08:00
k8s-merge-robot a8fecd0cc6 Merge pull request #27639 from pmorie/goodbye-pod-mutation
Automatic merge from submit-queue

Remove pod mutation for volumes annotated with supplemental groups

Removes the pod mutation added in #20490 -- partially resolves #27197 from the standpoint of making the feature inactive in 1.3.  Our plan is to make this work correctly in 1.4.

@kubernetes/sig-storage
2016-06-21 03:18:45 -07:00
k8s-merge-robot ee35555cb6 Merge pull request #27570 from Random-Liu/add-runtime-request-timeout-flag
Automatic merge from submit-queue

Add runtime-request-timeout kubelet flag.

XRef #23563.

Addresses https://github.com/kubernetes/kubernetes/issues/27388#issuecomment-226570083.

Add a new kubelet flag `runtime-request-timeout`, and set to 2 minutes by default.
Now the flag only affects dockertools, rkt may also want to set request timeout according to the flag. @yifan-gu 

This PR also removed the timeout for all long running operations to avoid issues like #27588 and #26122.

@yujuhong @rrati 
/cc @kubernetes/sig-node 

[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()
2016-06-21 01:26:54 -07:00
Aaron Levy 8c04af7b73 Retrieve host IP in isolation from apiserver 2016-06-20 11:47:32 -07:00
k8s-merge-robot 8f5d081194 Merge pull request #27209 from ronnielai/disk-check
Automatic merge from submit-queue

Logging for OutOfDisk when file system info is not available

#26566
1. Adding logs for file system info being not available.
2. Reporting outOfDisk when file system info is not available.
2016-06-19 00:02:59 -07:00
k8s-merge-robot 77cf11f4d7 Merge pull request #27441 from derekwaynecarr/downward_api_node_defaults
Automatic merge from submit-queue

Revert revert of downward api node defaults

Reverts the revert of https://github.com/kubernetes/kubernetes/pull/27439

Fixes #27062

@dchen1107 - who at Google can help debug why this caused issues with GKE infrastructure but not GCE merge queue?

/cc @wojtek-t @piosz @fgrzadkowski @eparis @pmorie
2016-06-18 12:12:24 -07:00
Random-Liu 3cc9ca3988 Add timeout for rkt requests. 2016-06-17 18:18:41 -07:00
Daniel Smith 22d3267188 Merge pull request #27387 from yujuhong/sources_ready
kubelet: don't GC containers of deleted pods until all sources are ready
2016-06-17 16:01:31 -07:00
Paul Morie a573a0eda3 Remove pod mutation for volumes annotated with supplemental groups 2016-06-17 15:36:56 -04:00
derekwaynecarr 18a206ad56 Downward API defaults resource limits to node capacity/allocatable 2016-06-17 14:18:18 -04:00
k8s-merge-robot 1444cbf594 Merge pull request #27525 from wojtek-t/network_unavailable_only_in_gce
Automatic merge from submit-queue

Don't set NetworkUnavailable condition in non-GCE/GKE clouds

Ref #27347

@davidopp @erictune @justinsb @simonswine
2016-06-17 09:08:50 -07:00
k8s-merge-robot 983b478ff4 Merge pull request #27042 from lukaszo/logs
Automatic merge from submit-queue

Fix kubectl logs for init containers
2016-06-17 05:01:04 -07:00
Yu-Ju Hong f279e36292 Don't remove all containers of deleted pods until sources are ready
Without this fix, kubelet may assume a pod from a not-ready source has already
been deleted, and GC all its dead containers.
2016-06-16 10:47:12 -07:00
Wojciech Tyczynski f24f6102a9 Don't set NetworkUnavailable condition in non-GCE/GKE clouds 2016-06-16 09:40:49 +02:00
saadali 542f2dc708 Introduce new kubelet volume manager
This commit adds a new volume manager in kubelet that synchronizes
volume mount/unmount (and attach/detach, if attach/detach controller
is not enabled).

This eliminates the race conditions between the pod creation loop
and the orphaned volumes loops. It also removes the unmount/detach
from the `syncPod()` path so volume clean up never blocks the
`syncPod` loop.
2016-06-15 09:34:08 -07:00
saadali 9b6a505f8a Rename UniqueDeviceName to UniqueVolumeName
Rename UniqueDeviceName to UniqueVolumeName and move helper functions
from attacherdetacher to volumehelper package.
Introduce UniquePodName alias
2016-06-15 09:32:12 -07:00
Piotr Szczesniak 51af487b5f Revert "Downward api node defaults" 2016-06-15 15:47:49 +02:00
derekwaynecarr 712860d55f Fix downward API for resource limits 2016-06-14 12:49:00 -04:00
Vishnu kannan afdd9ea262 When limits are not set, use capacity as limits in downward API for resources.
Signed-off-by: Vishnu kannan <vishnuk@google.com>
2016-06-14 11:29:39 -04:00
Ron Lai 8d6cdd5d1b Adding logs for file system info being not available. 2016-06-13 11:10:38 -07:00
Łukasz Oleś 07d13c1fb4 Fix kubectl logs for init containers
Related issues: #25818 #27040
2016-06-13 15:12:40 +02:00
k8s-merge-robot d935a02c64 Merge pull request #27101 from caesarxuchao/add-deletiontimestamp-log
Automatic merge from submit-queue

Let kubelet log the DeletionTimestamp if it's not nil in update

This helps to debug if it's the kubelet to blame when a pod is not deleted. 

Example output:
```
SyncLoop (UPDATE, "api"): "redis-master_default(c6782276-2dd4-11e6-b874-64510650ab1c):DeletionTimestamp=2016-06-08T23:58:12Z"
```

ref #26290
cc @Random-Liu
2016-06-12 22:56:43 -07:00
k8s-merge-robot e54ebe5ebd Merge pull request #27132 from freehan/kubenetmasq
Automatic merge from submit-queue

turn off cni masqurade and manage it in kubenet

fixes #27110
2016-06-09 20:44:13 -07:00