Commit Graph

181 Commits (996200b71ecb42fa4eb949662b88f86f08e87395)

Author SHA1 Message Date
Kubernetes Submit Queue 07f78836ea Merge pull request #35969 from sttts/sttts-dockershim-infra-sysctl-only
Automatic merge from submit-queue

Only set sysctls in infra container in dockershim

Dockershim counterpart of https://github.com/kubernetes/kubernetes/pull/32383.
2016-11-01 23:52:06 -07:00
Kubernetes Submit Queue bef915da9d Merge pull request #35930 from Random-Liu/handle-empty-container-name
Automatic merge from submit-queue

CRI: Handle empty container name in dockershim.

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

Dead container may have no name, we should handle this properly.

@yujuhong @bprashanth
2016-11-01 21:59:38 -07:00
Yu-Ju Hong 8a6285d844 CRI: Rename container/sandbox states
The enum constants are not namespaced. The shorter, unspecifc names are likely
to cause naming conflicts in the future.

Also replace "SandBox" with "Sandbox" in the API.
2016-11-01 13:18:21 -07:00
Yu-Ju Hong 87aaf4c0ac dockershim: move docker to the given cgruop
This change add a container manager inside the dockershim to move docker daemon
and associated processes to a specified cgroup. The original kubelet container
manager will continue checking the name of the cgroup, so that kubelet know how
to report runtime stats.
2016-11-01 11:39:20 -07:00
Dr. Stefan Schimanski 42f6179517 dockershim: only set sysctl in infra container 2016-11-01 13:21:47 +01:00
Random-Liu ecd1044200 Handle empty container name in dockershim. 2016-10-31 15:05:23 -07:00
bprashanth 11638e9ee1 Unittests 2016-10-31 13:05:20 -07:00
bprashanth 706207904e SetUp/TearDown I: dockershim 2016-10-31 13:05:19 -07:00
bprashanth 48db726342 Split network.Host into LegacyHost and NamespaceGetter 2016-10-31 13:05:19 -07:00
bprashanth 9c585baf1f Teach cri about podCIDR 2016-10-31 13:05:18 -07:00
bprashanth c11aa2eb77 Teach dockershim to probe for network plugins 2016-10-31 13:05:13 -07:00
Tim St. Clair c60db99536
Implement streaming CRI methods in dockershim 2016-10-28 11:15:53 -07:00
Kubernetes Submit Queue c9953ae0ed Merge pull request #34830 from feiskyer/sysctl
Automatic merge from submit-queue

Add sysctls for dockershim

This PR adds sysctls support for dockershim. All sysctls e2e tests are passed in my local settings.

Note that sysctls runtimeAdmit is not included in this PR, it is addressed in #32803.

cc/ @yujuhong @Random-Liu
2016-10-26 19:09:03 -07:00
Random-Liu 46916bc58b Update bazel. 2016-10-25 10:57:46 -07:00
Random-Liu 3d549b9e25 Add dockershim grpc server. 2016-10-25 10:31:16 -07:00
Pengfei Ni fee6daaa8d Add sysctls for dockershim 2016-10-25 11:24:31 +08:00
Kubernetes Submit Queue 8923087b52 Merge pull request #31558 from MHBauer/match-raw-term-setting
Automatic merge from submit-queue

Use the rawTerminal setting from the container itself

**What this PR does / why we need it**:
Checks whether the container is set for rawTerminal connection and uses the appropriate connection.
Prevents the output `Error from server: Unrecognized input header` when doing `kubectl run`.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, #<issue_number>, ...)` format, will close that issue when PR gets merged)*: 
helps with case 1 in #28695, resolves #30159

**Special notes for your reviewer**:

**Release note**:
```
release-note-none
```
2016-10-24 18:55:14 -07:00
Mike Danese 763c4987f2 autogenerated 2016-10-24 14:47:27 -07:00
Random-Liu 121a91eb12 Symlink docker logs to CRI defined log path. 2016-10-23 19:08:47 -07:00
Mike Danese 3b6a067afc autogenerated 2016-10-21 17:32:32 -07:00
Morgan Bauer a53990fd59
Use the rawTerminal setting from the container itself 2016-10-21 08:15:39 -07:00
Yu-Ju Hong fee4c9a7d9 Return empty network namespace if the infra container has exited
If the infra container has already terminated, `docker inspect` will report
pid 0. The path constructed using the pid to check the network namespace of
the process will be invalid. This commit changes docker to report an empty
path to stop kubenet from erroring out whenever TearDown is called on an
exited infra container.

This is not a fix for all the plugins, as some plugins may require the actual
network namespace to tear down properly.
2016-10-20 17:12:08 -07:00
Kubernetes Submit Queue e5cdc95b85 Merge pull request #34767 from ivan4th/fix-more-typos-1
Automatic merge from submit-queue

Fix typos
2016-10-14 23:30:23 -07:00
Ivan Shvedunov f1258dca4e Fix typos 2016-10-15 00:21:00 +03:00
Kubernetes Submit Queue d7c0eb322c Merge pull request #34276 from freehan/cri-runtime-config
Automatic merge from submit-queue

add UpdateRuntimeConfig interface

Expose UpdateRuntimeConfig interface in RuntimeService for kubelet to pass a set of configurations to runtime. Currently it only takes PodCIDR.

The use case is for kubelet to pass configs to runtime. Kubelet holds some config/information which runtime does not have, such as PodCIDR. I expect some of kubelet configurations will gradually move to runtime, but I believe cases like PodCIDR, which dynamically assigned by k8s master, need to stay for a while.
2016-10-13 23:10:42 -07:00
Minhan Xia 480bcb9760 add UpdateRuntimeConfig interface 2016-10-12 22:33:58 -07:00
Kubernetes Submit Queue b99a9094cc Merge pull request #34380 from Random-Liu/fix-cri-image
Automatic merge from submit-queue

CRI: Image pullable support in dockershim

For #33189.

The new test `ImageID should be set to the manifest digest (from RepoDigests) when available` introduced in #33014 is failing, because:
1) `docker-pullable://` conversion is not supported in dockershim;
2) `kuberuntime` and `dockershim` is using `ListImages with image name filter` to check whether image presents. However, `ListImages` doesn't support filter with `digest`.

This PR:
1) Change `kuberuntime.IsImagePresent` to use `runtime.ImageStatus` and `dockershim.InspectImage` instead. ***Notice an API change: `ImageStatus` should return `(nil, nil)` for non-existing image.***
2) Add `docker-pullable://` support.
3) Fix `RemoveImage` in dockershim https://github.com/kubernetes/kubernetes/pull/29316.

I've tried myself, the test can pass now.

@yujuhong @feiskyer @yifan-gu 
/cc @kubernetes/sig-node
2016-10-12 12:25:37 -07:00
Random-Liu afa3414779 * Add docker pullable support.
* Fix inspect image bug.
* Fix remove image bug.
2016-10-12 09:21:10 -07:00
Random-Liu 13459411c1 Change dockershim to use UnixNano instead of Unix. 2016-10-11 14:50:55 -07:00
Random-Liu 76056a47f9 Change the timestamp unit to nanosecond. 2016-10-07 14:10:19 -07:00
Kubernetes Submit Queue 3f4a66f3d6 Merge pull request #33970 from yifan-gu/remove_names
Automatic merge from submit-queue

CRI: Remove the mount name and port name.

Per discussion on https://github.com/kubernetes/kubernetes/issues/33873.

Currently the mount name is not being used and also involves some
incorrect usage (sometimes it's referencing a mount name, sometimes
it's referecing a volume name), so we decide to remove it from CRI.

The port name is also not used, so remove it as well.

Fix #33873
Fix #33526 

/cc @kubernetes/sig-node @kubernetes/sig-rktnetes
2016-10-04 17:08:20 -07:00
Kubernetes Submit Queue 9d270ad5ed Merge pull request #33870 from Random-Liu/summary-api-cri
Automatic merge from submit-queue

CRI: Implement temporary ImageStats in kuberuntime_manager

For #33048 and #33189.

This PR:
1) Implement a temporary `ImageStats` in kuberuntime_manager.go
2) Add container name label on infra container to make the current summary api logic work with dockershim.

I run the summary api test locally and it passed for me. Notice that the original summary api test is not showing up on CRI testgrid because it was removed yesterday. It will be added back in https://github.com/kubernetes/kubernetes/pull/33779.

@yujuhong @feiskyer
2016-10-04 14:15:55 -07:00
Yifan Gu be4e825ac3 CRI: Remove the mount name and port name.
Per discussion on https://github.com/kubernetes/kubernetes/issues/33873.

Currently the mount name is not being used and also involves some
incorrect usage (sometimes it's referencing a mount name, sometimes
it's referecing a volume name), so we decide to remove it from CRI.

The port name is also not used, so remove it as well.
2016-10-04 13:10:59 -07:00
Kubernetes Submit Queue d26b4ca285 Merge pull request #33488 from resouer/infra-image
Automatic merge from submit-queue

CRI: Enable custom infra container image

A minor fix to enable custom infra container image ref #29478 

- Need to address: 
Not sure how do deal with infra image credential, leave it as it is today. Should we allow user to specify credentials in pod yaml?
2016-10-04 11:11:29 -07:00
Kubernetes Submit Queue 3be5706830 Merge pull request #33836 from feiskyer/portforward
Automatic merge from submit-queue

Kubelet: fix port forward for dockershim

This PR fixes port forward for dockershim and also adds a `kubecontainer.FormatPod`.

Locally cluster has passed `--ginkgo.focus=Port\sforwarding'` tests.

cc/ @Random-Liu @yujuhong
2016-10-04 00:55:12 -07:00
Random-Liu c3ce58b934 Implement temporary ImageStats in kuberuntime_manager, and
fix a bug in dockershim which causes summary api not working
properly.
2016-10-03 22:56:25 -07:00
Harry Zhang 29c6a3b572 Enabel custom infracontainer image
Modify api protoc for infra
2016-10-03 23:54:19 -04:00
Kubernetes Submit Queue a241daf3f2 Merge pull request #33500 from Random-Liu/apparmor-seccomp-cri
Automatic merge from submit-queue

Add seccomp and apparmor support.

This PR adds seccomp and apparmor support in new CRI.

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

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

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

@yujuhong @feiskyer @timstclair
2016-10-03 20:34:13 -07:00
Kubernetes Submit Queue c72c21b18f Merge pull request #33889 from Random-Liu/fix-dockershim-sandbox-id-bug
Automatic merge from submit-queue

CRI: Fix bug in dockershim to set sandbox id properly.

For https://github.com/kubernetes/kubernetes/issues/33189#issuecomment-249307796.

During debugging `Variable Expansion should allow composing env vars into new env vars`, I found that the root cause is that the sandbox was removed before all containers were deleted, which caused the pod to be started again after succeed.

This happened because the `PodSandboxID` field is not set. This PR fixes the bug.

Some other test flakes are also caused by this
```
Downward API volume should provide node allocatable (cpu) as default cpu limit if the limit is not set
Downward API volume should provide container's memory limit
EmptyDir volumes should support (non-root,0666,tmpfs)
...
```

/cc @yujuhong @feiskyer
2016-10-03 14:08:07 -07:00
Random-Liu 37273693e5 Fix bug in dockershim to set sandbox id properly. 2016-10-01 20:55:06 -07:00
Kubernetes Submit Queue 4f32cc073b Merge pull request #33233 from yujuhong/default_image_tag
Automatic merge from submit-queue

Apply default image tags for all runtimes

Move the docker-specific logic up to the ImageManager to allow code sharing
among different implementations.

Part of #31459

/cc @kubernetes/sig-node
2016-10-01 04:29:12 -07:00
Pengfei Ni 8e25f938a7 Kubelet: fix port forward for dockershim
Signed-off-by: Pengfei Ni <feiskyer@gmail.com>
2016-10-01 08:06:23 +08:00
Kubernetes Submit Queue e05d568b40 Merge pull request #33810 from feiskyer/portforward
Automatic merge from submit-queue

Fake docker portfoward for in-process docker CRI integration

This is necessary to pass e2e tests for in-process docker CRI integration.

This is part of #31459.

cc/ @Random-Liu @kubernetes/sig-node
2016-09-30 00:52:34 -07:00
Kubernetes Submit Queue a180864173 Merge pull request #33709 from yifan-gu/add_dns_opt
Automatic merge from submit-queue

CRI: Add dns option, rename DNSOption to DNSConfig.

Today, the DNS opt string is hardcoded in multiple places [[1]](https://github.com/kubernetes/kubernetes/blob/v1.5.0-alpha.0/pkg/kubelet/rkt/rkt.go#L117) [[2]](https://github.com/kubernetes/kubernetes/blob/v1.5.0-alpha.0/pkg/kubelet/dockertools/docker_manager.go#L88), we'd probably move the default to kubelet, and pass down to runtimes.

/cc @kubernetes/sig-node @kubernetes/sig-rktnetes @feiskyer @thockin
2016-09-29 22:59:27 -07:00
Pengfei Ni dd14f6368a Fake docker portfoward for in-process docker CRI integration 2016-09-30 11:30:45 +08:00
Random-Liu ab502f32a7 Fix mount issue in dockershim. 2016-09-29 20:13:39 -07:00
Yifan Gu 44ca3ea5e0 CRI: Add dns option, rename DNSOption to DNSConfig. 2016-09-29 13:46:32 -07:00
Yu-Ju Hong e6a6513552 Apply default image tags for all runtimes
Move the docker-specific logic up to the ImageManager to allow code sharing
among different implementations.
2016-09-28 18:58:21 -07:00
Random-Liu 0771e64ab8 Add unit test for get security option functions. 2016-09-28 18:38:23 -07:00
Random-Liu 88fb149cf5 Add seccomp and apparmor support. 2016-09-27 16:33:02 -07:00
Kubernetes Submit Queue b7c5156c6b Merge pull request #33443 from Random-Liu/cri-oom-score-adj
Automatic merge from submit-queue

CRI: Add oom score adj in new CRI implementation.

Part of #29478.

This PR adds oom score adj in new CRI implementation and dockershim.

I run [oom score node e2e test](https://github.com/kubernetes/kubernetes/blob/master/test/e2e_node/container_manager_test.go#L77) with new CRI implementation myself, and all tests passed.

@yujuhong @feiskyer
2016-09-27 04:24:48 -07:00
Random-Liu 2141e230a6 Add oom score adj in new CRI implementation. 2016-09-26 11:39:02 -07:00
Random-Liu 3d1263d2cf Use fakeclock in fake docker client. 2016-09-24 22:43:39 -07:00
Yu-Ju Hong 737769954a CRI: add Message in ContainerStatus
Kubernetes expects a brief CamelCase string as "Reason" and a human-readable
string as "Message" in the conatiner status. It is difficult for kubelet to
derive the other one if the runtime only provides one of the two fields.
Augment the API by adding the "Message" field.
2016-09-23 14:32:54 -07:00
Yu-Ju Hong 2fc2e71438 Fake container exec/logs support for in-process docker CRI integration
This is a temporary hack to bypass CRI when getting container logs or
running exec in a container. This is necessary to unblock testing and adding
other features in the integration.
2016-09-22 16:03:37 -07:00
Yu-Ju Hong 73f30b18e4 dockershim: support filter containers by sandbox ID 2016-09-16 11:31:15 -07:00
Yu-Ju Hong 2f60b72dd3 dockershim: add support for annotations 2016-09-16 11:31:15 -07:00
Yu-Ju Hong fd70d94330 dockershim: fix sandbox/container filtering 2016-09-16 11:09:24 -07:00
Yu-Ju Hong 77aa4cd07c CRI: clarify the version string requirement 2016-09-14 18:03:12 -07:00
Yu-Ju Hong 13b23c51cb dockershim: fix docker filter, Hostname, and the apiversion 2016-09-14 16:42:02 -07:00
Kubernetes Submit Queue de9739e3c5 Merge pull request #31576 from feiskyer/kuberuntime-filter
Automatic merge from submit-queue

Kubelet: remove name filter from CRI

Since #30753 and #30463, `name` is not used to identify the container/sandbox, so remove it from CRI.

cc @yujuhong @kubernetes/sig-node @kubernetes/sig-rktnetes
2016-09-13 16:42:13 -07:00
Yu-Ju Hong d3e1f2c75e 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-13 10:32:28 -07:00
Pengfei Ni 4d85e48528 CRI: remove name from ContainerFilter and PodSandboxFilter 2016-09-13 22:11:49 +08:00
Wojciech Tyczynski 3a0112f6ee Revert "dockershim: add unit tests for sandbox/container status" 2016-09-13 09:01:19 +02: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
Yu-Ju Hong 84aab8d4a8 dockershim: utilize the Metadata in container names
This commit changes how the shim constructs and parses docker container names
by using the new "Metadata" types.
2016-09-12 10:58:21 -07:00
Yu-Ju Hong 7227641fc2 dockershim: move naming helpers to a separate file 2016-09-12 10:58:21 -07:00
Yu-Ju Hong a1833d1947 dockershim: bug fixes and more unit tests
Fixing the name triming and other small bugs. Added sandbox listing unit tests.
2016-09-12 10:58:21 -07:00
Pengfei Ni 58a9da3310 Kubelet: rename CreatePodSandbox to RunPodSandbox in CRI 2016-09-07 21:38:56 +08:00
Jedrzej Nowak 9e51eea6a3 Fix various typos in pkg/kubelet 2016-08-30 22:57:47 +02:00
Pengfei Ni 9bfa37f2ae Kubelet: pass pod name/namespace/uid to runtimes 2016-08-23 07:33:15 +08: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
Yu-Ju Hong 93f0c5a8e5 Repalce rawContainerID with containerID 2016-08-05 16:26:47 -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
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
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
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
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