Commit Graph

190 Commits (60604f8818aecbc9c3736fbc32747cc0a535bc80)

Author SHA1 Message Date
Chao Xu 60604f8818 run hack/update-all 2017-06-22 11:31:03 -07:00
Chao Xu f4989a45a5 run root-rewrite-v1-..., compile 2017-06-22 10:25:57 -07:00
mbohlool c91a12d205 Remove all references to types.UnixUserID and types.UnixGroupID 2017-06-21 04:09:07 -07:00
Derek Carr 36619fa217 surface rpc error desc only in events 2017-06-13 23:42:15 -04:00
Derek Carr a02f10fa3a Strip containerID from events to reduce spam 2017-06-13 23:31:56 -04:00
Pengfei Ni 22e99504d7 Update CRI references 2017-06-09 10:16:40 +08:00
Yu-Ju Hong d152e20f41 Address the comments 2017-06-05 19:51:55 -07:00
Yu-Ju Hong 07a67c252c kuberuntime: check the value of RunAsNonRoot when verifying
The verification function is fixed to check the value of RunAsNonRoot,
not just the existence of it. Also adds unit tests to verify the correct
behavior.
2017-06-05 18:03:32 -07:00
Kubernetes Submit Queue 3fdf6c3d14 Merge pull request #45896 from dashpole/disk_pressure_reclaim
Automatic merge from submit-queue

Delete all dead containers and sandboxes when under disk pressure.

This PR modifies the eviction manager to add dead container and sandbox garbage collection as a resource reclaim function for disk.  It also modifies the container GC logic to allow pods that are terminated, but not deleted to be removed.

It still does not delete containers that are less than the minGcAge.  This should prevent nodes from entering a permanently bad state if the entire disk is occupied by pods that are terminated (in the state failed, or succeeded), but not deleted.

There are two improvements we should consider making in the future:

- Track the disk space and inodes reclaimed by deleting containers.  We currently do not track this, and it prevents us from determining if deleting containers resolves disk pressure.  So we may still evict a pod even if we are able to free disk space by deleting dead containers.
- Once we can track disk space and inodes reclaimed, we should consider only deleting the containers we need to in order to relieve disk pressure.  This should help avoid a scenario where we try and delete a massive number of containers all at once, and overwhelm the runtime.

/assign @vishh 
cc @derekwaynecarr 

```release-note
Disk Pressure triggers the deletion of terminated containers on the node.
```
2017-06-03 23:43:46 -07:00
David Ashpole 889afa5e2d trigger aggressive container garbage collection when under disk pressure 2017-06-03 07:52:36 -07:00
enxebre 14be65c74b Improving test coverage for kubelet/kuberuntime. 2017-06-01 09:43:15 +02:00
Yu-Ju Hong 417e9c8cea Update all relevant interfaces and create stubs 2017-05-24 15:21:16 -07:00
Derek Carr f59069720e Fix kubelet event recording 2017-05-22 17:24:36 -04:00
Random-Liu 4935e119da Fix kuberuntime GetPods. 2017-05-19 11:47:45 -07:00
Yu-Ju Hong de0438a5c8 kuberuntime: add unit tests for container status population
Also refactor a little bit to make the function more testable.
2017-05-17 13:14:00 -07:00
Yu-Ju Hong 7c75f5c551 kuberuntime: report StartedAt for exited containers 2017-05-17 11:14:09 -07:00
Kubernetes Submit Queue b10fd19232 Merge pull request #45625 from Random-Liu/fix-log-line
Automatic merge from submit-queue (batch tested with PRs 45860, 45119, 44525, 45625, 44403)

Make a log line more clear in kuberuntime_manager.go.

Make a log in `podSandboxChanged` more clear.

@yujuhong @feiskyer
2017-05-16 16:14:56 -07:00
Pengfei Ni 8bc6e59278 kuberuntime: set sysctls for sandbox config 2017-05-15 12:52:38 +08:00
Michael Taufen cbad320205 Reorganize kubelet tree so apis can be independently versioned 2017-05-12 10:02:33 -07:00
Kubernetes Submit Queue e1bb9a5177 Merge pull request #45667 from yujuhong/mv-pull-tests
Automatic merge from submit-queue (batch tested with PRs 45691, 45667, 45698, 45715)

dockertools: migrate the unit tests and delete the package
2017-05-12 04:09:41 -07:00
Kubernetes Submit Queue 1f22204119 Merge pull request #45571 from verb/fix-fakeruntime-assertcalls
Automatic merge from submit-queue

Fix AssertCalls usage for kubelet fake runtimes unit tests

Despite its name, AssertCalls() does not assert anything. It returns an error that should be checked. This was causing false negatives for a handful of unit tests, which are also fixed here.

Tests for the image manager needed to be rearranged in order to accommodate a potentially different sequence of calls each tick because the image puller changes behavior based on prior errors.

**What this PR does / why we need it**: Fixes broken unit tests

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

**Special notes for your reviewer**: 

**Release note**:

```release-note
NONE
```
2017-05-12 01:45:22 -07:00
Yu-Ju Hong fccf34ccb6 Remove various references of dockertools
Also update the bazel files.
2017-05-11 10:01:41 -07:00
Yu-Ju Hong 4b72d229f7 Migrate unit tests for image pulling credentials and error handling
Also remove the dockertools package completely.
2017-05-11 10:01:41 -07:00
Random-Liu 613c42b89b Make a log line more clear in kuberuntime_manager.go. 2017-05-10 16:32:00 -07:00
Kubernetes Submit Queue 51a3413371 Merge pull request #45307 from yujuhong/mv-docker-client
Automatic merge from submit-queue (batch tested with PRs 45453, 45307, 44987)

Migrate the docker client code from dockertools to dockershim

Move docker client code from dockertools to dockershim/libdocker. This includes
DockerInterface (renamed to Interface), FakeDockerClient, etc.

This is part of #43234
2017-05-09 20:23:44 -07:00
Lee Verberne f83337a8ac Fix AssertCalls usage for kubelet fake runtimes
Despite its name, AssertCalls() does not assert anything. It returns an
error that must be checked. This was causing false negatives for
a handful of unit tests.
2017-05-10 01:40:58 +00:00
Yu-Ju Hong cf3635c876 Update bazel BUID files 2017-05-05 11:48:08 -07:00
Yu-Ju Hong 8cc4b3a81e Move legacy log symlink to kuberuntime
Also remove the dockertools.DockerType constant.
2017-05-05 11:48:08 -07:00
Jamie Hannaford 9440a68744 Use dedicated Unix User and Group ID types 2017-05-05 14:07:38 +02:00
Kubernetes Submit Queue 84f41f3388 Merge pull request #41733 from feiskyer/images
Automatic merge from submit-queue (batch tested with PRs 45314, 45250, 41733)

CRI: add ImageFsInfo API

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

kubelet currently relies on cadvisor to get the ImageFS info for supported runtimes, i.e., docker and rkt. This PR adds ImageFsInfo API to CRI so kubelet could get the ImageFS correctly for all runtimes.

**Which issue this PR fixes** 

First step for  #33048 ~~also reverts temporary ImageStats in #33870~~.

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-05-03 18:47:04 -07:00
Yu-Ju Hong 78b2c3b4c2 kuberuntime: remove the unused network plugin
Network plugin is completely handled by the container runtimes. Remove
this unused field in the kuberuntime manager.
2017-05-03 16:21:46 -07:00
Pengfei Ni f4cb35846e Fix flake in sandbox garbage collection 2017-05-03 21:05:24 +08:00
Pengfei Ni 5f7de0ab97 Add ImageFsInfo API for ImageManagerService 2017-05-03 15:17:45 +08:00
Pengfei Ni 1c593bd62c Update test for sandbox gc 2017-05-03 14:29:16 +08:00
Pengfei Ni 691f0482fb Fix sandbox garbage collection.
Sandboxes are garbage collected only when they are containing no containers at
all and not the latest sandbox if it is belonging to an existing pod.
2017-05-03 14:29:16 +08:00
Pengfei Ni ac76766a92 CRI: move apparmor annotations to container security context 2017-05-01 20:55:16 +08:00
Chao Xu 4f9591b1de move pkg/api/v1/ref.go and pkg/api/v1/resource.go to subpackages. move some functions in resource.go to pkg/api/v1/node and pkg/api/v1/pod 2017-04-17 11:38:11 -07:00
Mike Danese a05c3c0efd autogenerated 2017-04-14 10:40:57 -07:00
Random-Liu 2fbf34f7c1 Stop following container log when container exited. 2017-04-13 11:25:08 -07:00
Kubernetes Submit Queue 7b7257ac79 Merge pull request #44097 from feiskyer/hostpid
Automatic merge from submit-queue

Fix container hostPid settings

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

HostPid is not set correctly for containers.

**Which issue this PR fixes**

Fixes #44041.

**Special notes for your reviewer**:

Should be cherry-picked into v1.6 branch.

**Release note**:

```release-note
Fix container hostPid settings.
```


cc @yujuhong @derekwaynecarr @unclejack @kubernetes/sig-node-pr-reviews
2017-04-05 16:24:49 -07:00
Kubernetes Submit Queue 08fefc9d9a Merge pull request #42769 from timchenxiaoyu/acrosstypo
Automatic merge from submit-queue

fix across typo

fix across typo


NONE
2017-04-05 14:28:26 -07:00
Pengfei Ni 5812c876f7 kuberuntime: set namespsace options regardless of security context 2017-04-05 22:29:46 +08:00
Kubernetes Submit Queue 5fd0566ce7 Merge pull request #43652 from Random-Liu/avoid-kubelet-panic
Automatic merge from submit-queue (batch tested with PRs 43653, 43654, 43652)

CRI: Check nil pointer to avoid kubelet panic.

When working on the containerd kubernetes integration, I casually returns an empty `sandboxStatus.Linux{}`, but it cause kubelet to panic.

This won't happen when runtime returns valid data, but we should not make the assumption here.

/cc @yujuhong @feiskyer
2017-03-24 22:16:21 -07:00
Random-Liu 9186d1568e Check nil pointer to avoid kubelet panic. 2017-03-24 17:27:15 -07:00
Yu-Ju Hong ea868d6f7b kuberuntime: don't override the pod IP for pods using host network 2017-03-22 13:28:17 -07:00
Pengfei Ni 079158fa08 CRI: add support for dns cluster first policy
PR #29378 introduces ClusterFirstWithHostNet policy but only dockertools
was updated to support the feature. This PR updates kuberuntime to
support it for all runtimes.

Also fixes #43352.
2017-03-20 17:50:38 +08:00
timchenxiaoyu 767719ea9c fix across typo 2017-03-09 09:07:21 +08:00
Yu-Ju Hong 1095652cb8 Add more logs to help debugging 2017-03-08 12:27:49 -08:00
Seth Jennings ccd87fca3f kubelet: add cgroup manager metrics 2017-03-06 08:53:47 -06:00
Pengfei Ni 1986b78e0e Version(): return runtime version instead of CRI 2017-03-02 14:42:37 +08:00