Commit Graph

3492 Commits (8c73e2bcbeabfefdedf2309c351b25f90c1b2bab)

Author SHA1 Message Date
Tamer Tas 5f141299ae pkg/kubelet/rktshim: disable ImageStore tests 2016-08-24 17:59:59 +03:00
Tamer Tas ed2d6d1f66 pkg/kubelet/rktshim: implement ImageStore 2016-08-24 17:59:59 +03:00
Tamer Tas f5b11145d4 pkg/kubelet/rktshim: implement rkt CLI 2016-08-24 17:59:59 +03:00
Tamer Tas 56fac03ce4 pkg/kubelet/rktshim: implement cli-flag reflection utility 2016-08-24 17:59:59 +03: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
Yifan Gu 173dbd700b rkt: Append `all-run` to `insecure-options` when the pod's all containers are privileged. 2016-08-23 14:07:18 -07:00
Yifan Gu d65a96a600 rkt: Override the config using the response from rkt api service. 2016-08-23 11:42:20 -07:00
Davanum Srinivas 87a370f67c Increase request timeout based on termination grace period
When terminationGracePeriodSeconds is set to > 2 minutes (which is
the default request timeout), ContainerStop() times out at 2 minutes.
We should check the timeout being passed in and bump up the
request timeout if needed.

Fixes #31219
2016-08-23 13:44:11 -04:00
Kubernetes Submit Queue f977752243 Merge pull request #30953 from m1093782566/m109-node_status_test
Automatic merge from submit-queue

[kubelet test] Improve node status test debug info

I find the output format `%v` of glog couldn't output useful information of an `api.Node` object. The output of this line https://github.com/kubernetes/kubernetes/blob/master/pkg/kubelet/kubelet_node_status_test.go#L492
is

```
kubelet_node_status_test.go:491: expected
                &TypeMeta{Kind:,APIVersion:,}
                , got
                &TypeMeta{Kind:,APIVersion:,}
```

- It's difficult for me to tell the difference between expected and got.

- I prefer to use `diff.ObjectDiff(expectedNode, updatedNode)` to output the debug information as it will point out the starting character of the different objects.

I think this line https://github.com/kubernetes/kubernetes/blob/master/pkg/kubelet/kubelet_node_status_test.go#L647 can use `diff.ObjectDiff()` as well.

The related issus is #30952
2016-08-23 00:19:20 -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
Justin Santa Barbara 2c103af2b6 Create testable implementation of sysctl
This is so we can test kubenet Init, which calls sysctl
2016-08-23 01:42:37 -04:00
Paul Morie b91ad76066 Kubelet code move: volume / util 2016-08-22 23:35:11 -04:00
Kubernetes Submit Queue 5f7c02c40c Merge pull request #30753 from feiskyer/sandbox-name
Automatic merge from submit-queue

Kubelet: pass pod name/namespace/uid in new runtime API

First part of #30463.

Pass pod name/namespace/uid in new runtime API and change dockershim to build unique sandbox/container name based on them.

CC @yujuhong @euank @yifan-gu @kubernetes/sig-node
2016-08-22 19:41:44 -07:00
Kubernetes Submit Queue d9533c9530 Merge pull request #29969 from ZTE-PaaS/zhangke-patch-015
Automatic merge from submit-queue

remove duplicate code in updatePodCIDR

As kl.runtimeState.podCIDR() is a sync method, need fetch lock and release lock, so we only invoke once here
2016-08-22 17:40:43 -07:00
Kubernetes Submit Queue 0babf0ed6d Merge pull request #30270 from ZJU-SEL/fix-minor-mistakes
Automatic merge from submit-queue

fix minor mistakes

<!--
Checklist for submitting a Pull Request

Please remove this comment block before submitting.

1. Please read our [contributor guidelines](https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md).
2. See our [developer guide](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md).
3. If you want this PR to automatically close an issue when it is merged,
   add `fixes #<issue number>` or `fixes #<issue number>, fixes #<issue number>`
   to close multiple issues (see: https://github.com/blog/1506-closing-issues-via-pull-requests).
4. Follow the instructions for [labeling and writing a release note for this PR](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes) in the block below.
-->

Signed-off-by: Xianglin Gao <xlgao@zju.edu.cn>
2016-08-22 17:40:39 -07:00
Tobias Schmidt 12c248315f Filter internal Kubernetes labels from Prometheus metrics
Kubernetes uses Docker labels as storage for some internal labels. The
majority of these labels are not meaningful metric labels and a few of
them are even harmful as they're not static and cause wrong aggregation
results.

This change provides a custom labels func to only attach meaningful
labels to cAdvisor exported metrics.
2016-08-22 19:44:27 -04:00
Pengfei Ni df00ec0c79 Kubelet: implement GetNetNS for new runtime api 2016-08-23 07:44:15 +08:00
Pengfei Ni 9bfa37f2ae Kubelet: pass pod name/namespace/uid to runtimes 2016-08-23 07:33:15 +08:00
Kubernetes Submit Queue 969ce77757 Merge pull request #30121 from feiskyer/kuberuntime-getpods
Automatic merge from submit-queue

Kubelet: implement GetPods for new runtime API

Implement GetPods for kuberuntime. Part of #28789 .

CC @yujuhong @Random-Liu
2016-08-22 10:24:23 -07:00
Wojciech Tyczynski 0459574450 Revert "Use netlink.SetPromiscOn instead of iproute2 command" 2016-08-22 10:28:11 +02:00
Kubernetes Submit Queue ada5669c7f Merge pull request #30346 from dshulyak/promisc
Automatic merge from submit-queue

Use netlink.SetPromiscOn instead of iproute2 command

Depends on https://github.com/vishvananda/netlink/pull/157
Related https://github.com/kubernetes/kubernetes/issues/26093
2016-08-21 23:34:21 -07:00
Tim St. Clair f94df59791
Remove apparmor dependency on pkg/kubelet/lifecycle 2016-08-21 20:59:11 -07:00
Pengfei Ni e3e10ddf8a Kubelet: implement GetPods for kuberuntime 2016-08-22 10:59:05 +08: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
Kubernetes Submit Queue 6dabf60114 Merge pull request #29919 from tmrts/kubelet-rkt-cri/container-api
Automatic merge from submit-queue

Kubelet rkt CRI stubs & fakes

Adds stubs for CRI interfaces and creates a fake for `ContainerRuntime` interface
2016-08-21 07:14:03 -07:00
Kubernetes Submit Queue f75910b7b4 Merge pull request #30934 from yifan-gu/fix_subpath
Automatic merge from submit-queue

rkt: Support subPath volume mounts feature

So that at most one volume object will be created for every unique
host path. Also the volume's name is random generated UUID to avoid
collision since the mount point's name passed by kubelet is not
guaranteed to be unique when 'subpath' is specified.

Should partially fix https://github.com/kubernetes/kubernetes/issues/26986 
The non-existing host path creation issue is not touched here.

cc @kubernetes/sig-rktnetes 
also cc @kubernetes/sig-node for the Mount name comments I added.
2016-08-21 03:07:20 -07:00
Kubernetes Submit Queue 4e571eafab Merge pull request #31032 from tmrts/fix/os-release-check
Automatic merge from submit-queue

pkg/kubelet/rkt: skip empty lines in getOSReleaseInfo

Follow-up of #31022
2016-08-21 02:29:33 -07:00
Kubernetes Submit Queue 7272cd09e3 Merge pull request #26541 from sttts/sttts-kubectl-exec-rc
Automatic merge from submit-queue

Return container command exit codes in kubectl run/exec

Fixes https://github.com/kubernetes/kubernetes/issues/26424
Based on https://github.com/kubernetes/kubernetes/pull/25273.

TODO:
- [x] add e2e tests
- [x] investigate `kubectl run` exit code for `--restart=Never` (compare issue #24533 and PR #25253)
- [x] document exit codes
2016-08-21 00:44:55 -07:00
Kubernetes Submit Queue f4ed73cace Merge pull request #31003 from pmorie/kubelet-status-mgr-shadow
Automatic merge from submit-queue

kubelet status manager: Fix nil in error message due to var shadowing

Variable shadowing can cause this log message to print a nil:

```go
glog.Warningf("Failed to update status for pod %q: %v", format.Pod(pod), err)
```

@kubernetes/rh-cluster-infra
2016-08-21 00:04:07 -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
bindata-mockuser e792d4117d Add return code support to kubectl-exec and -run 2016-08-20 15:58:47 +02:00
Kubernetes Submit Queue 7b3c08d7d3 Merge pull request #30789 from yujuhong/image_match
Automatic merge from submit-queue

Fix image inspection and matching

An image string could contain a hostname (e.g., "docker.io") or not. The same
applies to the RepoTags returned from an image inspection. To determine whether
the image docker pulled matches what the user ask for, we check if the either
string is the suffix of the other.

/cc @dims @dchen1107 @Random-Liu

This fixes #30710
2016-08-20 06:18:41 -07: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
Tamer Tas f82a41b329 Create a stub PodSandboxManager for rkt 2016-08-20 12:50:28 +03:00
Tamer Tas dcc8e9d4de Add a fake rkt app-level API to rktshim pkg 2016-08-20 12:45:57 +03:00
Tamer Tas f40a471efd Add the ContainerRuntime interface stub for rkt app level API 2016-08-20 11:21:54 +03: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 2da7f95c52 Merge pull request #28859 from freehan/godep_cni
Automatic merge from submit-queue

update godep to pull from containernetworking/cni

WIP
2016-08-19 18:54:48 -07:00
Tamer Tas d992c0e7c7 pkg/kubelet/rkt: skip empty lines in getOSReleaseInfo 2016-08-20 00:49:51 +03:00
Kubernetes Submit Queue 982640f73e Merge pull request #30668 from euank/dockertools-host-network
Automatic merge from submit-queue

dockertools: Don't use network plugin if net=host

I'm pretty sure this was just an oversight the first time around.

Before: `E0815 18:06:17.627468     976 docker_manager.go:350] NetworkPlugin kubenet failed on the status hook for pod 'sleep' - Unexpected command output Device "eth0" does not exist.`

After: No such logline is printed

The pod IP reported in `describe` is the same either way

cc @kubernetes/sig-node
2016-08-19 14:35:17 -07:00
Kubernetes Submit Queue bcf2d48ed5 Merge pull request #31022 from yifan-gu/fix_error_handling_os_release
Automatic merge from submit-queue

rkt: Do not error out when there are unrecognized lines in os-release

Also fix the error handling which will cause panic. Also fix the error handling which will cause panic.

cc @kubernetes/sig-rktnetes
2016-08-19 14:33:26 -07:00
Minhan Xia 85b2f9047a update godep to pull from containernetworking/cni 2016-08-19 13:31:50 -07:00
Yifan Gu ce15f0e831 rkt: Refactoring the construction of the mount points.
So that at most one volume object will be created for every unique
host path. Also the volume's name is random generated UUID to avoid
collision since the mount point's name passed by kubelet is not
guaranteed to be unique when 'subpath' is specified.
2016-08-19 13:09:27 -07:00
Kubernetes Submit Queue 2b18f37232 Merge pull request #30997 from tmrts/go-vet/fix-struct-initialization
Automatic merge from submit-queue

pkg/kubelet/images: fix struct initialization
2016-08-19 12:56:55 -07:00
Kubernetes Submit Queue b259073841 Merge pull request #30619 from tmrts/kubelet-api/extact-interfaces
Automatic merge from submit-queue

kubelet/api: split RuntimeService interface

Splits `RuntimeService` interface into smaller interfaces
to make testing easier and delineate the responsibilities.

Its a non-breaking change to the previous users of `api.RuntimeService`
2016-08-19 12:56:41 -07:00
Yifan Gu 3fac36585b rkt: Do not error out when there are unrecognized lines in os-release file.
Also fix the error handling which will cause panic.
2016-08-19 12:05:37 -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
Paul Morie dc8a9ae231 Fix nil in error message due to var shadowing 2016-08-19 11:23:19 -04:00
dubstack 4ddfe172ce Add support for pod container management 2016-08-19 11:07:33 -04:00
Tamer Tas 4d7357fb30 pkg/kubelet/images: fix struct initialization
Fixes the govet error in go 1.7
2016-08-19 16:52:52 +03:00
Kubernetes Submit Queue c19e9cc89d Merge pull request #26044 from smarterclayton/multiversion_encode
Automatic merge from submit-queue

Guarantee that Encode handles nested objects again
2016-08-18 21:10:55 -07: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
m1093782566 5bb76e9b5a improve node status test debug info
Change-Id: I6baacee3d253e64d4bc017d9da7e0ea0ec9783f1
2016-08-19 09:48:27 +08:00
Clayton Coleman 5f8366aac3
Convert() should accept the new conversion Context value
Allows Convert() to reuse the same conversions as ConvertToVersion
without being overly coupled to the version.
2016-08-18 14:45:20 -04:00
Minhan Xia b31874fe82 bug fixes and nits 2016-08-18 10:19:59 -07:00
Minhan Xia 1acaa1db09 Revert "Revert "syncNetworkUtil in kubelet and fix loadbalancerSourceRange on GCE"" 2016-08-18 10:19:48 -07:00
Yu-Ju Hong a47e2ff91a Fix image inspection and matching
An image string could contain a hostname (e.g., "docker.io") or not. The same
applies to the RepoTags returned from an image inspection. To determine whether
the image docker pulled matches what the user ask for, we check if the either
string is the suffix of the other.
2016-08-17 14:48:11 -07:00
derekwaynecarr a65a24a850 kubelet eviction on inode exhaustion 2016-08-17 16:57:44 -04: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
Kubernetes Submit Queue 622db63282 Merge pull request #30435 from hodovska/1328441-non-k8scontainers
Automatic merge from submit-queue

Add note: kubelet manages only k8s containers.

Kubelet wrote log when accesing container which was not created in k8s, what could confuse users. That's why we added note about it in documentation and lowered log level of the message to 5.

Here is example of the message: 
```
> Apr 19 11:50:32 openshift-114.lab.sjc.redhat.com atomic-openshift-node[9551]: 
I0419 11:50:32.194020    9600 docker.go:363] 
Docker Container: /tiny_babbage is not managed by kubelet.
```

bug 1328441
Bugzilla link https://bugzilla.redhat.com/show_bug.cgi?id=1328441
2016-08-17 00:54:33 -07:00
Kubernetes Submit Queue 1c9332ab51 Merge pull request #30400 from ronnielai/percent1
Automatic merge from submit-queue

Support percentage threshold for eviction
2016-08-16 23:03:21 -07: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
Euan Kemp c94e134ae4 dockertools: Don't use network plugin if net=host
This was already handled in most places. I think this is the only
remaining instance of it in the docker package.

This could lead to confusing results. E.g. if `networkPlugin` was cni,
it could lead to error logs about not getting network status for host
pods if eth0 didn't exist on the host.
2016-08-15 18:17:11 -07:00
Minhan Xia 3bf8679232 add syncNetworkUtil in kubelet 2016-08-15 17:42:35 -07:00
Tamer Tas f031f09efc kubelet/api: extract PodSandboxManager interface
Splits `RuntimeService` interface into smaller interfaces
to make testing easier and to delineate responsibilities.
2016-08-16 01:09:28 +03:00
Tamer Tas f715aa475c kubelet/api: extract ContainerManager interface 2016-08-16 01:08:17 +03:00
bindata-mockuser e067f7548f Delete all dead containers only after pod syncing is done. 2016-08-15 14:36:51 -07:00
Tamer Tas cfc08dea34 kubelet/api: extract RuntimeVersioner interface 2016-08-16 00:35:07 +03:00
Kubernetes Submit Queue 967dc4234a Merge pull request #30582 from dims/fix-issue-30580
Automatic merge from submit-queue

Fix image verification when hostname is present in image

Deal better with the situation where a image name contains
a hostname as well.

Fixes #30580
2016-08-15 14:26:05 -07:00
Kubernetes Submit Queue 79ed7064ca Merge pull request #27970 from jingxu97/restartKubelet-6-22
Automatic merge from submit-queue

Add volume reconstruct/cleanup logic in kubelet volume manager

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.

Fixes https://github.com/kubernetes/kubernetes/issues/27653
2016-08-15 13:48:43 -07:00
Tim St. Clair 3c7896719b
Implement AppArmor Kubelet support 2016-08-15 13:25:17 -07:00
Kubernetes Submit Queue 69419a145a Merge pull request #29802 from jfrazelle/fix-go-vet-errors
Automatic merge from submit-queue

fix go vet errors

<!--
Checklist for submitting a Pull Request

Please remove this comment block before submitting.

1. Please read our [contributor guidelines](https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md).
2. See our [developer guide](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md).
3. If you want this PR to automatically close an issue when it is merged,
   add `fixes #<issue number>` or `fixes #<issue number>, fixes #<issue number>`
   to close multiple issues (see: https://github.com/blog/1506-closing-issues-via-pull-requests).
4. Follow the instructions for [labeling and writing a release note for this PR](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes) in the block below.
-->

```release-note
```

This fixes the `go vet` errors brought about by go 1.7 testing re (#28742).

The are all pretty trivial and mostly related to literal composites.

also related to #16086
2016-08-15 13:10:08 -07:00
Kubernetes Submit Queue 88d8628137 Merge pull request #30521 from yujuhong/rm_pod_resources
Automatic merge from submit-queue

CRI: remove pod sandbox resources

The pod-level resources need further discussion. Remove it from CRI for now.

See the original discussion in #29871
2016-08-15 11:42:19 -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
Dominika Hodovska 08945a9b6a Add note: kubelet manages only k8s containers.
bug 1328441
Bugzilla link https://bugzilla.redhat.com/show_bug.cgi?id=1328441
2016-08-15 12:36:29 +02:00
Dmitry Shulyak b79a12c7ce Use netlink.SetPromiscOn instead of iproute2 command 2016-08-14 14:58:14 +03:00
Davanum Srinivas cc9f41c6d3 Fix image verification when hostname is present in image
Deal better with the situation where a image name contains
a hostname as well.

Fixes #30580
2016-08-13 23:10:07 -04:00
Kubernetes Submit Queue 7d00b427ef Merge pull request #30557 from freehan/cniconfig
Automatic merge from submit-queue

move syncNetworkConfig to Init for cni network plugin

start syncNetworkConfig routine in `Init` instead of probing. This fixes a bug where the syncNetworkConfig runs periodically even `cni` network plugin is not in use.
2016-08-13 05:58:33 -07:00
Kubernetes Submit Queue 9d3bd4caf6 Merge pull request #30517 from kubernetes/cri/remove-resources
Automatic merge from submit-queue

Remove resource specifications from CRI until further notice

See #29871 for the discussion issue.

cc @dchen1107 @vishh @yujuhong @euank @yifan-gu @feiskyer
2016-08-13 03:35:47 -07:00
Kubernetes Submit Queue 8a35d4c97c Merge pull request #30366 from dims/fix-issue-30355
Automatic merge from submit-queue

Validate SHA/Tag when checking docker images

Docker API does not validate the tag/sha, for example, all the following
calls work say for a alpine image with short SHA "4e38e38c8ce0"
echo -e "GET /images/alpine:4e38e38c8ce0/json HTTP/1.0\r\n" | nc -U /var/run/docker.sock
echo -e "GET /images/alpine:4e38e38c/json HTTP/1.0\r\n" | nc -U /var/run/docker.sock
echo -e "GET /images/alpine:4/json HTTP/1.0\r\n" | nc -U /var/run/docker.sock

So we should check the response from the Docker API and look for the tags or SHA explicitly.

Fixes #30355
2016-08-12 23:42:40 -07:00
Kubernetes Submit Queue 929b238adc Merge pull request #30137 from nhlfr/cni-plugin-fail
Automatic merge from submit-queue

Set pod state as "unknown" when CNI plugin fails

Before this change, CNI plugin failure didn't change anything in the pod status, so pods having containers without requested network were "running".

Fixes #29148
2016-08-12 19:28:14 -07:00
Kubernetes Submit Queue 96655d7578 Merge pull request #30087 from dims/remove-pkill-dependency
Automatic merge from submit-queue

Remove kubelet pkill dependency

Issue #26093 identified pkill as one of the dependencies of kublet
which could be worked around.  Build on the code introduced for pidof
and regexp for the process(es) we need to send a signal to.

Related to #26093
2016-08-12 18:38:38 -07:00
Yu-Ju Hong bf7020a9b7 CRI: remove pod resources
The pod-level resources need further discussion. Remove it from CRI for now.
2016-08-12 17:07:25 -07:00
Minhan Xia 7964148059 move syncNetworkConfig to Init for cni network plugin 2016-08-12 16:49:25 -07:00
Kubernetes Submit Queue f279e61e4a Merge pull request #27874 from ingvagabund/kubelet-kernel-tunning-behaviour-new-flags
Automatic merge from submit-queue

[kubelet] Introduce --protect-kernel-defaults flag to make the tunable behaviour configurable

Let's make the default behaviour of kernel tuning configurable. The default behaviour is kept modify as has been so far.
2016-08-12 14:11:26 -07:00
Tamer Tas 2b055eb475 pkg/kubelet/container: deprecate outdated CRI API 2016-08-12 23:06:36 +03:00
Tamer Tas 70b5ed2665 pkg/kubelet/rktshim: deprecate kubelet/container API usage 2016-08-12 23:06:32 +03:00
Kubernetes Submit Queue 72f41ff8cf Merge pull request #30506 from tmrts/docs/cri-correction
Automatic merge from submit-queue

pkg/kubelet/container: amend cgroup type documentation
2016-08-12 12:08:17 -07:00
Tamer Tas 14cc9919d0 pkg/kubelet/container: amend cgroup type documentation 2016-08-12 16:52:48 +03:00
Pengfei Ni 3512975c31 Kubelet: generate sandbox/container config for new runtime API 2016-08-12 12:20:56 +08:00
Kubernetes Submit Queue 7c7acbe1bb Merge pull request #30417 from yujuhong/source_ready
Automatic merge from submit-queue

kubelet: mark source ready after updating the cache

This ensures that cleanup routines don't start until the cache content is
up-to-date.

<!-- 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/30417)
<!-- Reviewable:end -->
2016-08-11 18:28:44 -07:00
Ke Zhang 3950f3253a two nits for kubelet syncPod 2016-08-12 09:18:29 +08:00
bindata-mockuser d2dd03aecc Support percentage representation for eviction thresholds 2016-08-11 14:10:25 -07:00
Kubernetes Submit Queue 9620f066c6 Merge pull request #30128 from ZTE-PaaS/zhangke-patch-021
Automatic merge from submit-queue

get workers length shoud use RLock

get workers length shoud use RLock properly

<!-- 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/30128)
<!-- Reviewable:end -->
2016-08-11 13:33:10 -07:00
Davanum Srinivas 875fd16e1e Validate SHA/Tag when checking docker images
Docker API does not validate the tag/sha, for example, all the following
calls work say for a alpine image with short SHA "4e38e38c8ce0"
echo -e "GET /images/alpine:4e38e38c8ce0/json HTTP/1.0\r\n" | nc -U /var/run/docker.sock
echo -e "GET /images/alpine:4e38e38c/json HTTP/1.0\r\n" | nc -U /var/run/docker.sock
echo -e "GET /images/alpine:4/json HTTP/1.0\r\n" | nc -U /var/run/docker.sock

So we should check the response from the Docker API and look for the
tags or SHA explicitly.

Fixes #30355
2016-08-11 08:53:05 -04:00
Jan Chaloupka eb967ad143 kubelet: introduce --protect-kernel-defaults to make the KernelTunableBehavior configurable 2016-08-11 13:08:27 +02: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
Jess Frazelle 7e9d82129e
fix go vet errors
Signed-off-by: Jess Frazelle <jessfraz@google.com>

fix composites

Signed-off-by: Jess Frazelle <me@jessfraz.com>
2016-08-10 16:45:41 -07:00
Davanum Srinivas ce93cb9d9c Remove kubelet dependency on pkill
Issue #26093 identified pkill as one of the dependencies of kublet
which could be worked around.  Build on the code introduced for pidof
and regexp for the process(es) we need to send a signal to.

Related to #26093
2016-08-10 17:14:49 -04: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
Kubernetes Submit Queue 70d6d165d5 Merge pull request #30002 from dims/remove-pidof-dependency
Automatic merge from submit-queue

Remove kubelet dependency on pidof

Issue #26093 identified pidof as one of the dependencies of kublet
which could be worked around. In this PR, we just look at /proc
to construct the list of pids we need for a specified process
instead of running "pidof" executable

Related to #26093

<!-- 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/30002)
<!-- Reviewable:end -->
2016-08-09 23:32:51 -07:00
Kubernetes Submit Queue 19a8f0f902 Merge pull request #29914 from tmrts/kubelet-rkt-cri/image-store
Automatic merge from submit-queue

Kubelet rkt CRI ImageService

Contains the ImageService stub and the basic tests for the implementation.

<!-- 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/29914)
<!-- Reviewable:end -->
2016-08-09 22:18:12 -07:00
Davanum Srinivas 1fdcea28e5 Remove kubelet dependency on pidof
Issue #26093 identified pidof as one of the dependencies of kublet
which could be worked around. In this PR, we just look at /proc
to construct the list of pids we need for a specified process
instead of running "pidof" executable

Related to #26093
2016-08-09 19:55:24 -04:00
bindata-mockuser 8ee2dc88f2 Container deletion should still happen when pod is removed from pod manager 2016-08-09 16:51:55 -07:00
Timothy St. Clair 4adb23c8cc Update dependency shift from etcd3 changes in latest release. 2016-08-09 08:51:15 -05:00
Tamer Tas 77777d5586 Test rkt CRI shim ImageStore 2016-08-09 15:56:34 +03:00
mksalawa 2749ec7555 Create PredicateFailureReason, modify scheduler predicate interface. 2016-08-09 14:01:46 +02:00
Ke Zhang 2b654d1206 optimize code duplicate for updatePodCIDR 2016-08-09 15:46:21 +08:00
Xianglin Gao 3b8f932ea9 fix minor mistakes
Signed-off-by: Xianglin Gao <xlgao@zju.edu.cn>
2016-08-09 15:09:31 +08:00
Kubernetes Submit Queue 70d6fe6d1c Merge pull request #30255 from Random-Liu/add-container-port-label
Automatic merge from submit-queue

Kubelet: Add container ports label.

Addresses https://github.com/kubernetes/kubernetes/pull/30049#discussion_r73983952.

Add container ports label, although we don't use it now, it will make it easier to switch to new runtime interface in the future.

@yujuhong @feiskyer
2016-08-08 23:28:05 -07:00
Kubernetes Submit Queue b0ea89c2f6 Merge pull request #30049 from feiskyer/kuberuntime-labels
Automatic merge from submit-queue

Kubelet: implement labels for new runtime API

Implement labels for new runtime API. Part of #28789 . 


CC @yujuhong @Random-Liu @kubernetes/sig-node

<!-- 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/30049)
<!-- Reviewable:end -->
2016-08-08 21:39:38 -07:00
Pengfei Ni e8fcafc925 Kubelet: implement labels for kuberuntime 2016-08-09 10:01:45 +08:00
Random-Liu ade092fe77 Add container ports label. 2016-08-08 18:40:18 -07:00
Kubernetes Submit Queue fbcb946db9 Merge pull request #30231 from derekwaynecarr/inodes-summary-api
Automatic merge from submit-queue

Add total inodes to kubelet summary api

Needed to support inode based eviction thresholds as a percentage.

/cc @ronnielai @vishh @kubernetes/rh-cluster-infra
2016-08-08 12:59:52 -07:00
Kubernetes Submit Queue 5eb088ebed Merge pull request #30172 from yujuhong/interface_cleanup
Automatic merge from submit-queue

Repalce rawContainerID with containerID
2016-08-08 11:48:43 -07:00
derekwaynecarr 2563696719 Add total inodes to kubelet summary api 2016-08-08 12:20:14 -04:00
Michal Rostecki 31cdd70808 Set pod state as "unknown" when CNI plugin fails
Before this change, CNI plugin failure didn't change anything in
the pod status, so pods having containers without requested
network were "running".

Fixes #29148
2016-08-08 17:55:19 +02:00
Kubernetes Submit Queue 9132b68866 Merge pull request #30133 from ZTE-PaaS/zhangke-patch-022
Automatic merge from submit-queue

refractoring findContainerStatus of status_manager

make findContainerStatus of status_manager simple
2016-08-06 03:36:01 -07:00
Kubernetes Submit Queue 3dad8f7c06 Merge pull request #29907 from luxas/lookup_ip_better
Automatic merge from submit-queue

[kubelet] Auto-discover node IP if neither cloud provider exists and IP is not explicitly specified

One example where the earlier implementation failed is when running kubelet on CoreOS (bare-metal), where the nameserver is set to `8.8.8.8`. kubelet tries to lookup the node name agains Google DNS, which obviously fails. The kubelet won't recover after that.

The workaround hsa been to set `--hostname-override` to an IP address, but it's quite annoying to try to make a multi-distro way of getting the IP in bash for example. This way is much cleaner.

Refactored the function a little bit at the same time

@vishh @yujuhong @resouer @Random-Liu
2016-08-06 02:26:30 -07:00
Kubernetes Submit Queue 94905bd7c0 Merge pull request #29619 from dims/fix-issue-23163
Automatic merge from submit-queue

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.

Fixes #23163
2016-08-06 01:44:15 -07:00
Kubernetes Submit Queue e628f6fa1d Merge pull request #29442 from xiangpengzhao/fix-log-info
Automatic merge from submit-queue

Log more info of container for debugging.
2016-08-05 19:19:19 -07:00
Yu-Ju Hong 93f0c5a8e5 Repalce rawContainerID with containerID 2016-08-05 16:26:47 -07: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
Ke Zhang 08d01a3879 refractoring findContainerStatus of status_manager 2016-08-05 17:52:02 +08:00
Ke Zhang 1c13540671 get workers length shoud use RLock 2016-08-05 16:05:18 +08:00
Kubernetes Submit Queue c393f11261 Merge pull request #29968 from ZTE-PaaS/zhangke-patch-014
Automatic merge from submit-queue

optimize lock of runtimeState stuct

use sync.RWMutex may be high effective for concorrent read
2016-08-04 20:03:47 -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
Kubernetes Submit Queue 07b650e165 Merge pull request #29844 from ZTE-PaaS/zhangke-patch-013
Automatic merge from submit-queue

make the removing pods log standardized
2016-08-04 15:52:34 -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
Buddha Prakash 49201f6923 Update Libcontainer's Cgroup Config: AllowAllDevices to be Nil 2016-08-04 10:05:30 -07:00
derekwaynecarr 611c127f0d kubelet eviction manager support for min-reclaim 2016-08-04 11:17:44 -04:00
Kubernetes Submit Queue 8ab06a3f86 Merge pull request #29958 from ronnielai/dep
Automatic merge from submit-queue

Updated cadvisor version

cc @derekwaynecarr
2016-08-04 07:50:19 -07:00
Tamer Tas f027b7a896 Add ImageService stub for rkt CRI shim 2016-08-04 14:22:22 +03: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
Kubernetes Submit Queue c2614aee9a Merge pull request #29500 from lixiaobing10051267/masterFound
Automatic merge from submit-queue

Check all places to break the loop when object found

Check all places to break the loop when object found.
2016-08-03 20:05:15 -07:00
Kubernetes Submit Queue a2bef42f84 Merge pull request #29036 from ronnielai/image-gc-2
Automatic merge from submit-queue

Consolidating image pulling logic

Moving image puller logic into image manager by consolidating 2 pullers into one implementation.
2016-08-03 17:39:06 -07:00
Ron Lai 8bc4444f16 Delete containers when pod is deleted 2016-08-03 15:56:04 -07:00
Yu-Ju Hong 5c06d7e620 CRI: rename DeletePodSandbox to RemovePodSandbox
This makes it consistent with other calls (e.g., RemoveContainer, RemoveImage).
2016-08-03 15:46:34 -07:00
Ron Lai 321c289792 Consolidating imaging pulling logic 2016-08-03 10:48:50 -07:00
Kubernetes Submit Queue 804109d349 Merge pull request #29950 from andreykurilin/kubelet_typos
Automatic merge from submit-queue

Fix various typos in kubelet
2016-08-03 10:05:46 -07:00
Kubernetes Submit Queue 73deb72399 Merge pull request #29824 from feiskyer/kuberuntime
Automatic merge from submit-queue

Kubelet: add kubeGenericRuntimeManager for new runtime API

Part of #28789. Add `kubeGenericRuntimeManager` for kubelet new runtime API #17048. 

Note that:

- To facilitate code reviewing, #28396 is splited into a few small PRs. This is the first part.
- This PR also fixes some syntax errors in `api.proto`.
- This PR is depending on #29811 (already merged).

CC @yujuhong @Random-Liu @kubernetes/sig-node
2016-08-03 10:05:42 -07:00
Ke Zhang 5d19daa2e2 optimize podKiller for reading channel 2016-08-03 15:36:04 +08:00
Kubernetes Submit Queue 93385a2f97 Merge pull request #29623 from feiskyer/kuberuntime-remote
Automatic merge from submit-queue

Kubelet: add gRPC implementation of new runtime interface

Add gRPC implementation of new runtime interface.

CC @yujuhong @Random-Liu  @kubernetes/sig-node
2016-08-02 23:36:26 -07:00
Ke Zhang e9b0454a9d optimize lock of runtimeState stuct 2016-08-03 13:19:22 +08:00
Pengfei Ni 81a79cd4c0 Kubelet: add kubeGenericRuntimeManager for new runtime API 2016-08-03 08:26:53 +08:00
bindata-mockuser e00a35ccad updated cadvisor version 2016-08-02 16:33:03 -07:00
Pengfei Ni f8c51adbe1 Log id in error message 2016-08-03 07:22:06 +08:00
Yu-Ju Hong 5960d87d21 dockershim: Implement sandbox methods 2016-08-02 15:24:52 -07:00
Andrey Kurilin 9f1c3a4c56 Fix various typos in kubelet 2016-08-03 01:14:44 +03:00
k8s-merge-robot 68632db799 Merge pull request #27562 from 7ing/ipt
Automatic merge from submit-queue

improve iptables-restore implementation #27559

[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()
fixes #27559
- improve restoreInternal implementation in iptables
- add SetStdin and SetStdout functions to Cmd interface
- modify kubelet/prober and some tests in order to work with Cmd interface
2016-08-02 08:02:32 -07:00
Tamer Tas 9c840494a2 Create pkg/kubelet/rktshim package for rkt CRI integration 2016-08-02 16:22:01 +03:00
k8s-merge-robot 6cd89cba62 Merge pull request #29811 from feiskyer/kuberuntime-fake
Automatic merge from submit-queue

Kubelet: add fake kube runtime

Add a new fake kube runtime with kubelet using the new runtime API.

CC @yujuhong @Random-Liu
2016-08-02 04:59:15 -07:00
Lucas Käldström 25d9779f06 Make the lookup function of the node ip address more robust 2016-08-02 14:03:20 +03:00
k8s-merge-robot 6a61a1b4bd Merge pull request #29775 from ZTE-PaaS/zhangke-patch-012
Automatic merge from submit-queue

pods which can not be admitted should return directly

if the pod can not be admitted, the code runPod(pod, retryDelay) should not be run.
2016-08-02 03:11:10 -07:00
Pengfei Ni b581e23c93 Kubelet: add gRPC implementation of new runtime interface 2016-08-02 16:43:02 +08:00
k8s-merge-robot 01cd7f326e Merge pull request #29621 from resouer/uuid
Automatic merge from submit-queue

Refactor uuid into its own pkg util/uuid

Continuing my work ref #15634

Anyone can review this if he/she wants.
2016-08-01 22:21:30 -07:00
Pengfei Ni bf7a941b92 Kubelet: implement fake runtime/image service 2016-08-02 12:17:20 +08:00
k8s-merge-robot d9ca9e8cbf Merge pull request #29884 from yujuhong/mv_services
Automatic merge from submit-queue

kubelet: move kuberuntime.go to api/services.go
2016-08-01 18:41:27 -07:00
Yu-Ju Hong 97e30e134e kubelet: move kuberuntime.go to api/services.go
Also add a testing package and add placeholders for fake services.
2016-08-01 15:31:55 -07:00
Michal Rostecki 59ca5986dd Print/log pointers of structs with %#v instead of %+v
There are many places in k8s where %+v is used to format a pointer
to struct, which isn't working as expected.

Fixes #26591
2016-08-01 22:27:56 +02:00
Ke Zhang e143c38310 make the removing pods log standardized 2016-08-01 18:41:40 +08: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
Harry Zhang c495397cae Refactor uuid into its own pkg 2016-07-30 00:07:02 -04:00
Ke Zhang e48f995987 pods can not admitted should return directly 2016-07-30 11:47:50 +08:00
k8s-merge-robot cc1a02620b Merge pull request #29766 from feiskyer/runtime-remove-clarify
Automatic merge from submit-queue

Kubelet: clarify the resource remove logic in runtime API

CC @yujuhong
2016-07-29 19:51:58 -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
Pengfei Ni cce9405e15 Clarify the resource remove logic in runtime API
If the resource in the delete call does not exist, the runtime should
not return an error. This eliminates the need for kubelet to define a
resource "not found" error that every runtime has to return.
2016-07-30 07:00:16 +08: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
k8s-merge-robot 94b5d52b90 Merge pull request #29580 from yujuhong/dshim2
Automatic merge from submit-queue

dockershim: Implement more functions.

Based on #29553. Only the last two commits are new.
2016-07-29 12:55:56 -07:00
k8s-merge-robot 46c8dfd7a2 Merge pull request #29135 from Clarifai/kubelet-util-ipt
Automatic merge from submit-queue

kubelet: use util/iptables, which uses -w (lock wait) where safe

cc @thockin @dchen1107
2016-07-29 10:10:11 -07:00
Rudi Chiarito 13b082968b Add tests for container_bridge.go (really just ensureIPTablesMasqRule) 2016-07-29 11:57:17 -04:00
KeZhang fe031d3347 make log description more readable 2016-07-29 22:50:56 +08:00
k8s-merge-robot 821ff657f9 Merge pull request #27199 from derekwaynecarr/disk_eviction
Automatic merge from submit-queue

Initial support for pod eviction based on disk

This PR adds the following:

1. node reports disk pressure condition based on configured thresholds
1. scheduler does not place pods on nodes reporting disk pressure
1. kubelet will not admit any pod when it reports disk pressure
1. kubelet ranks pods for eviction when low on disk
1. kubelet evicts greediest pod

Follow-on PRs will need to handle:

1. integrate with new image gc PR (https://github.com/kubernetes/kubernetes/pull/27199)
1. container gc policy should always run (will not be launched from eviction, tbd who does that)
  1. this means kill pod is fine for all eviction code paths since container gc will remove dead container
1. min reclaim support will just poll summary provider (derek will do follow-on)
1. need to know if imagefs is same device as rootfs from summary (derek follow-on)

/cc @vishh @kubernetes/sig-node
2016-07-28 20:18:54 -07:00
Yu-Ju Hong e80ad2be38 dockershim: add support for legacy methods 2016-07-28 18:24:29 -07:00
Yu-Ju Hong 03971d3992 dockershim: implement ContainerStatus() 2016-07-28 18:24:29 -07:00
k8s-merge-robot 7aa592bfa3 Merge pull request #29553 from yujuhong/docker-shim
Automatic merge from submit-queue

Add a docker-shim package

Add a new docker integration with kubelet using the new runtime API.
This change adds the package with the skeleton and implements some of the basic operations.


This PR only implements a small sets of functions. The rest of the functions will be implemented
in the followup PRs to keep the changes readable, and the reviewers sane.

Note: The first commit is from #28396, only the second commit is for review. 

/cc @kubernetes/sig-node @feiskyer @Random-Liu
2016-07-28 17:58:56 -07:00
derekwaynecarr d37710f87b Allow cAdvisor to collect fs stats before building resource ranking funcs 2016-07-28 16:20:09 -04:00
derekwaynecarr 0de1e62b30 modify fsStats to fsStatsType to avoid confusion with cadvisor types 2016-07-28 16:01:38 -04:00
derekwaynecarr c3324b88a0 Eviction manager observes and acts on disk pressure 2016-07-28 16:01:38 -04:00
Rudi Chiarito d6427cd0d7 kubelet: use util/iptables, which uses -w (lock wait) where safe 2016-07-28 16:01:00 -04:00
k8s-merge-robot 61524b9e15 Merge pull request #29526 from vishh/logfilelen
Automatic merge from submit-queue

Restrict log sym link to 256 characters

This fix can potentially cause conflicts in log file names. The current model of exporting log data is fundamentally broken. This PR does not attempt to fix all of the issues.
2016-07-28 12:10:51 -07:00
k8s-merge-robot eae90a3631 Merge pull request #26332 from resouer/util-debt
Automatic merge from submit-queue

Refactor util clock into it's own pkg

Continue my work ref #15634
2016-07-28 11:37:06 -07:00
Vishnu Kannan acc74fbaa9 restrict log sym link filename to 255 characters
Signed-off-by: Vishnu Kannan <vishnuk@google.com>
2016-07-28 10:23:17 -07:00
k8s-merge-robot 7e1e51844f Merge pull request #29618 from aveshagarwal/master-rhbz-1357825
Automatic merge from submit-queue

Fix kubelet to not accept negative eviction (hard, soft) thresholds

@kubernetes/rh-cluster-infra @derekwaynecarr
2016-07-28 08:10:02 -07:00
Bryan Boreham f21d2dde5a Add comment per review feedback 2016-07-28 12:34:21 +01:00
k8s-merge-robot 2480ef5f1d Merge pull request #28178 from mikedanese/cni-reload
Automatic merge from submit-queue

periodically reload the cni plugin configuration

Might fix #28787
2016-07-28 02:27:43 -07:00
Harry Zhang cb14b35bde Refactor util clock into it's own pkg 2016-07-28 02:29:04 -04:00
k8s-merge-robot 1ae9b73cd3 Merge pull request #29673 from pmorie/mount-collision
Automatic merge from submit-queue

Fix mount collision timeout issue

Short- or medium-term workaround for #29555.  The root issue being fixed here is that the recent attach/detach work in the kubelet uses a unique volume name as a key that tracks the work that has to be done for each volume in a pod to attach/mount/umount/detach.  However, the non-attachable volume plugins do not report unique names for themselves, which causes collisions when a single secret or configmap is mounted multiple times in a pod.

This is still a WIP -- I need to add a couple E2E tests that ensure that tests break in the future if there is a regression -- but posting for early review.

cc @kubernetes/sig-storage 

Ultimately, I would like to refine this a bit further.  A couple things I would like to change:

1.  `GetUniqueVolumeName` should be a property ONLY of attachable volumes
2.  I would like to see the kubelet apparatus for attach/mount/umount/detach handle non-attachable volumes specifically to avoid things like the `WaitForControllerAttach` call that has to be done for those volume types now
2016-07-27 21:06:47 -07:00
Yu-Ju Hong 03d11bcf4e Add a dockershim package
Add a new docker integration with kubelet using the new runtime API.
This change adds the package with some skeletons, and implements some
of the basic operations.
2016-07-27 18:30:25 -07:00