Commit Graph

1636 Commits (7ffa2faeacb213d25c86ab91a2ce5b67f30b9c33)

Author SHA1 Message Date
Kubernetes Submit Queue 61242f7408 Merge pull request #35939 from xiangpengzhao/minor-cleanup
Automatic merge from submit-queue

Minor cleanup: fix typos

Fix some typos.
2016-12-08 07:41:08 -08:00
Euan Kemp 15fc470343 kubelet: remove redundant hostNetwork helper
It did the same thing as the helper in kubecontainer
2016-12-07 17:24:24 -08:00
Derek Carr 5b2d1c2c25 Enable kernel memcg notification via additional flag 2016-12-07 10:09:41 -05:00
Kubernetes Submit Queue be5d1724f5 Merge pull request #37420 from zdj6373/kubelet-log
Automatic merge from submit-queue (batch tested with PRs 37208, 37446, 37420)

Kubelet log modification

Keep in line with the other error logs in the function.
After return, the caller records the error log.Delete redundant logs
2016-12-05 04:47:44 -08:00
Kubernetes Submit Queue 4ebc43c25d Merge pull request #37541 from zdj6373/note-error
Automatic merge from submit-queue

Function annotation modification

“return kl.pleg.Healthy()”,Based on the return function,"healty" to "healthy" better
2016-12-02 01:01:00 -08:00
Kubernetes Submit Queue c4b33f3be3 Merge pull request #37661 from yujuhong/always_add_pods
Automatic merge from submit-queue

kubelet: don't reject pods without adding them to the pod manager

kubelet relies on the pod manager as a cache of the pods in the apiserver (and
other sources) . The cache should be kept up-to-date even when rejecting pods.
Without this, kubelet may decide at any point to drop the status update
(request to the apiserver) for the rejected pod since it would think the pod no
longer exists in the apiserver.

This should fix #37658
2016-11-30 21:59:12 -08:00
Kubernetes Submit Queue 2ed490e15b Merge pull request #37255 from jingxu97/Nov/nfshung
Automatic merge from submit-queue

remove checking mount point in cleanupOrphanedPodDirs

To avoid nfs hung problem, remove the mountpoint checking code in
cleanupOrphanedPodDirs(). This removal should still be safe because it checks whether there are still directories under pod's volume and if so, do not delete the pod directory.

Note: After removing the mountpoint check code in cleanupOrphanedPodDirs(), the directories might not be cleaned up in such situation.
1. delete pod, kubelet reconciler tries to unmount the volume directory successfully
2. before reconciler tries to delete the volume directory, kubelet gets retarted
3. since under pod directory, there are still volume directors exist (but not mounted), cleanupOrphanedPodDIrs() will not clean them up.

Will work on a follow up PR to solve above issue.
2016-11-30 21:11:13 -08:00
Yu-Ju Hong 69caf533f0 kubelet: don't reject pods without adding them to the pod manager
kubelet relies on the pod manager as a cache of the pods in the apiserver (and
other sources) . The cache should be kept up-to-date even when rejecting pods.
Without this, kubelet may decide at any point to drop the status update
(request to the apiserver) for the rejected pod since it would think the pod no
longer exists in the apiserver.

Also check if the pod to-be-admitted has terminated or not. In the case where
it has terminated, skip the admission process completely.
2016-11-30 18:05:17 -08:00
Jing Xu 041fa6477b remove checking mount point in cleanupOrphanedPodDirs
To avoid nfs hung problem, remove the mountpoint checking code in
cleanupOrphanedPodDirs(). This removal should still be safe.
2016-11-30 13:46:39 -08:00
Pengfei Ni f584ed4398 Fix package aliases to follow golang convention 2016-11-30 15:40:50 +08:00
zdj6373 d43dc73610 Function annotation modification 2016-11-28 15:34:13 +08:00
zdj6373 c36ca0341c Kubelet log modification 2016-11-24 09:59:10 +08:00
Chao Xu 5e1adf91df cmd/kubelet 2016-11-23 15:53:09 -08:00
Vishnu kannan 9066253491 [kubelet] rename --cgroups-per-qos to --experimental-cgroups-per-qos to reflect the true nature of that feature
Signed-off-by: Vishnu kannan <vishnuk@google.com>
2016-11-14 14:06:39 -08:00
pweil- d0d78f478c experimental host user ns defaulting 2016-11-14 10:16:03 -05:00
Kubernetes Submit Queue 44f672e5e2 Merge pull request #34877 from resouer/e2e-log-path
Automatic merge from submit-queue

Add e2e node test for log path

fixes #34661

A node e2e test to check if container logs files are properly created with right content.

Since the log files under `/var/log/containers` are actually symbolic of docker containers log files, we can not use a pod to mount them in and do check (symbolic doesn't supported by docker volume).

cc @Random-Liu
2016-11-10 08:35:59 -08:00
Kubernetes Submit Queue 9bdff48d5e Merge pull request #36253 from timstclair/klet-stream-config-pr
Automatic merge from submit-queue

Use indirect streaming path for remote CRI shim

Last step for https://github.com/kubernetes/kubernetes/issues/29579

- Wire through the remote indirect streaming methods in the docker remote shim
- Add the docker streaming server as a handler at `<node>:10250/cri/{exec,attach,portforward}`
- Disable legacy streaming for dockershim

Note: This requires PR https://github.com/kubernetes/kubernetes/pull/34987 to work.

Tested manually on an E2E cluster.

/cc @euank @feiskyer @kubernetes/sig-node
2016-11-09 23:29:18 -08:00
Rajat Ramesh Koujalagi d81e216fc6 Better messaging for missing volume components on host to perform mount 2016-11-09 15:16:11 -08:00
Tim St. Clair 7badc1d226
Use indirect streaming path for dockershim & remote CRI runtime 2016-11-08 10:58:38 -08:00
Tim St. Clair 0f028ff660
Remove legacy dockershim streaming 2016-11-08 10:58:38 -08:00
Harry Zhang 64c8d3ad3d Add e2e node test for log path
Update to use pod to check log file
2016-11-08 13:01:25 -05:00
Yu-Ju Hong dcce768a3e Rename experimental-runtime-integration-type to experimental-cri 2016-11-07 11:29:24 -08:00
Kubernetes Submit Queue 182a09c3c7 Merge pull request #35526 from justinsb/fix_35521_b
Automatic merge from submit-queue

kubelet bootstrap: start hostNetwork pods before we have PodCIDR

Network readiness was checked in the pod admission phase, but pods that
fail admission are not retried.  Move the check to the pod start phase.

Issue #35409 
Issue #35521
2016-11-06 12:53:14 -08:00
Kubernetes Submit Queue 28733b0f8b Merge pull request #36201 from yujuhong/cri_inits
Automatic merge from submit-queue

CRI: rearrange kubelet rutnime initialization

Consolidate the code used by docker+cri and remote+cri for consistency, and to
prevent changing one without the other.  Enforce that
`--experimental-runtime-integration-type` has to be set in order for kubelet
use the CRI interface, *even for out-of-process shims`. This simplifies the
temporary `if` logic in kubelet while CRI still co-exists with older logic.
2016-11-06 10:23:52 -08:00
Kubernetes Submit Queue 8371a778f6 Merge pull request #35839 from Random-Liu/add-cri-runtime-status
Automatic merge from submit-queue

CRI: Add Status into CRI.

For https://github.com/kubernetes/kubernetes/issues/35701.
Fixes https://github.com/kubernetes/kubernetes/issues/35701.

This PR added a `Status` call in CRI, and the `RuntimeStatus` is defined as following:

``` protobuf
message RuntimeCondition {
    // Type of runtime condition.
    optional string type = 1;
    // Status of the condition, one of true/false.
    optional bool status = 2;
    // Brief reason for the condition's last transition.
    optional string reason = 3;
    // Human readable message indicating details about last transition.
    optional string message = 4;
}

message RuntimeStatus {
    // Conditions is an array of current observed runtime conditions.
    repeated RuntimeCondition conditions = 1;
}
```

Currently, only `conditions` is included in `RuntimeStatus`, and the definition is almost the same with `NodeCondition` and `PodCondition` in K8s api.

@yujuhong @feiskyer @bprashanth If this makes sense, I'll send a follow up PR to let dockershim return `RuntimeStatus` and let kubelet make use of it.
@yifan-gu @euank Does this make sense to rkt?
/cc @kubernetes/sig-node
2016-11-06 04:16:29 -08:00
Kubernetes Submit Queue 649c0ddd0e Merge pull request #35342 from timstclair/rejected
Automatic merge from submit-queue

[AppArmor] Hold bad AppArmor pods in pending rather than rejecting

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

Overview of the fix:

If the Kubelet needs to reject a Pod for a reason that the control plane doesn't understand (e.g. which AppArmor profiles are installed on the node), then it might contiinuously try to run the pod on the same rejecting node. This change adds a concept of "soft rejection", in which the Pod is admitted, but not allowed to run (and therefore held in a pending state). This prevents the pod from being retried on other nodes, but also prevents the high churn. This is consistent with how other missing local resources (e.g. volumes) is handled.

A side effect of the change is that Pods which are not initially runnable will be retried. This is desired behavior since it avoids a race condition when a new node is brought up but the AppArmor profiles have not yet been loaded on it.

``` release-note
Pods with invalid AppArmor configurations will be held in a Pending state, rather than rejected (failed). Check the pod status message to find out why it is not running.
```

@kubernetes/sig-node @timothysc @rrati @davidopp
2016-11-05 22:52:26 -07:00
Random-Liu 772bf8e14d Populate NetworkReady Status. 2016-11-05 00:02:05 -07:00
Random-Liu 4bd9dbf6ad Add RuntimeStatus in container/runtime.go 2016-11-05 00:02:05 -07:00
Yu-Ju Hong 5a148ee6e9 CRI: rearrange kubelet runtime initialization
Consolidate the code used by docker+cri and remote+cri for consistency, and to
prevent changing one without the other.  Enforce that
`--experimental-runtime-integration-type` has to be set in order for kubelet
use the CRI interface, *even for out-of-process shims`. This simplifies the
temporary `if` logic in kubelet while CRI still co-exists with older logic.
2016-11-04 12:29:13 -07:00
Justin Santa Barbara f8eb179c2d Create hostNetwork pods even if network plugin not ready
We do now admit pods (unlike the first attempt), but now we will stop
non-hostnetwork pods from starting if the network is not ready.

Issue #35409
2016-11-04 00:11:55 -04:00
Tim St. Clair 86d849e374
Separate Direct and Indirect streaming paths, implement indirect path with CRI 2016-11-03 13:26:33 -07:00
Tim St. Clair ec9111d942
Hold bad AppArmor pods in pending rather than rejecting 2016-11-02 11:05:16 -07:00
derekwaynecarr 42289c2758 pod and qos level cgroup support 2016-11-02 08:07:04 -04:00
Yu-Ju Hong 87aaf4c0ac dockershim: move docker to the given cgruop
This change add a container manager inside the dockershim to move docker daemon
and associated processes to a specified cgroup. The original kubelet container
manager will continue checking the name of the cgroup, so that kubelet know how
to report runtime stats.
2016-11-01 11:39:20 -07:00
xiangpengzhao 829980d871 Minor cleanup: fix typos 2016-10-31 21:13:05 -04:00
bprashanth 48db726342 Split network.Host into LegacyHost and NamespaceGetter 2016-10-31 13:05:19 -07:00
bprashanth c11aa2eb77 Teach dockershim to probe for network plugins 2016-10-31 13:05:13 -07:00
Tim St. Clair c60db99536
Implement streaming CRI methods in dockershim 2016-10-28 11:15:53 -07:00
Kubernetes Submit Queue 10061ac358 Merge pull request #35523 from luxas/remove_reconcile
Automatic merge from submit-queue

Deprecate the --reconcile-cidr flag

<!--  Thanks for sending a pull request!  Here are some tips for you:
1. If this is your first time, read our contributor guidelines https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md and developer guide https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md
2. If you want *faster* PR reviews, read how: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/faster_reviews.md
3. Follow the instructions for writing a release note: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes
-->

**What this PR does / why we need it**: Follows up https://github.com/kubernetes/kubernetes/pull/34906

**Special notes for your reviewer**: I'm not sure why coreos had set `--reconcile-cidr` to `false` and what the implications are now.

**Release note**:
<!--  Steps to write your release note:
1. Use the release-note-* labels to set the release note state (if you have access) 
2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`. 
-->
```release-note
Deprecate the --reconcile-cidr kubelet flag because it has no function anymore
```

PTAL @thockin @freehan @justinsb @yujuhong 
@kubernetes/sig-node @kubernetes/sig-network 

**I will add `hack/update-all.sh` contents soon to fix builds**
2016-10-26 20:18:37 -07:00
Random-Liu 54feed4e41 Enable remote dockershim by default. Once the grpc integration
is stablized, I'll remove the temporary knob and configure container
runtime endpoint in all test suite.
2016-10-26 11:00:31 -07:00
Lucas Käldström 1cf00d1ff1 Remove the function of --reconcile-cidr and deprecate it 2016-10-26 20:25:35 +03:00
Random-Liu 3d549b9e25 Add dockershim grpc server. 2016-10-25 10:31:16 -07:00
Yu-Ju Hong 94f580ef03 Revert "bootstrap: Start hostNetwork pods even if network plugin not ready" 2016-10-25 08:38:59 -07:00
Kubernetes Submit Queue 3c84164bdf Merge pull request #33347 from justinsb/fix_32900
Automatic merge from submit-queue

bootstrap: Start hostNetwork pods even if network plugin not ready
2016-10-24 01:14:06 -07:00
Jan Chaloupka 6079053407 Update clientset generator to use RESTClient interface instead of the RESTClient data type 2016-10-21 10:13:51 +02:00
Justin Santa Barbara ad6d842a65 Create hostNetwork pods even if network plugin not ready 2016-10-17 10:12:14 -04:00
Lucas Käldström 0800df74ab Remove the legacy networking mode --configure-cbr0 2016-10-16 21:26:41 +03:00
Kubernetes Submit Queue 254c10f08a Merge pull request #32137 from mtaufen/spellcheck
Automatic merge from submit-queue

Fixup in kubelet.go: Package short names should be [a-z0-9]
2016-10-11 00:33:34 -07:00
David Oppenheimer cd4e08e7ec Revert "Add kubelet awareness to taint tolerant match caculator." 2016-10-07 12:10:55 -07:00
Kubernetes Submit Queue 21188cadeb Merge pull request #26501 from resouer/scheduler
Automatic merge from submit-queue

Add kubelet awareness to taint tolerant match caculator.

Add kubelet awareness to taint tolerant match caculator.

Ref: #25320

This is required by `TaintEffectNoScheduleNoAdmit` & `TaintEffectNoScheduleNoAdmitNoExecute `, so that node will know if it should expect the taint&tolerant
2016-10-07 12:05:35 -07:00
Kubernetes Submit Queue 144d88b0a1 Merge pull request #33567 from pmorie/gc-event
Automatic merge from submit-queue

Add node event for container/image GC failure

Follow up to #31988.  Add an event for a node when container/image GC fails.
2016-10-07 00:45:24 -07:00
Kubernetes Submit Queue 457d3785de Merge pull request #33862 from luxas/remove_experimental_flannel
Automatic merge from submit-queue

Remove the flannel experimental overlay

<!--  Thanks for sending a pull request!  Here are some tips for you:
1. If this is your first time, read our contributor guidelines https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md and developer guide https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md
2. If you want *faster* PR reviews, read how: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/faster_reviews.md
3. Follow the instructions for writing a release note: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes
-->

**What this PR does / why we need it**:

It removes the deprecated flannel overlay integration in kubelet.
It's completely unnecessary now with CNI which can handle everything smoothly when flannel is running in a daemonset.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #17795, #30589

cc @kubernetes/sig-network @thockin @freehan @bprashanth @yujuhong @dchen1107
2016-10-04 21:39:20 -07:00
Lucas Käldström 348717c50a Remove the flannel experimental overlay 2016-10-04 11:53:53 +03:00
Harry Zhang 29c6a3b572 Enabel custom infracontainer image
Modify api protoc for infra
2016-10-03 23:54:19 -04:00
Kubernetes Submit Queue a241daf3f2 Merge pull request #33500 from Random-Liu/apparmor-seccomp-cri
Automatic merge from submit-queue

Add seccomp and apparmor support.

This PR adds seccomp and apparmor support in new CRI.

This a WIP because I'm still adding unit test for some of the functions. Sent this PR here for design discussion.

This PR is similar with https://github.com/kubernetes/kubernetes/pull/33450.
The differences are:
* This PR passes seccomp and apparmor configuration via annotations;
* This PR keeps the seccomp handling logic in docker shim because current seccomp implementation is very docker specific, and @timstclair told me that even the json seccomp profile file is defined by docker.

Notice that this PR almost passes related annotations in `api.Pod` to the runtime directly instead of introducing new CRI annotation.

@yujuhong @feiskyer @timstclair
2016-10-03 20:34:13 -07:00
Kubernetes Submit Queue 906cb1ce70 Merge pull request #33123 from kokhang/node-ip-cloud-provider
Automatic merge from submit-queue

Node-ip is not used when cloud provider is used

Currently --node-ip in kubelet is not being used when kubelet is configured with a cloud provider. With this fix, kubelet will get a list of IPs from the provider and parse it to return the one that matches node-ip.

This fixes #23568
2016-10-01 02:51:19 -07:00
Harry Zhang c2cf5bbaf6 Setup e2e test for no admit 2016-10-01 01:07:18 -04:00
Steve Leon a9123de9b4 Moving validateNodeIP to kubelet_node_status.go 2016-09-30 14:07:13 -07:00
Ke Zhang 8ef3c8b389 Use abstract cache.NewListWatchFromClient to make the code clean 2016-09-28 14:07:25 +08:00
Kubernetes Submit Queue 1854bdcb0c Merge pull request #29048 from justinsb/volumes_nodename_not_hostname
Automatic merge from submit-queue

Use strongly-typed types.NodeName for a node name

We had another bug where we confused the hostname with the NodeName.

Also, if we want to use different values for the Node.Name (which is
an important step for making installation easier), we need to keep
better control over this.

A tedious but mechanical commit therefore, to change all uses of the
node name to use types.NodeName
2016-09-27 17:58:41 -07:00
Random-Liu 88fb149cf5 Add seccomp and apparmor support. 2016-09-27 16:33:02 -07:00
Kubernetes Submit Queue 95fae4baf4 Merge pull request #33432 from pmorie/kubelet-move
Automatic merge from submit-queue

Move Kubelet pod-management code into kubelet_pods.go

Finish the kubelet code moves started during the 1.3 dev cycle -- move pod management code into a file called `kubelet_pods.go`.
2016-09-27 08:59:34 -07:00
Paul Morie e3eca8c63c Add node event for container/image GC failure 2016-09-27 10:59:25 -04:00
Justin Santa Barbara 54195d590f Use strongly-typed types.NodeName for a node name
We had another bug where we confused the hostname with the NodeName.

To avoid this happening again, and to make the code more
self-documenting, we use types.NodeName (a typedef alias for string)
whenever we are referring to the Node.Name.

A tedious but mechanical commit therefore, to change all uses of the
node name to use types.NodeName

Also clean up some of the (many) places where the NodeName is referred
to as a hostname (not true on AWS), or an instanceID (not true on GCE),
etc.
2016-09-27 10:47:31 -04:00
Paul Morie b1f91bd510 Move Kubelet pod-management code into kubelet_pods.go 2016-09-26 17:16:59 -04:00
Random-Liu 2141e230a6 Add oom score adj in new CRI implementation. 2016-09-26 11:39:02 -07:00
Kubernetes Submit Queue f9da079330 Merge pull request #33370 from justinsb/fix_typo
Automatic merge from submit-queue

Fix typo: rejcted -> rejected
2016-09-24 00:15:11 -07:00
Justin Santa Barbara 7fe6e45fdd Fix typo: rejcted -> rejected 2016-09-23 10:27:10 -04:00
Kubernetes Submit Queue b2aed32578 Merge pull request #33269 from deads2k/client-15-svc-lister
Automatic merge from submit-queue

simplify svc lister

trying to track down what killed the e2e tests.
2016-09-23 03:10:57 -07:00
Kubernetes Submit Queue 13a0ce6822 Merge pull request #31988 from pmorie/gc-log
Automatic merge from submit-queue

Add positive logging for GC events

We have no positive logging for GC events.  This PR:

1.  Adds positive logging at V(4) for success cases
2.  Adds positive logging at V(1) for the first successful GC after a failure
2016-09-23 00:36:43 -07:00
Yu-Ju Hong c43a106b26 Move ConvertPodStatusToRunningPod back to the kubelet/container package
This avoids unnecessary imports between of kuberuntime from dockertools/rkt,
which implements the same kubecontainer.Runtime interface.
2016-09-22 12:13:44 -07:00
Kubernetes Submit Queue b60df6c312 Merge pull request #33228 from yujuhong/pull_throttling
Automatic merge from submit-queue

Move image pull throttling logic to pkg/kubelet/images

This is part of #31458

This allows runtimes in different packages (dockertools, rkt, kuberuntime) to
share the same logic. Before this change, only dockertools support this
feature. Now all three packages support image pull throttling.

/cc @kubernetes/sig-node
2016-09-22 06:23:39 -07:00
deads2k 483af28944 fix up service lister 2016-09-22 09:12:37 -04:00
Yu-Ju Hong ee5b6a2550 Move image pull throttling logic to kubelet/images
This allows runtimes in different packages (dockertools, rkt, kuberuntime) to
share the same logic. Before this change, only dockertools support this
feature. Now all three packages support image pull throttling.
2016-09-21 18:31:04 -07:00
Antoine Pelisse 938872582e Revert "simplify RC and SVC listers" 2016-09-21 15:49:38 -07:00
Kubernetes Submit Queue 2d9d84dc64 Merge pull request #32888 from deads2k/client-10-fixup-remaining-listers
Automatic merge from submit-queue

simplify RC and SVC listers

Make the RC and SVC listers use the common list functions that more closely match client APIs, are consistent with other listers, and avoid unnecessary copies.
2016-09-21 04:13:56 -07:00
Kubernetes Submit Queue 650715d231 Merge pull request #32903 from yujuhong/enable_docker_shim
Automatic merge from submit-queue

kubelet: Add a hidden flag to enable docker CRI integration for testing
2016-09-20 11:19:26 -07:00
deads2k 16fbb47189 fix up service lister 2016-09-20 08:24:33 -04:00
Kubernetes Submit Queue b4d5177c23 Merge pull request #32816 from pmorie/kubelet-godoc
Automatic merge from submit-queue

Add missing kubelet godoc

Adds some missing godoc to Kubelet, which I found while triaging a bug.
2016-09-19 20:33:21 -07:00
Kubernetes Submit Queue 30ff1f495a Merge pull request #32914 from yujuhong/limit_names
Automatic merge from submit-queue

Limit the number of names per image reported in the node status

This fixes #32908
2016-09-19 15:10:52 -07:00
Yu-Ju Hong 1c3c1ac514 kubelet: Add a hidden flag to enable docker CRI integration
The new flag, if specified, and if --container-runtime=docker, switches
kubelet to use the new CRI implementation for testing. This is hidden flag
since the feature is still under heavy development and the flag may be changed
in the near future.
2016-09-19 13:09:00 -07:00
Yifan Gu 27d4866c4e CRI: Add missing sandbox in runningPod.
Append containers that represent pod sandboxes when converting the
pod status to runningPod.
2016-09-19 11:52:00 -07:00
Yu-Ju Hong 7ada99181c Limit the number of names per image reported in the node status 2016-09-16 15:16:08 -07:00
Kubernetes Submit Queue 2c6620b1ee Merge pull request #32563 from ZTE-PaaS/zhangke-patch-045
Automatic merge from submit-queue

Check kubeClient nil in Kubelet and bugfix

1. check kubeClient nil first before using as it maybe nil
2. configMaps and secrets map do not be used properly and should use it as cache
2016-09-15 18:48:34 -07:00
Paul Morie 703cc16403 Add missing kubelet godoc 2016-09-15 16:27:09 -04:00
Ke Zhang 423a51b632 Check kubeClient nil in Kubelet and bugfix 2016-09-14 12:57:42 +08:00
Pengfei Ni f774a68d52 Kubelet: add garbage collection for new runtime API 2016-09-14 09:09:45 +08:00
Kubernetes Submit Queue 622c2bbd5e Merge pull request #32116 from ZTE-PaaS/zhangke-patch-039
Automatic merge from submit-queue

Fixed TODO: move predicate check into a pod admitter

refractoring AdmitPod func to move predicate check into a pod admitter
2016-09-11 18:25:13 -07:00
Ke Zhang 0ce6d8dafb TODO: move predicate check into a pod admitter 2016-09-09 09:58:42 +08:00
derekwaynecarr ff017839c7 Log an event when container runtime exceeds grace-period during eviction 2016-09-07 13:28:08 -04:00
Michael Taufen 7b2af2dea0 Fixup in kubelet.go: Package short names should be [a-z0-9] 2016-09-06 14:59:59 -07:00
Paul Morie bd83f8b273 Add positive logging for GC events 2016-09-02 14:09:02 -04:00
Tim St. Clair 3808243b9e
Append "AppArmor enabled" to the Node ready condition message 2016-08-31 09:27:47 -07:00
Michael Taufen ceb00add97 Make kubeletConfiguration field on Kubelet struct a value type 2016-08-29 18:03:34 -07:00
Kubernetes Submit Queue eeac23282d Merge pull request #31446 from liggitt/log-streaming
Automatic merge from submit-queue

Fix hang/websocket timeout when streaming container log with no content

When streaming and following a container log, no response headers are sent from the kubelet `containerLogs` endpoint until the first byte of content is written to the log. This propagates back to the API server, which also will not send response headers until it gets response headers from the kubelet. That includes upgrade headers, which means a websocket connection upgrade is not performed and can time out.

To recreate, create a busybox pod that runs `/bin/sh -c 'sleep 30 && echo foo && sleep 10'`

As soon as the pod starts, query the kubelet API:
```
curl -N -k -v 'https://<node>:10250/containerLogs/<ns>/<pod>/<container>?follow=true&limitBytes=100'
```

or the master API:
```
curl -N -k -v 'http://<master>:8080/api/v1/<ns>/pods/<pod>/log?follow=true&limitBytes=100'
```

In both cases, notice that the response headers are not sent until the first byte of log content is available.

This PR:
* does a 0-byte write prior to handing off to the container runtime stream copy. That commits the response header, even if the subsequent copy blocks waiting for the first byte of content from the log.
* fixes a bug with the "ping" frame sent to websocket streams, which was not respecting the requested protocol (it was sending a binary frame to a websocket that requested a base64 text protocol)
* fixes a bug in the limitwriter, which was not propagating 0-length writes, even before the writer's limit was reached
2016-08-26 06:09:43 -07:00
Jordan Liggitt 0deddb1a62
Do initial 0-byte write to stdout when streaming container logs 2016-08-25 14:29:22 -04:00
Michael Taufen f277205f4f Kubelet Refactoring
This refactor removes the legacy KubeletConfig object and adds a new
KubeletDeps object, which contains injected runtime objects and
separates them from static config. It also reduces NewMainKubelet to two
arguments: a KubeletConfiguration and a KubeletDeps.

Some mesos and kubemark code was affected by this change, and has been
modified accordingly.

And a few final notes:

KubeletDeps:
KubeletDeps will be a temporary bin for things we might consider
"injected dependencies", until we have a better dependency injection
story for the Kubelet. We will have to discuss this eventually.

RunOnce:
We will likely not pull new KubeletConfiguration from the API server
when in runonce mode, so it doesn't make sense to make this something
that can be configured centrally. We will leave it as a flag-only option
for now. Additionally, it is increasingly looking like nobody actually uses the
Kubelet's runonce mode anymore, so it may be a candidate for deprecation
and removal.
2016-08-25 10:57:31 -07:00
Dr. Stefan Schimanski e356e52247 Add sysctl whitelist on the node 2016-08-25 13:22:01 +02:00
Kubernetes Submit Queue bb9523bd0f Merge pull request #31157 from pmorie/kubelet-move
Automatic merge from submit-queue

Kubelet code move: volume / util

Addresses some odds and ends that I apparently missed earlier.  Preparation for kubelet code-move ENDGAME.

cc @kubernetes/sig-node
2016-08-25 00:20:39 -07:00
Kubernetes Submit Queue 189a870ec8 Merge pull request #30376 from justinsb/kubenet_mtu
Automatic merge from submit-queue

Add kubelet --network-plugin-mtu flag for MTU selection

* Add network-plugin-mtu option which lets us pass down a MTU to a network provider (currently processed by kubenet)
* Add a test, and thus make sysctl testable
2016-08-23 21:54:50 -07:00
Kubernetes Submit Queue 64210f43ff Merge pull request #30429 from ZTE-PaaS/zhangke-patch-023
Automatic merge from submit-queue

two nits for kubelet syncPod

a useless ‘(’ and a log level should be info
2016-08-23 15:04:59 -07:00
Justin Santa Barbara 902ba4e249 Add network-plugin-mtu option for MTU selection
MTU selection is difficult, and if there is a transport such as IPSEC in
use may be impossible.  So we allow specification of the MTU with the
network-plugin-mtu flag, and we pass this down into the network
provider.

Currently implemented by kubenet.
2016-08-23 01:50:58 -04:00
Paul Morie b91ad76066 Kubelet code move: volume / util 2016-08-22 23:35:11 -04:00
Tim St. Clair f94df59791
Remove apparmor dependency on pkg/kubelet/lifecycle 2016-08-21 20:59:11 -07:00
Kubernetes Submit Queue 5d54c55710 Merge pull request #30212 from feiskyer/kuberuntime-flag
Automatic merge from submit-queue

Kubelet: add --container-runtime-endpoint and --image-service-endpoint

Flag `--container-runtime-endpoint` (overrides `--container-runtime`) is introduced to identify the unix socket file of the remote runtime service. And flag `--image-service-endpoint` is introduced to identify the unix socket file of the image service.

This PR is part of #28789 Milestone 0. 

CC @yujuhong @Random-Liu
2016-08-21 12:03:10 -07:00
Clayton Coleman e1ebde9f92
Add spec.nodeName and spec.serviceAccountName to downward env var
The serviceAccountName is occasionally useful for clients running on
Kube that need to know who they are when talking to other components.

The nodeName is useful for PetSet or DaemonSet pods that need to make
calls back to the API to fetch info about their node.

Both fields are immutable, and cannot easily be retrieved in another
way.
2016-08-20 15:50:36 -04:00
Kubernetes Submit Queue 1b79bc1812 Merge pull request #30731 from ncdc/exec-probe-message
Automatic merge from submit-queue

Always return command output for exec probes and kubelet RunInContainer

Always return command output for exec probes and kubelet RunInContainer, even if the command invocation returns nonzero.

When #24921 replaced RunInContainer with ExecInContainer, it introduced a change where an exec probe that failed no longer included the stdout/stderr from the probe in the event. For example, when running at log level 4, you see:

```
I0816 15:01:36.259826 29713 exec.go:38] Exec probe response: "Failed to access the status endpoint : HTTP Error 404: Not Found.\nHawkular metrics has only been running for 7\n seconds not aborting yet.\n"
```

But the event looks like this:

```
54s 22s 5 hawkular-metrics-hjme4 Pod spec.containers{hawkular-metrics} Warning Unhealthy {kubelet corbeau} Readiness probe failed:
```

Note the absence of the exec probe response after "Readiness probe failed". This PR restores the previous behavior.

cc @kubernetes/rh-cluster-infra @mwringe 

xref https://github.com/openshift/origin/issues/10424
2016-08-20 05:41:44 -07:00
Kubernetes Submit Queue 9e09839477 Merge pull request #30487 from ronnielai/container-gc
Automatic merge from submit-queue

Delete all dead containers only after the syncing for the evicted pod is done.
2016-08-20 01:03:39 -07:00
Kubernetes Submit Queue e9815020eb Merge pull request #30475 from derekwaynecarr/pod-cgroup
Automatic merge from submit-queue

Unblock iterative development on pod-level cgroups

In order to allow forward progress on this feature, it takes the commits from #28017 #29049 and then it globally disables the flag that allows these features to be exercised in the kubelet.  The flag can be re-added to the kubelet when its actually ready.

/cc @vishh @dubstack @kubernetes/rh-cluster-infra
2016-08-19 21:06:48 -07:00
Kubernetes Submit Queue 6ce405c6ee Merge pull request #27778 from screeley44/k8-vol-executor
Automatic merge from submit-queue

Add Events for operation_executor to show status of mounts, failed/successful to show in describe events

Fixes #27590 
@saad-ali @pmorie @erinboyd

After talking with @pmorie last week about the above issue, I decided to poke around and see if I could remedy.  The refactoring broke my previous UXP merged PR's that correctly showed failed mount errors in the describe events.  However, Not sure I implemented correctly, but it tested out and seems to be working, let me know what I missed or if this is not the correct approach.

```
Events:
  FirstSeen	LastSeen	Count	From			SubobjectPath	Type		Reason		Message
  ---------	--------	-----	----			-------------	--------	------		-------
  2m		2m		1	{default-scheduler }			Normal		Scheduled	Successfully assigned nfs-bb-pod1 to 127.0.0.1
  44s		44s		1	{kubelet 127.0.0.1}			Warning		FailedMount	Unable to mount volumes for pod "nfs-bb-pod1_default(a94f64f1-37c9-11e6-9aa5-52540073d346)": timeout expired waiting for volumes to attach/mount for pod "nfs-bb-pod1"/"default". list of unattached/unmounted volumes=[nfsvol]
  44s		44s		1	{kubelet 127.0.0.1}			Warning		FailedSync	Error syncing pod, skipping: timeout expired waiting for volumes to attach/mount for pod "nfs-bb-pod1"/"default". list of unattached/unmounted volumes=[nfsvol]
  38s		38s		1	{kubelet }				Warning		FailedMount	Unable to mount volumes for pod "a94f64f1-37c9-11e6-9aa5-52540073d346": Mount failed: exit status 32
Mounting arguments: nfs1.rhs:/opt/data99 /var/lib/kubelet/pods/a94f64f1-37c9-11e6-9aa5-52540073d346/volumes/kubernetes.io~nfs/nfsvol nfs []
Output: mount.nfs: Connection timed out

Resolution hint: Check and make sure the NFS Server exists (ensure that correct IPAddress/Hostname was given) and is available/reachable.
Also make sure firewall ports are open on both client and NFS Server (2049 v4 and 2049, 20048 and 111 for v3).
Use commands telnet <nfs server> <port> and showmount <nfs server> to help test connectivity.
```
2016-08-19 08:27:48 -07:00
dubstack 4ddfe172ce Add support for pod container management 2016-08-19 11:07:33 -04:00
Pengfei Ni b36ace9a57 Kubelet: add --container-runtime-endpoint and --image-service-endpoint
New flag --container-runtime-endpoint (overrides --container-runtime)
is introduced to kubelet which identifies the unix socket file of
the remote runtime service. And new flag --image-service-endpoint is
introduced to kubelet which identifies the unix socket file of the
image service.
2016-08-19 10:22:44 +08:00
Minhan Xia 1acaa1db09 Revert "Revert "syncNetworkUtil in kubelet and fix loadbalancerSourceRange on GCE"" 2016-08-18 10:19:48 -07:00
Andy Goldstein c3fe759fec Always return exec command output
Always return exec command output, even if the command invocation returns nonzero. This applies to
exec probes and kubelet RunInContainer calls.
2016-08-17 16:21:19 -04:00
Kubernetes Submit Queue f3f818a190 Merge pull request #29639 from aveshagarwal/master-default-resources-limits-fix
Automatic merge from submit-queue

Fix default resource limits (node allocatable) for downward api volumes and env vars

@kubernetes/rh-cluster-infra  @pmorie @derekwaynecarr
2016-08-17 11:37:41 -07:00
Scott Creeley 782d7d9815 Add Events for operation_executor to show status of mounts, failed or successful 2016-08-17 09:53:47 -04:00
Daniel Smith 2aa0bb2dfc Revert "syncNetworkUtil in kubelet and fix loadbalancerSourceRange on GCE" 2016-08-16 18:12:28 -07:00
Kubernetes Submit Queue d412d5721d Merge pull request #30486 from freehan/lbsrcfix
Automatic merge from submit-queue

syncNetworkUtil in kubelet and fix loadbalancerSourceRange on GCE

fixes: #29997 #29039

@yujuhong Can you take a look at the kubelet part?

@girishkalele KUBE-MARK-DROP is the chain for dropping connections. Marked connection will be drop  in INPUT/OUTPUT chain of filter table. Let me know if this is good enough for your use case.
2016-08-16 15:22:34 -07:00
Avesh Agarwal 52a60fe3be Fix default resource limits (node capacities) for downward api volumes 2016-08-16 14:41:17 -04:00
Kubernetes Submit Queue 5962874414 Merge pull request #30118 from timstclair/aa-hookup
Automatic merge from submit-queue

Implement AppArmor Kubelet support

Includes PR https://github.com/kubernetes/kubernetes/pull/29812

Implements the Kubelet logic for AppArmor based on the alpha API proposed [here](https://github.com/kubernetes/kubernetes/blob/master/docs/proposals/apparmor.md). Also adds an E2E test, and I ran manual tests.

Remaining work: PodSecurityPolicy support, profile loader daemon, documentation, (maybe) beta API.

/cc @jfrazelle @Amey-D @kubernetes/sig-node 

*Note on release-note-none: I am implementing AppArmor over multiple PRs. I will submit a single release note once the implementation is done to cover all of them.*
2016-08-15 22:32:58 -07:00
Minhan Xia 3bf8679232 add syncNetworkUtil in kubelet 2016-08-15 17:42:35 -07:00
bindata-mockuser e067f7548f Delete all dead containers only after pod syncing is done. 2016-08-15 14:36:51 -07:00
Tim St. Clair 3c7896719b
Implement AppArmor Kubelet support 2016-08-15 13:25:17 -07:00
Jing Xu f19a1148db This change supports robust kubelet volume cleanup
Currently kubelet volume management works on the concept of desired
and actual world of states. The volume manager periodically compares the
two worlds and perform volume mount/unmount and/or attach/detach
operations. When kubelet restarts, the cache of those two worlds are
gone. Although desired world can be recovered through apiserver, actual
world can not be recovered which may cause some volumes cannot be cleaned
up if their information is deleted by apiserver. This change adds the
reconstruction of the actual world by reading the pod directories from
disk. The reconstructed volume information is added to both desired
world and actual world if it cannot be found in either world. The rest
logic would be as same as before, desired world populator may clean up
the volume entry if it is no longer in apiserver, and then volume
manager should invoke unmount to clean it up.
2016-08-15 11:29:15 -07:00
Ke Zhang 3950f3253a two nits for kubelet syncPod 2016-08-12 09:18:29 +08:00
Yu-Ju Hong 8e48221c24 kubelet: mark source ready after updating the cache
This ensures that cleanup routines don't start until the cache content is
up-to-date.
2016-08-10 17:55:10 -07:00
Kubernetes Submit Queue a9af8a56b4 Merge pull request #30325 from ronnielai/test1
Automatic merge from submit-queue

Fixing a potential container deletion GC timing issue 

If pod manager is updated before all containers in a pod are deleted, the container clean up logic should still be triggered.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.kubernetes.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.kubernetes.io/reviews/kubernetes/kubernetes/30325)
<!-- Reviewable:end -->
2016-08-10 03:13:13 -07:00
bindata-mockuser 8ee2dc88f2 Container deletion should still happen when pod is removed from pod manager 2016-08-09 16:51:55 -07:00
mksalawa 2749ec7555 Create PredicateFailureReason, modify scheduler predicate interface. 2016-08-09 14:01:46 +02:00
Davanum Srinivas e0edfebe82 Verify volume.GetPath() never returns ""
Add a new helper method volume.GetPath(Mounter) instead of calling
the GetPath() of the Mounter directly. Check if GetPath() is returning
a "" and convert that into an error. At this point, we only have
information about the type of the Mounter, so let's log that if
there is a problem

Fixes #23163
2016-08-05 08:45:33 -04:00
Kubernetes Submit Queue 34e51d8ce9 Merge pull request #30095 from ronnielai/image-gc-2
Automatic merge from submit-queue

Moving image gc to pkg/kubelet/images
2016-08-05 03:11:33 -07:00
Kubernetes Submit Queue 4700b6fb3c Merge pull request #29880 from derekwaynecarr/disk-pressure-image-gc
Automatic merge from submit-queue

Node disk pressure should induce image gc

If the node reports disk pressure, prior to evicting pods, the node should clean up unused images.
2016-08-04 17:03:19 -07:00
Kubernetes Submit Queue 88f987e7e2 Merge pull request #29973 from ZTE-PaaS/zhangke-patch-016
Automatic merge from submit-queue

optimize podKiller for reading channel

Reading kl.podKillingCh should check whether ok first, then to process data
2016-08-04 16:25:54 -07:00
derekwaynecarr 68bc47ecc6 Add support to invoke image gc in response to disk eviction thresholds 2016-08-04 17:13:08 -04:00
bindata-mockuser 0c76d85cc8 moving image gc to images 2016-08-04 12:26:06 -07:00
Kubernetes Submit Queue 1933462c7b Merge pull request #29925 from ronnielai/container-gc
Automatic merge from submit-queue

Delete containers when pod is evicted

#29803
2016-08-04 04:20:02 -07:00
Ron Lai 8bc4444f16 Delete containers when pod is deleted 2016-08-03 15:56:04 -07:00
Ke Zhang 5d19daa2e2 optimize podKiller for reading channel 2016-08-03 15:36:04 +08:00
Andrey Kurilin 9f1c3a4c56 Fix various typos in kubelet 2016-08-03 01:14:44 +03:00
k8s-merge-robot 63602348a4 Merge pull request #29009 from bboreham/hairpin-via-cni
Automatic merge from submit-queue

Use the CNI bridge plugin to set hairpin mode

Following up this part of #23711:

>  I'd like to wait until containernetworking/cni#175 lands and then just pass the request through to CNI.

The code here just
 * passes the required setting down from kubenet to CNI
 * disables `DockerManager` from doing hairpin-veth, if kubenet is in use

Note to test you need a very recent version of the CNI `bridge` plugin; the one brought in by #28799 should be OK.

Also relates to https://github.com/kubernetes/kubernetes/issues/19766#issuecomment-232722864
2016-07-31 10:08:06 -07:00
k8s-merge-robot c5756d22e2 Merge pull request #29779 from 249043822/patch-1
Automatic merge from submit-queue

make log description more readable
2016-07-29 17:25:28 -07:00
k8s-merge-robot 2c4599bf45 Merge pull request #28793 from ronnielai/container-gc
Automatic merge from submit-queue

Trigger container cleanup within a pod when a container exiting event is detected

#25239
2016-07-29 16:40:01 -07:00
k8s-merge-robot 5760acf603 Merge pull request #29596 from matttproud/fix/time-leaks/remainder
Automatic merge from submit-queue

pkg/various: plug leaky time.New{Timer,Ticker}s

According to the documentation for Go package time, `time.Ticker` and
`time.Timer` are uncollectable by garbage collector finalizers.  They
leak until otherwise stopped.  This commit ensures that all remaining
instances are stopped upon departure from their relative scopes.

Similar efforts were incrementally done in #29439 and #29114.

```release-note
* pkg/various: plugged various time.Ticker and time.Timer leaks.
```
2016-07-29 14:06:47 -07:00
KeZhang fe031d3347 make log description more readable 2016-07-29 22:50:56 +08:00
Rudi Chiarito d6427cd0d7 kubelet: use util/iptables, which uses -w (lock wait) where safe 2016-07-28 16:01:00 -04:00
Bryan Boreham f21d2dde5a Add comment per review feedback 2016-07-28 12:34:21 +01:00
Harry Zhang cb14b35bde Refactor util clock into it's own pkg 2016-07-28 02:29:04 -04:00
Matt T. Proud 5c6292c074 pkg/various: plug leaky time.New{Timer,Ticker}s
According to the documentation for Go package time, `time.Ticker` and
`time.Timer` are uncollectable by garbage collector finalizers.  They
leak until otherwise stopped.  This commit ensures that all remaining
instances are stopped upon departure from their relative scopes.
2016-07-26 06:20:31 +02:00
Ron Lai 5aabeb67b3 Trigger container cleanup within a pod when a container exiting event is detected. 2016-07-25 18:43:49 -07:00
Random-Liu 973f2fcd86 Fail kubelet if cadvisor is not started. 2016-07-25 16:46:18 -07:00
k8s-merge-robot 0354a9027a Merge pull request #29328 from pmorie/kubelet-move
Automatic merge from submit-queue

Extract kubelet node status into separate file

Extract kubelet node status management into a separate file as a continuation of the kubelet code simplification effort.
2016-07-25 13:35:39 -07:00
k8s-merge-robot c186afd46e Merge pull request #29122 from ronnielai/image-gc-1-1
Automatic merge from submit-queue

Syncing imaging pulling backoff logic

- Syncing the backoff logic in the parallel image puller and the sequential image puller to prepare for merging the two pullers into one.
- Moving image error definitions under kubelet/images
2016-07-25 11:43:22 -07:00
k8s-merge-robot 1e7c513824 Merge pull request #29404 from derekwaynecarr/eviction-manager-runtime-dependent
Automatic merge from submit-queue

Eviction manager needs to start as runtime dependent module

To support disk eviction, the eviction manager needs to know if there is a dedicated device for the imagefs.  In order to know that information, we need to start the eviction manager after cadvisor.  This refactors the location eviction manager is started.

/cc @kubernetes/sig-node @kubernetes/rh-cluster-infra @vishh @ronnielai
2016-07-23 00:20:05 -07:00
derekwaynecarr 3e75f2effb Eviction manager needs to start as runtime dependent module 2016-07-22 10:19:40 -04:00
Paul Morie 249da77371 Extract kubelet node status into separate file 2016-07-22 01:21:30 -04:00
Dhawal Patel 93fb8c93c9 Fixes #28643. Pass nodeName to VolumeManager instead of hostName. 2016-07-20 23:03:56 -07:00
Ron Lai ee4822e476 Moving image pulling errors under kubelet/images 2016-07-20 14:20:53 -07:00
Michael Taufen 1e13b9b2de Remove duplicate code 2016-07-19 14:51:25 -07:00
k8s-merge-robot 6c1675a5cd Merge pull request #29080 from Random-Liu/continue-cleanup-despite-of-error
Automatic merge from submit-queue

Make kubelet continue cleanup when there is noncritical error.

Fix https://github.com/kubernetes/kubernetes/issues/29078.

Even though there is error when cleaning up pod directory or bandwidth limits, kubelet could continue cleanup the following stuff.
However, when runtime cache or runtime returns error, cleanup should fail, because the following cleanup relies on the `runningPod`.

@yujuhong 
/cc @kubernetes/sig-node
2016-07-19 01:43:29 -07:00
k8s-merge-robot 3786701280 Merge pull request #28865 from ronnielai/image-gc-0
Automatic merge from submit-queue

Moving event.go from kubelet/container to kubelet/events
2016-07-18 22:54:03 -07:00
Cindy Wang e13c678e3b Make volume unmount more robust using exclusive mount w/ O_EXCL 2016-07-18 16:20:08 -07:00
Random-Liu 62d2979e1b Make kubelet continue cleanup when there is noncritical error. 2016-07-18 14:43:41 -07:00
k8s-merge-robot 18df451031 Merge pull request #28982 from yujuhong/rm_todos
Automatic merge from submit-queue

kubelet: remove outdated TODOs
2016-07-18 02:19:23 -07:00
Buddha Prakash 5000e74664 Inject top level QoS cgroup creation in the Kubelet 2016-07-15 10:02:22 -07:00
k8s-merge-robot aa16140298 Merge pull request #28926 from ronnielai/pleg
Automatic merge from submit-queue

Including ContainerRemoved in PLEG event reporting
2016-07-15 07:03:19 -07:00
Yu-Ju Hong 007257a5ad kubelet: remove outdated TODOs 2016-07-14 18:28:25 -07:00
Daniel Smith 360f2eb927 Revert "Remove pod mutation for PVs with supplemental GIDs" 2016-07-14 17:47:46 -07:00
Ron Lai a58c774c08 Including ContainerRemoved in PLEG event reporting 2016-07-14 16:39:03 -07:00
k8s-merge-robot be3175611c Merge pull request #28691 from wongma7/pv-gid-squash2
Automatic merge from submit-queue

Remove pod mutation for PVs with supplemental GIDs

Continuation of https://github.com/kubernetes/kubernetes/pull/27571 to bring the feature back without pod mutation
2016-07-14 11:22:04 -07:00
Bryan Boreham 26a53fcd47 Use the CNI bridge plugin to set hairpin mode
Pass the flag down in kubenet, and disable it in DockerManager
2016-07-14 17:52:51 +01:00
k8s-merge-robot 50172148e4 Merge pull request #25273 from ncdc/exec-sigwinch
Automatic merge from submit-queue

Support terminal resizing for exec/attach/run

```release-note
Add support for terminal resizing for exec, attach, and run. Note that for Docker, exec sessions
inherit the environment from the primary process, so if the container was created with tty=false,
that means the exec session's TERM variable will default to "dumb". Users can override this by
setting TERM=xterm (or whatever is appropriate) to get the correct "smart" terminal behavior.
```

Fixes #13585
2016-07-14 07:26:49 -07:00
Andy Goldstein 3b21a9901b Support terminal resizing for exec/attach/run
Add support for terminal resizing for exec, attach, and run. Note that for Docker, exec sessions
inherit the environment from the primary process, so if the container was created with tty=false,
that means the exec session's TERM variable will default to "dumb". Users can override this by
setting TERM=xterm (or whatever is appropriate) to get the correct "smart" terminal behavior.
2016-07-13 17:06:16 -04:00
Matthew Wong 58f973d8e7 Remove pod mutation for PVs with supplemental GIDs 2016-07-13 13:51:17 -04:00
joe2far 5ead89b5bb Fixed several typos 2016-07-13 15:06:24 +01:00
Ron Lai e6b745122d Moving event.go from kubelet/container to kubelet/events 2016-07-12 17:42:29 -07:00
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