Commit Graph

923 Commits (47320fd3f07ef067c09f1934cab2981f30ccbc84)

Author SHA1 Message Date
Wojciech Tyczynski 3a0112f6ee Revert "dockershim: add unit tests for sandbox/container status" 2016-09-13 09:01:19 +02:00
Ke Zhang 347293617f Improving StopContainer failed log level 2016-09-13 14:23:15 +08:00
Yu-Ju Hong 0075e9dbee dockershim: add unit tests for sandbox/container status
Also add a fake clock in the FakeDockerClient to allow testing container
CreatedAt, StartedAt, FinishedAt timestamps.
2016-09-12 12:55:49 -07:00
Kubernetes Submit Queue 0bd0d5571a Merge pull request #31540 from mtaufen/DockerOrDieRename
Automatic merge from submit-queue

Rename ConnectToDockerOrDie to CreateDockerClientOrDie

This function does not actually attempt to connect to the docker daemon, it just creates a client object that can be used to do so later. The old name was confusing, as it implied that a failure to touch the docker daemon could cause program termination (rather than just a failure to create the client).
2016-09-07 15:27:41 -07:00
bprashanth a0c0dcd8bd Log pod ip at V(2) 2016-09-01 17:33:24 -07:00
Maciej Kwiek a2472c2a4e Pod creation moved outside of docker manager tests
Also one deprecated TODO deleted
2016-08-30 13:30:26 +03:00
Tim St. Clair 785c83cc2d
Include security options in the container created event 2016-08-26 15:32:48 -07:00
Michael Taufen b9ad337bbd Rename ConnectToDockerOrDie to CreateDockerClientOrDie
This function does not actually attempt to connect to the docker daemon,
it just creates a client object that can be used to do so later. The old
name was confusing, as it implied that a failure to touch the docker daemon
could cause program termination (rather than just a failure to create the
client).
2016-08-26 11:21:07 -07:00
Kubernetes Submit Queue 4ddfc4849a Merge pull request #27180 from sttts/sysctl-implementation
Automatic merge from submit-queue

Add sysctl support

Implementation of proposal https://github.com/kubernetes/kubernetes/pull/26057, feature  https://github.com/kubernetes/features/issues/34

TODO:
- [x] change types.go
- [x] implement docker and rkt support
- [x] add e2e tests
- [x] decide whether we want apiserver validation
- ~~[ ] add documentation~~: api docs exist. Existing PodSecurityContext docs is very light and links back to the api docs anyway: 6684555ed9/docs/user-guide/security-context.md
- [x] change PodSecurityPolicy in types.go
- [x] write admission controller support for PodSecurityPolicy
- [x] write e2e test for PodSecurityPolicy
- [x] make sure we are compatible in the sense of https://github.com/kubernetes/kubernetes/blob/master/docs/devel/api_changes.md
- [x] test e2e with rkt: it only works with kubenet, not with no-op network plugin. The later has no sysctl support.
- ~~[ ] add RunC implementation~~ (~~if that is already in kube,~~ it isn't)
- [x] update whitelist
- [x] switch PSC fields to annotations
- [x] switch PSP fields to annotations
- [x] decide about `--experimental-whitelist-sysctl` flag to be additive or absolute
- [x] decide whether to add a sysctl node whitelist annotation

### Release notes:

```release-note
The pod annotation `security.alpha.kubernetes.io/sysctls` now allows customization of namespaced and well isolated kernel parameters (sysctls), starting with `kernel.shm_rmid_forced`, `net.ipv4.ip_local_port_range`, `net.ipv4.tcp_max_syn_backlog` and `net.ipv4.tcp_syncookies` for Kubernetes 1.4.

The pod annotation  `security.alpha.kubernetes.io/unsafeSysctls` allows customization of namespaced sysctls where isolation is unclear. Unsafe sysctls must be enabled at-your-own-risk on the kubelet with the `--experimental-allowed-unsafe-sysctls` flag. Future versions will improve on resource isolation and more sysctls will be considered safe.
```
2016-08-25 06:21:24 -07:00
Dr. Stefan Schimanski e356e52247 Add sysctl whitelist on the node 2016-08-25 13:22:01 +02:00
Dominika Hodovska bea189e9c9 Add sysctl api, validation & Docker support 2016-08-25 13:22:01 +02:00
Kubernetes Submit Queue e4178c82f3 Merge pull request #31275 from dims/fix-issue-31219
Automatic merge from submit-queue

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-25 03:20:32 -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
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
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 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
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
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 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
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
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
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
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 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
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
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
Random-Liu ade092fe77 Add container ports label. 2016-08-08 18:40:18 -07: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 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
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 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
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
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
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
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
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
Harry Zhang cb14b35bde Refactor util clock into it's own pkg 2016-07-28 02:29:04 -04: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
k8s-merge-robot ab7d039c81 Merge pull request #29388 from ronnielai/image-gc-check
Automatic merge from submit-queue

Avoiding trying to gc images with no tags which are still in use

#29325
2016-07-27 16:44:50 -07:00
Ron Lai 64981aaf46 Avoiding trying to gc images with no tags which are still in use 2016-07-27 10:31:47 -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
lixiaobing10051267 be8d081539 Check all places to break the loop when object found 2016-07-23 13:49:04 +08:00
k8s-merge-robot d525d5345e Merge pull request #29119 from wongma7/pv-gid-squash2
Automatic merge from submit-queue

Allow PVs to specify supplemental GIDs

Retry of https://github.com/kubernetes/kubernetes/pull/28691 . Adds a Kubelet helper function for getting extra supplemental groups
2016-07-22 22:36:51 -07:00
Matthew Wong cbdd121d2d Remove pod mutation for PVs with supplemental GIDs 2016-07-22 17:41:44 -04:00
xiangpengzhao c1c85a6c5f Log more info of container for debugging. 2016-07-22 05:26:03 -04:00
k8s-merge-robot 480e8a30ef Merge pull request #29316 from ronnielai/docker-image-remove
Automatic merge from submit-queue

Removing images with multiple tags

If an image has multiple tags, we need to remove all the tags in order to make docker image removing successful.

#28491
2016-07-21 17:47:17 -07:00
Ron Lai e25da21503 Clear tags to remove images with multiple tags 2016-07-21 14:14:32 -07:00
xiangpengzhao c51346e5cc Fix incorrect if conditions and add test case 2016-07-20 20:50:02 -04:00
Ron Lai ee4822e476 Moving image pulling errors under kubelet/images 2016-07-20 14:20:53 -07:00
k8s-merge-robot afe4977c9b Merge pull request #28975 from ronnielai/image-gc-1
Automatic merge from submit-queue

ImagePuller refactoring

A plain refactoring
- Moving image pullers to a new pkg/kubelet/images directory
- Hiding image pullers inside the new ImageManager 

The next step is to consolidate the logic of the serialized and the parallel image pullers inside ImageManager

xref: #25577
2016-07-20 13:37:48 -07:00
k8s-merge-robot e2a697db47 Merge pull request #29246 from Random-Liu/fix-image-remove-bug
Automatic merge from submit-queue

Kubelet: Set PruneChildren when removing image.

This is a bug introduced during switching to engine-api. https://github.com/kubernetes/kubernetes/issues/23563.

When removing image, there is an option `noprune`:
```
If prune is true, ancestor images will each attempt to be deleted quietly.
```

In go-dockerclient, the default value of the option is ["noprune=false"](https://github.com/fsouza/go-dockerclient/blob/master/image.go#L171), which means that ancestor images should be also removed. This is the expected behaviour.

However in engine-api, the option is changed to `PruneChildren`, and the default value is `PruneChildren=false`, which means that ancestor images won't be removed.
This makes `ImageRemove` only remove the first layer of the image, which causes the image garbage collection not working as expected.

This should be fixed in 1.3.
And thanks to @ronnielai for finding the bug! :)

/cc @kubernetes/sig-node
2016-07-20 12:59:53 -07:00
k8s-merge-robot c0557a6b66 Merge pull request #29171 from euank/determine-container-ip-args
Automatic merge from submit-queue

docker_manager: Correct determineContainerIP args

This could result in the network plugin not retrieving the pod ip in a
call to SyncPod when using the `exec` network plugin.
The CNI and kubenet network plugins ignore the name/namespace arguments,
so they are not impacted by this bug.

I verified the second included test failed prior to correcting the
argument order.

Fixes #29161 

cc @yujuhong
2016-07-20 12:26:37 -07:00
k8s-merge-robot 6df62ff39c Merge pull request #29162 from xiangpengzhao/fix_err_to_cerr
Automatic merge from submit-queue

Fix wrong variable of error

Should not log `err` but `cerr`.
2016-07-20 11:11:33 -07:00
Ron Lai 56b9daf50f Moving image pullers to images directory 2016-07-20 09:47:11 -07:00
Random Liu 51184db4df Set PruneChildren when removing image. 2016-07-20 02:07:28 +00:00
k8s-merge-robot 372fb5cd5f Merge pull request #29085 from xiangpengzhao/delete_redundant_case
Automatic merge from submit-queue

Delete redundant if condition

The case `containerStatus == nil` has already been checked just above. It's redundant here.
2016-07-19 10:41:04 -07:00
Euan Kemp 13dca52f3c kubelet: Log new pod ips 2016-07-19 09:09:00 -07:00
k8s-merge-robot 0bfaae16a0 Merge pull request #29118 from xiangpengzhao/fix_reversed_var_order
Automatic merge from submit-queue

Fix reversed order of variables

The order of variables in log is reversed.
2016-07-19 02:52:25 -07:00
Euan Kemp fec83a9e28 docker_manager: Correct determineContainerIP args
This could result in the network plugin not retrieving the pod ip in a
call to SyncPod when using the `exec` network plugin.
The CNI and kubenet network plugins ignore the name/namespace arguments,
so they are not impacted by this bug.

I verified the second included test failed prior to correcting the
argument order.

Fixes #29161
2016-07-18 23:29:27 -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
xiangpengzhao 2d7dbc2271 Fix wrong error variable 2016-07-18 22:54:05 -04:00
xiangpengzhao ca823097d2 Delete redundant if condition 2016-07-18 22:11:06 -04:00
xiangpengzhao 48b5a5825a Fix reversed order of variables 2016-07-18 08:06:54 -04: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
Michael Taufen 9393bd0fa6 Fix unit test build errors
These tests can just use the empty string for the PodInfraContainerImage.
2016-07-14 18:40:11 -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
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
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 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
Paul Morie 5ca51e4047 Remove unnecessary calls to api.GetReference 2016-07-08 16:53:33 -04:00
Ron Lai 0a651402f2 - Added a DeleteContainer method in Runtime interface
- Implemented DeleteContainer for docker
2016-07-08 10:40:30 -07:00
k8s-merge-robot 9470bfd692 Merge pull request #28240 from Random-Liu/add-semver-back
Automatic merge from submit-queue

Kubelet: Add the docker semver back.

Fixes #28221.
This PR:
1) Add the semver back https://github.com/kubernetes/kubernetes/pull/20020
2) Remove the code in https://github.com/kubernetes/kubernetes/pull/20827, because docker 1.8 is not officially supported now, and we want to deprecate it. https://github.com/kubernetes/kubernetes/pull/27208
3) Add a test for docker version comparison.

XRef https://github.com/kubernetes/kubernetes/pull/28223

@yujuhong 
/cc @ingvagabund 

[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()
2016-06-30 23:20:56 -07:00
David McMahon ef0c9f0c5b Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
Random Liu 7f6d9b3bc6 Add the semver back. 2016-06-29 14:35:12 -07:00
Dr. Stefan Schimanski 186c6b29c1 Use : as seccomp security option operator for Docker 1.10 2016-06-28 16:44:48 +02:00
k8s-merge-robot 6f8a0c61c1 Merge pull request #27208 from yujuhong/min_docker_version
Automatic merge from submit-queue

Bump minimum API version for docker to 1.21

The corresponding docker version is 1.9.x. Dropping support for docker 1.8.

/cc @kubernetes/sig-node
2016-06-24 17:24:19 -07:00
k8s-merge-robot c4aa7ee0b2 Merge pull request #25024 from xiangpengzhao/fix_typos
Automatic merge from submit-queue

Fix typos in docker.go

Fix minor typos in variable name
2016-06-24 13:56:22 -07:00
Yu-Ju Hong 07b8c61274 Bump minimum API version for docker to 1.21
The corresponding docker version is 1.9.x. Dropping support for docker 1.8.
2016-06-23 10:21:54 -07:00
Dan Williams a657d0587b kubelet/kubenet: Fix getRunningPods() to support rkt pods
Don't assume there's an infra container.
2016-06-22 13:45:13 -05:00
Dan Williams 9865ac325c kubelet/cni: make cni plugin runtime agnostic
Use the generic runtime method to get the netns path.  Also
move reading the container IP address into cni (based off kubenet)
instead of having it in the Docker manager code.  Both old and new
methods use nsenter and /sbin/ip and should be functionally
equivalent.
2016-06-22 11:36:10 -05:00
Tim St. Clair f2f3caf744 Rename **/manager.go 2016-06-21 15:11:31 -07:00
k8s-merge-robot ee35555cb6 Merge pull request #27570 from Random-Liu/add-runtime-request-timeout-flag
Automatic merge from submit-queue

Add runtime-request-timeout kubelet flag.

XRef #23563.

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

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

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

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

[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()
2016-06-21 01:26:54 -07:00
k8s-merge-robot 7ee4189cf6 Merge pull request #27036 from sttts/sttts-secure-seccomp-path
Automatic merge from submit-queue

Filter seccomp profile path from malicious .. and /

Without this patch with `localhost/<some-releative-path>` as seccomp profile one can load any file on the host, e.g. `localhost/../../../../dev/mem` which is not healthy for the kubelet.

/cc @jfrazelle 

Unit tests depend on https://github.com/kubernetes/kubernetes/pull/26710.
2016-06-18 15:58:07 -07:00
Random-Liu 52ebd4ecf1 Add runtime-request-timeout kubelet flag. 2016-06-17 18:18:41 -07:00
k8s-merge-robot 04fd079d09 Merge pull request #27597 from dchen1107/kubectl
Automatic merge from submit-queue

No timeout for kubectl logs

Fix #27588

cc/ @smarterclayton
2016-06-17 17:48:15 -07:00
Dawn Chen 8f5cadeae9 No timeout for kubectl logs 2016-06-16 20:36:59 -07:00
Yu-Ju Hong f279e36292 Don't remove all containers of deleted pods until sources are ready
Without this fix, kubelet may assume a pod from a not-ready source has already
been deleted, and GC all its dead containers.
2016-06-16 10:47:12 -07:00
Dr. Stefan Schimanski 3826d2598c Move seccomp annotation validation into api/validation 2016-06-14 14:58:32 +02:00
Dr. Stefan Schimanski 04dc6dbf17 Add profile unit tests 2016-06-13 14:39:09 +02:00
Dr. Stefan Schimanski 6c54ceb0e4 Filter seccomp profile path from malicious .. and / 2016-06-13 14:39:09 +02:00
Xiangpeng Zhao 33039c2883 Fix typos in docker.go 2016-06-13 03:01:29 -04:00
k8s-merge-robot 5d6397e9ee Merge pull request #27017 from yujuhong/rm_version
Automatic merge from submit-queue

Fix docker api version in kubelet

There are two variables `dockerv110APIVersion` and `dockerV110APIVersion` with
the same purpose, but different values. Remove the incorrect one and fix usage
in the file.

/cc @dchen1107 @Random-Liu
2016-06-12 19:31:06 -07:00
k8s-merge-robot 911e84ed1e Merge pull request #26710 from sttts/sttts-fix-seccomp-annotations
Automatic merge from submit-queue

Move /seccomp/ into domain prefix in seccomp annotations

Fixes #26610.

/cc @mdshuai @ncdc @jfrazelle
2016-06-11 07:03:50 -07:00
k8s-merge-robot e54ebe5ebd Merge pull request #27132 from freehan/kubenetmasq
Automatic merge from submit-queue

turn off cni masqurade and manage it in kubenet

fixes #27110
2016-06-09 20:44:13 -07:00
Minhan Xia 1276a91638 kubenet masqurade for outbound traffic 2016-06-09 18:43:34 -07:00
Paul Morie 0a0797a680 Reduce log spam in dockertools manager.go 2016-06-08 12:41:37 -04:00
Yu-Ju Hong 8866a894e4 Fix docker api version in kubelet
There are two variables `dockerv110APIVersion` and `dockerV110APIVersion` with
the same purpose, but different values. Remove the incorrect one and fix usage
in the file.
2016-06-07 17:51:36 -07:00
Dr. Stefan Schimanski 12346d5171 Fix seccomp prefix check 2016-06-06 14:08:17 +02:00
Dr. Stefan Schimanski ad6bd78007 Move /seccomp/ into domain prefix in seccomp annotations
Double slashes are not allowed in annotation keys. Moreover, using the 63
characters of the name component in an annotation key will shorted the space
for the container name.
2016-06-06 14:08:17 +02:00
Random-Liu 49c8683c24 Add timeout for image pulling 2016-06-02 10:49:17 -07:00
k8s-merge-robot 77de942e08 Merge pull request #26451 from Random-Liu/cache_image_history
Automatic merge from submit-queue

Kubelet: Cache image history to eliminate the performance regression

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

The image history operation takes almost 50% of cpu usage in kubelet performance test. We should cache image history instead of getting it from runtime everytime.

This PR cached image history in imageStatsProvider and added unit test.

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

Mark v1.3 because this is a relatively significant performance regression.

[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()
2016-05-29 20:49:01 -07:00
k8s-merge-robot 344f26ae69 Merge pull request #26145 from Random-Liu/image-pulling-progress
Automatic merge from submit-queue

Kubelet: Periodically reporting image pulling progress in log

Addresses https://github.com/kubernetes/kubernetes/issues/26075#issuecomment-221129896 and https://github.com/kubernetes/kubernetes/pull/26122#issuecomment-221128397.

This PR changes kube_docker_client to log pulling progress every *10* seconds. We can't print all progress messages into the log, because there are too many. So I make it report newest progress every 10 seconds to reduce log spam.
If the image pulling is too slow or stuck, we'll see image pulling progress unchanged or changed little overtime.

The following is the result if I set the reporting interval to *1* second.
```
I0524 00:53:26.189086  145099 kube_docker_client.go:252] Pulling image "ubuntu:latest": "17b6a9e179d7: Pulling fs layer "
I0524 00:53:27.189082  145099 kube_docker_client.go:252] Pulling image "ubuntu:latest": "202e40f8bb3a: Download complete "
I0524 00:53:28.189160  145099 kube_docker_client.go:252] Pulling image "ubuntu:latest": "487bffc61de6: Downloading [=>                                                 ] 1.474 MB/48.35 MB"
I0524 00:53:29.189156  145099 kube_docker_client.go:252] Pulling image "ubuntu:latest": "487bffc61de6: Downloading [====>                                              ] 3.931 MB/48.35 MB"
I0524 00:53:30.189089  145099 kube_docker_client.go:252] Pulling image "ubuntu:latest": "487bffc61de6: Downloading [=========>                                         ] 8.847 MB/48.35 MB"
I0524 00:53:31.189089  145099 kube_docker_client.go:252] Pulling image "ubuntu:latest": "487bffc61de6: Downloading [==================>                                ] 18.19 MB/48.35 MB"
I0524 00:53:32.189076  145099 kube_docker_client.go:252] Pulling image "ubuntu:latest": "487bffc61de6: Downloading [=======================================>           ] 38.34 MB/48.35 MB"
I0524 00:53:33.189106  145099 kube_docker_client.go:252] Pulling image "ubuntu:latest": "487bffc61de6: Extracting [=============>                                     ] 12.78 MB/48.35 MB"
I0524 00:53:34.189067  145099 kube_docker_client.go:252] Pulling image "ubuntu:latest": "487bffc61de6: Extracting [==================================>                ] 33.42 MB/48.35 MB"
I0524 00:53:35.189083  145099 kube_docker_client.go:252] Pulling image "ubuntu:latest": "487bffc61de6: Extracting [==================================================>] 48.35 MB/48.35 MB"
I0524 00:53:35.376667  145099 kube_docker_client.go:254] Finish pulling image "ubuntu:latest": "Status: Downloaded newer image for ubuntu:latest"
```

Ref image pulling related issue #19077.

[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()

@yujuhong @dchen1107 
/cc @kubernetes/sig-node
2016-05-28 13:34:28 -07:00
Random-Liu 52a3d8a19d Add unit test for image history cache 2016-05-27 14:49:48 -07:00
Random-Liu 56bde2df9f Cache image history 2016-05-27 14:49:48 -07:00
Alex Robinson 789b69758e Merge pull request #25688 from sjpotter/rkt_annotations
kubelet: Move common labels out of dockertools package
2016-05-27 11:26:31 -07:00
Alex Mohr 5b1653ec39 Merge pull request #25681 from vishh/lifecycle-probe-logs
Log output of lifecycle hooks on failure
2016-05-26 12:37:02 -07:00
Alex Mohr 4357b8a0a6 Merge pull request #25324 from jfrazelle/add-seccomp
Add Seccomp to Annotations
2016-05-26 10:50:06 -07:00
Shaya Potter 9dd9f2ad65 move common lables used outside of containr runtime out of dockertools
moved labels and their Get functions to types

aliases kubernetes/types import to kubetypes to use kubelet/types as types
2016-05-25 23:10:19 -07:00
k8s-merge-robot f4122477c2 Merge pull request #25712 from asalkeld/docker-logpath
Automatic merge from submit-queue

Use docker containerInfo.LogPath and not manually constructed path

## Pull Request Guidelines

Since the containerInfo has the LogPath in it, let's use that and
not manually construct the path ourselves. This also makes the code
less prone to breaking if docker change this path.

Fixes #23695
2016-05-25 17:57:59 -07:00
k8s-merge-robot 69b90028cf Merge pull request #26086 from smarterclayton/init_ordering
Automatic merge from submit-queue

Ensure that init containers are preserved during pruning

Pods with multiple init containers were getting the wrong containers
pruned. Fix an error message and add a test.

Fixes #26131
2016-05-25 15:38:39 -07:00
Jess Frazelle aa8c72adaa
seccomp: add annotations and test for docker runtime
Signed-off-by: Jess Frazelle <me@jessfraz.com>
2016-05-24 12:25:21 -07:00
Vishnu kannan e7721ea8cf Expose errors from libecycle hooks as events for the pod.
Signed-off-by: Vishnu kannan <vishnuk@google.com>
2016-05-24 11:12:53 -07:00
Clayton Coleman 223542690a
Ensure that init containers are preserved during pruning
Pods with multiple init containers were getting the wrong containers
pruned. Fix an error message and add a test.
2016-05-24 14:05:55 -04:00
Random-Liu 151d0ab0c1 Periodically reporing image pulling progress in log 2016-05-24 09:58:36 -07:00
Yu-Ju Hong 77dba962db docker: don't set timeout for image pulling requests 2016-05-23 16:17:49 -07:00
Angus Salkeld 2970f2220f Use docker containerInfo.LogPath and not manually constructed path
Since the containerInfo has the LogPath in it, let's use that and
not manually construct the path ourselves. This also makes the code
less prone to breaking if docker change this path.

Fixes #23695
2016-05-23 10:25:37 +10:00
k8s-merge-robot 423a4154be Merge pull request #25062 from dcbw/kubenet-rkt
Automatic merge from submit-queue

Hook rkt kubelet runtime up to network plugins
2016-05-21 00:45:19 -07:00
Vishnu kannan f884180deb Update kubelet to use per-pod QoS policy.
Signed-off-by: Vishnu kannan <vishnuk@google.com>
2016-05-20 11:52:17 -07:00
k8s-merge-robot 4ea034c284 Merge pull request #25896 from yujuhong/inspect_error
Automatic merge from submit-queue

kubelet: Don't attempt to apply the oom score if container exited already

Containers could terminate before kubelet applies the oom score. This is normal
and the function should not error out.

This addresses #25844 partially.

/cc @smarterclayton @Random-Liu
2016-05-20 06:22:57 -07:00
Yu-Ju Hong b57fbee557 check pid in oomscoreadj 2016-05-19 12:21:27 -07:00
Yu-Ju Hong e3e1c7a6a1 kubelet: Don't attempt to apply the oom score if the container is not running
Containers could terminate before kubelet applies the oom score. This is normal
and the function should not error out.
2016-05-19 11:32:36 -07:00
Clayton Coleman 5e4308f91d
Update use of Quantity in other classes 2016-05-19 08:41:43 -04:00
Dan Williams 55e6eb2ce3 Allow using netns path instead of container PID to change hairpin mode 2016-05-18 09:25:42 -05:00
Clayton Coleman 205a8b4574
Add init container loading to the kubelet 2016-05-17 00:29:53 -04:00
k8s-merge-robot 59b7b1c550 Merge pull request #24921 from feiskyer/merge-exec
Automatic merge from submit-queue

Remove RunInContainer interface in Kubelet Runtime interface

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

@yujuhong  @kubernetes/sig-node
2016-05-15 02:58:15 -07:00
Yifan Gu 9d5bcf4251 rkt: Add tests for GarbageCollect(). 2016-05-13 15:13:52 -07:00
Jeff Lowdermilk 1fe0e0778f Merge pull request #24080 from tyangliu/fix-infra-network-cfg
Pass dockerOpts by reference to setInfraContainerNetworkConfig
2016-05-13 09:53:39 -07:00
k8s-merge-robot bb3f5b1768 Merge pull request #23090 from tgraf/ipv6
Automatic merge from submit-queue

Add IPv6 address support for pods - does NOT include services

This allows a container to have an IPv6 address only and extracts the address via nsenter and iproute2 or the docker client directly. An IPv6 address is now correctly reported when describing a pod.

@thockin @kubernetes/sig-network

<!-- 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/23090)
<!-- Reviewable:end -->
2016-05-13 06:32:00 -07:00
Saad Ali 25f37007aa Merge pull request #24846 from pmorie/kubelet-test-loc
Reduce LOC in kubelet tests
2016-05-12 15:52:27 -07:00
k8s-merge-robot 08440b5dcc Merge pull request #24836 from Clarifai/gpu-impl
Automatic merge from submit-queue

WIP v0 NVIDIA GPU support

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

Implements part of #24071 for  #23587

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

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

cc @erictune @davidopp @dchen1107 @vishh @Hui-Zhi @gopinatht
2016-05-12 14:04:15 -07:00
Dan Williams b749902b42 kubenet: set bridge promiscuous mode based on hairpinMode
Closes: https://github.com/kubernetes/kubernetes/issues/23657
Closes: https://github.com/kubernetes/kubernetes/issues/20475
2016-05-12 10:02:33 -05:00
k8s-merge-robot c4214f743f Merge pull request #24918 from Random-Liu/add-docker-operation-timeout
Automatic merge from submit-queue

Kubelet: Add docker operation timeout

For #23563.
Based on #24748, only the last 2 commits are new.

This PR:
1) Add timeout for all docker operations.
2) Add docker operation timeout metrics
3) Cleanup kubelet stats and add runtime operation error and timeout rate monitoring.
4) Monitor runtime operation error and timeout rate in kubelet perf.

@yujuhong 
/cc @gmarek Because of the metrics change.
/cc @kubernetes/sig-node
2016-05-09 21:51:52 -07:00
Rudi Chiarito 362c763fca WIP v0 NVIDIA GPU support
Implements part of #24071

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

Missing items from the implementation plan: limitranger, rkt support, kubectl
support and user docs
2016-05-09 19:20:05 -04:00
k8s-merge-robot fe135fc251 Merge pull request #24630 from euank/redundant-created
Automatic merge from submit-queue

kubelet: Remove redundant `Container.Created`

As far as I can tell, this has been supplanted by a) the `DockerJSON.CreatedAt` field and b) the
`ContainerStatus.CreatedAt`, where the first is used for creating the
second.

The `.Created` field was only written to as far as I can see.

cc @yifan-gu & @Random-Liu 

Is there any reason we might want to keep this around?
2016-05-08 16:21:05 -07:00
Thomas Liu 019efef8f4 Pass dockerOpts by reference to setInfraContainerNetworkConfig 2016-05-07 14:06:06 -07:00
Andy Goldstein f091ea5eda Handle image digests in node status and image GC
Start including Docker image digests in the node status and consider image digests during image
garbage collection.
2016-05-07 06:50:51 -04:00
Robert Bailey a2d8b0af13 Merge pull request #25027 from xiangpengzhao/fix_funcname
Rename a func in manager.go
2016-05-06 20:41:26 -07:00
Random-Liu 148588e6a1 1) Add docker operation timeout metrics.
2) Cleanup kubelet stats and add runtime operation error and timeout
rate monitoring.
3) Monitor runtime operation error and timeout rate in
kubelet perf.
2016-05-06 10:53:13 -07:00
Random-Liu 66678354a0 Add timeout for all docker operation. 2016-05-06 10:53:13 -07:00
derekwaynecarr 7bab6999d4 Allow KillPod to take a gracePeriodOverride 2016-05-06 12:14:43 -04:00
k8s-merge-robot 346ddc52c2 Merge pull request #24748 from Random-Liu/cleanup-with-new-engine-api
Automatic merge from submit-queue

Kubelet: Cleanup with new engine api

Finish step 2 of #23563

This PR:
1) Cleanup go-dockerclient reference in the code.
2) Bump up the engine-api version.
3) Cleanup the code with new engine-api.

Fixes #24076.
Fixes #23809.

/cc @yujuhong
2016-05-06 03:16:53 -07:00
Minhan Xia 04b80f7fb8 rename Status interface to GetPodNetworkStatus 2016-05-04 13:46:31 -07:00
Paul Morie d1e0e726f2 Reduce LOC in kubelet tests 2016-05-03 22:45:08 -04:00
Xiangpeng Zhao d27127aaf8 Rename a func in order to be difference with variable
Rename `defaultSecurityOpt` to `getDefaultSecurityOpt`
2016-05-02 03:02:49 +08:00
feisky 831203c19b Remove RunInContainer interface in Kuberlete Runtime interface 2016-05-01 20:21:15 +08:00
Random-Liu 7796b619fd Cleanup the code with new engine-api 2016-04-29 13:34:38 -07:00
Random-Liu 3876972d3f Clean up go-dockerclient reference. 2016-04-29 13:32:19 -07:00
k8s-merge-robot ad67363c12 Merge pull request #24362 from ArtfulCoder/hostname-field
Automatic merge from submit-queue

Promote Pod Hostname & Subdomain to fields (were annotations)

Deprecating the podHostName, subdomain and PodHostnames annotations and created corresponding new fields for them on PodSpec and Endpoints types.

Annotation doc: #22564
Annotation code: #20688
2016-04-29 01:06:45 -07:00
Abhishek Shah 8a3ed48808 Added Hostname and Subdomain field to Pod.Spec 2016-04-28 10:56:56 -07:00
k8s-merge-robot 04b70bc6c7 Merge pull request #24376 from resouer/fix-cache
Automatic merge from submit-queue

Do not update cache with so much effort

Fixes: #24298
1. Remove automatic update
2. Every time we check if we can get valid value from cache, if not, get the value directly from api

cc @Random-Liu
2016-04-28 01:00:33 -07:00
Harry Zhang d6f26b68bc Use expiration cache for version check 2016-04-27 05:42:50 -04:00
k8s-merge-robot 55cb7cceb3 Merge pull request #23632 from stefwalter/parse-repository-tag-removed
Automatic merge from submit-queue

Fix use of docker removed ParseRepositoryTag() function

Docker has removed the ParseRepositoryTag() function in
leading to failures using the kubernetes Go client API.

Failure:

```
../k8s.io/kubernetes/pkg/util/parsers/parsers.go:30: undefined: parsers.ParseRepositoryTag
```
2016-04-26 09:49:25 -07:00
Vishnu kannan e566948a75 Track image storage usage for docker containers
add image fs info to summary stats API.
Adding node e2e test for image stats.

Signed-off-by: Vishnu kannan <vishnuk@google.com>
2016-04-25 16:00:34 -07:00
Euan Kemp 7d34b0b09d kubelet: Remove redundant `Container.Created`
This has been supplanted by a) the DockerJSON.CreatedAt field and b) the
ContainerStatus.CreatedAt, where the first is used for creating the
second.

The `.Created` field was only written to as far as I can see.
2016-04-25 12:19:24 -07:00
Stef Walter 481dbca8bc Fix use of docker removed ParseRepositoryTag() function
Docker has removed the ParseRepositoryTag() function in
leading to failures using the kubernetes Go client API.

Lets use github.com/docker/distribution reference.ParseNamed()
instead.

Failure:

../k8s.io/kubernetes/pkg/util/parsers/parsers.go:30: undefined: parsers.ParseRepositoryTag
2016-04-25 11:37:10 +02:00
k8s-merge-robot 4f9e8729bf Merge pull request #23800 from resouer/image-refactor
Automatic merge from submit-queue

Refactor image related functions to use docker engine-api

ref #23563 

Hopes can do some help, cc @Random-Liu 

If it's ok, will add more work here.
2016-04-23 20:01:41 -07:00
Harry Zhang a3939473d3 Refactor PullImage RemoveImage methods
Refactor image remove
2016-04-23 10:33:47 -04:00
Harry Zhang 3918eee5bf Refactor InspectImage method 2016-04-23 16:37:15 +08:00
Harry Zhang 7ecb44fe16 Refactor list image to use new api 2016-04-23 16:37:15 +08:00
Euan Kemp a6718f5969 rkt: Implement pod `FinishedAt`
This is implemented via touching a file on stop as a hook in the systemd
unit. The ctime of this file is then used to get the `finishedAt` time
in the future.
In addition, this changes the `startedAt` and `createdAt` to use the api
server's results rather than the annotations it previously used.

It's possible we might want to move this into the api in the future.

Fixes #23887
2016-04-22 15:34:55 -07:00
k8s-merge-robot 06c2db4fe2 Merge pull request #23907 from Random-Liu/all-but-image-related-functions
Automatic merge from submit-queue

Kubelet: Refactor all but image related functions in DockerInterface

For #23563.
Based on #23699 and #23844.

Only last 3 commits are new. This PR refactored all functions except image related functions, including:
* CreateExec
* StartExec
* InspectExec
* AttachToContainer
* Logs
* Info
* Version

@kubernetes/sig-node
2016-04-21 20:57:38 -07:00
Random-Liu d981fee2ee Refactor Info and Version. 2016-04-21 12:02:50 -07:00
derekwaynecarr cbf1cb81a9 SHM size must be greater than 0 2016-04-21 11:45:28 -04:00
Minhan Xia a7783e5334 add log line before invoking network plugin 2016-04-19 15:34:06 -07:00
k8s-merge-robot d37e6ad332 Merge pull request #24126 from Random-Liu/fix-pull-image
Automatic merge from submit-queue

Fix PullImage and add corresponding node e2e test

Fixes #24101. This is a bug introduced by #23506, since ref #23563.

The root cause of #24101 is described [here](https://github.com/kubernetes/kubernetes/issues/24101#issuecomment-208547623).

This PR
1) Fixes #24101 by decoding the messages returned during pulling image, and return error if any of the messages contains error.
2) Add the node e2e test to detect this kind of failure.
3) Get present check out of `ConformanceImage.Remove()` and `ConformanceImage.Pull()`. Because sometimes we may expect error to occur in `PullImage()` and `RemoveImage()`, but even that doesn't happen, the `Present()` check will still return error and let the test pass.

@yujuhong @freehan @liangchenye 

Also /cc @resouer, because he is doing the image related functions refactoring.
2016-04-18 07:05:44 -07:00
Random-Liu d33b69a0de Refactor AttachToContainer and Logs. 2016-04-17 13:00:52 -07:00
Random-Liu de5f407058 Refactor CreateExec, StartExec and InspectExec. 2016-04-17 12:58:47 -07:00
Wojciech Tyczynski 495e274500 Merge pull request #24384 from Random-Liu/disable-version-cache
Disable the version cache to fix #24298.
2016-04-17 04:48:07 -07:00
Random-Liu 19249a8cbc Disable the version cache to fix #24298. 2016-04-17 03:14:03 -07:00
k8s-merge-robot 8990897ce6 Merge pull request #23940 from freehan/netinterface
Automatic merge from submit-queue

switch to use ContainerID instead of DockerID in network plugin interface

fix: #15663
2016-04-17 01:12:51 -07:00
k8s-merge-robot 2e87b0e363 Merge pull request #23699 from Random-Liu/container-related-functions
Automatic merge from submit-queue

Kubelet: Refactor container related functions in DockerInterface

For #23563.
Based on #23506, will rebase after #23506 is merged.

The last 4 commits of this PR are new.
This PR refactors all container lifecycle related functions in DockerInterface, including:
* ListContainers
* InspectContainer
* CreateContainer
* StartContainer
* StopContainer
* RemoveContainer

@kubernetes/sig-node
2016-04-16 21:41:19 -07:00
k8s-merge-robot 61c0424b27 Merge pull request #24301 from yifan-gu/host_net
Automatic merge from submit-queue

rkt: Fix hostnetwork.

Mount hosts' /etc/hosts, /etc/resolv.conf, set host's hostname
when running the pod in the host's network.

Fix #24235 

cc @kubernetes/sig-node
2016-04-15 13:59:27 -07:00
k8s-merge-robot 8f3c623287 Merge pull request #23594 from Clarifai/ecr
Automatic merge from submit-queue

Allow lazy binding in credential providers; don't use it in AWS yet

This is step one for cross-region ECR support and has no visible effects yet.
I'm not crazy about the name LazyProvide. Perhaps the interface method could
remain like that and the package method of the same name could become
LateBind(). I still don't understand why the credential provider has a
DockerConfigEntry that has the same fields but is distinct from
docker.AuthConfiguration. I had to write a converter now that we do that in
more than one place.

In step two, I'll add another intermediate, lazy provider for each AWS region,
whose empty LazyAuthConfiguration will have a refresh time of months or years.
Behind the scenes, it'll use an actual ecrProvider with the usual ~12 hour
credentials, that will get created (and later refreshed) only when kubelet is
attempting to pull an image. If we simply turned ecrProvider directly into a
lazy provider, we would bypass all the caching and get new credentials for
each image pulled.
2016-04-14 23:42:07 -07:00
Yifan Gu dfb6dd010f rkt: Fix hostnetwork.
Mount hosts' /etc/hosts, /etc/resolv.conf, set host's hostname
when running the pod in the host's network.

Besides, do not set the DNS flags when running in host's network.
2016-04-14 18:44:09 -07:00
Random-Liu d3d98b372b Refactor StartContainer, StopContainer and RemoveContainer. 2016-04-14 17:05:46 -07:00
Random-Liu ba4a5ed39e Refactor CreateContainer. 2016-04-14 17:05:46 -07:00
Random-Liu da07fa9dd5 Refactor InspectContainer. 2016-04-14 17:05:46 -07:00
Random-Liu b348e7d1c9 Refactr ListContainers. 2016-04-14 17:05:05 -07:00
Daniel Smith 86b7dbb2c6 Merge pull request #23844 from Random-Liu/proper-fake-docker-version
Set fake docker client to minimum required version.
2016-04-14 16:55:47 -07:00
Harry Zhang c31ec5607a Refactor version cache into kubelet util 2016-04-13 00:42:22 -04:00
harry f9e2f522b4 Add cache for api version
Expose runtime interface
2016-04-12 22:34:59 -04:00
Harry Zhang b4244a079f Implement OomScoreAdj in kubelet 2016-04-12 22:34:58 -04:00
Random-Liu 2b9f6bea18 Fix PullImage and corresponding node e2e test. 2016-04-12 10:42:25 -07:00
k8s-merge-robot 6a87dba0b8 Merge pull request #22733 from resouer/flow-control
Automatic merge from submit-queue

Add flow control pkg

minor fix ref #15634
Refactor pkg names in back off related files
2016-04-11 06:18:51 -07:00
Jeff Lowdermilk 1a9cb97bdd Merge pull request #23658 from Random-Liu/fix-termination-message-path
Fix TerminationMessagePath
2016-04-08 20:54:14 -07:00
Minhan Xia 3c58d1ffd3 switch to use ContainerID instead of DockerID in network plugin interface 2016-04-06 16:04:52 -07:00
Random-Liu 8fb7ee38b0 Set fake docker client to minimum required version. 2016-04-04 17:41:01 -07:00
k8s-merge-robot a2145d7b1c Merge pull request #23613 from Random-Liu/remove-out-of-date-code
Automatic merge from submit-queue

Kubelet: Remove nsinit related code and bump up minimum docker apiversion

Docker has native exec support after 1.3.x. We never need this code now.

As for the apiversion, because Kubernetes supports 1.8.x - 1.10.x now, we should bump up the minimum docker apiversion.
@yujuhong I checked the [changes](https://github.com/docker/engine-api/blob/master/types/versions/v1p20/types.go), we are not relying on any of those changes. So #23506 should work with docker 1.8.x+
2016-04-03 07:34:26 -07:00