Commit Graph

430 Commits (01881d3f0cf031251ca3201b2ef0120f0818e78a)

Author SHA1 Message Date
Pengfei Ni cabd2bb619 Add experimental hyperv containers support on Windows 2018-01-30 12:58:08 +08:00
Kubernetes Submit Queue 7446f49b34
Merge pull request #58899 from yujuhong/reopen-logs
Automatic merge from submit-queue (batch tested with PRs 58899, 58980). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

CRI: Add a call to reopen log file for a container

This allows a daemon external to the container runtime to rotate the log
file, and then ask the runtime to reopen the files.

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

**Release note**:
```release-note
CRI: Add a call to reopen log file for a container. 
```
2018-01-29 16:45:31 -08:00
Yu-Ju Hong 57d8b64dbd CRI: Add a call to reopen log file for a container
This allows a daemon external to the container runtime to rotate the log
file, and then ask the runtime to reopen the files.
2018-01-29 14:05:38 -08:00
Filipe Brandenburger ab219f2765 Refactor handling of IpcMode for the actual container
Having the field set in modifyCommonNamespaceOptions is misleading,
since for the actual container it is later unconditionally overwritten
to point to the sandbox container.

So let's move its setting to modifyHostOptionsForSandbox (renamed from
modifyHostNetworkOptionForSandbox as it's not about network only), since
that reflects what actually happens in practice.

This commit is purely a refactor, it doesn't change any behavior.
2018-01-25 11:09:16 -08:00
Yu-Ju Hong 0957afbbd9 dockershim: clean up the legacy interface 2018-01-19 17:09:40 -08:00
Yu-Ju Hong 9728c56a5a dockershim: call DockerService.Start() during grpc server startup 2018-01-19 16:31:18 -08:00
Yu-Ju Hong 20910289b8 Fix all the unit tests and update the bazel files 2018-01-19 16:31:18 -08:00
Yu-Ju Hong e8da890aee dockershim: remove the use of kubelet's internal API
We let dockershim implement the kubelet's internal (CRI) API as an
intermediary step before transitioning fully to communicate using gRPC.
Now that kubelet has been communicating to the runtime over gRPC for
multiple releases, we can safely retire the extra interface in
dockershim.
2018-01-19 16:31:18 -08:00
Kubernetes Submit Queue 2e9a277a3c
Merge pull request #57845 from yujuhong/minor-clean-up
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

dockershim: bump the minimum supported docker version to 1.11

Drop the 1.10 compatibilty code.

**Release note**:

```release-note
NONE
```
2018-01-09 18:14:27 -08:00
Yu-Ju Hong 059fa35a84 dockershim: bump the minimum supported docker version to 1.11
Drop the 1.10 compatibilty code.
2018-01-04 10:22:16 -08:00
Lee Verberne 1ea697044a Update pause container version to 3.1
This updates the version of the pause container used by the kubelet and
various test utilities to 3.1.

This also adds a CHANGELOG.md for build/pause
2018-01-04 11:35:29 +01:00
Jeff Grafton efee0704c6 Autogenerate BUILD files 2017-12-23 13:12:11 -08:00
Tim Hockin e9dd8a68f6 Revert k8s.gcr.io vanity domain
This reverts commit eba5b6092a.

Fixes https://github.com/kubernetes/kubernetes/issues/57526
2017-12-22 14:36:16 -08:00
Tim Hockin eba5b6092a Use k8s.gcr.io vanity domain for container images 2017-12-18 09:18:34 -08:00
David Ashpole 0e38a0e7dd fake docker client can remove containers which have not been started 2017-12-04 14:18:32 -08:00
David Ashpole 63f7836d39 mock container networking and fix filtering bug 2017-11-28 15:32:18 -08:00
Pengfei Ni b8469e4a25 Update bazel and remove unused data files 2017-11-22 02:50:08 +00:00
Pengfei Ni 7e21146096 Verify seccomp absolute path in dockershim 2017-11-22 02:49:52 +00:00
Kubernetes Submit Queue 02f803cc02
Merge pull request #52842 from yanxuean/reduntdant-cgroups
Automatic merge from submit-queue (batch tested with PRs 50457, 55558, 53483, 55731, 52842). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

improve the logic setting cgroupparent in RunPodSandbox

Signed-off-by: yanxuean <yan.xuean@zte.com.cn>

**What this PR does / why we need it**:
The setting of cgroupparent is too confused!
The old logic is:
1. set CgroupParent correctly
2. reset CgroupParent incorrectly
3. set CgroupParent again  (refer to #42055 )

The login is too confused, and It is sure that there are many people who drop in trap.
We only need to set it in one place.

kubernetes/pkg/kubelet/dockershim/docker_sandbox.go
```
func (ds *dockerService) makeSandboxDockerConfig(c *runtimeapi.PodSandboxConfig, image string) (*dockertypes.ContainerCreateConfig, error) {
        ....
       // Apply linux-specific options.
	if lc := c.GetLinux(); lc != nil {
		if err := ds.applySandboxLinuxOptions(hc, lc, createConfig, image, securityOptSep); err != nil {
			return nil, err
		}
	}

	// Apply resource options.
        setSandboxResources(hc)      **<-- reset the CgroupParent incorrectly**

       // Apply cgroupsParent derived from the sandbox config.
	if lc := c.GetLinux(); lc != nil {
		// Apply Cgroup options.
		cgroupParent, err := ds.GenerateExpectedCgroupParent(lc.CgroupParent)
		if err != nil {
			return nil, fmt.Errorf("failed to generate cgroup parent in expected syntax for container %q: %v", c.Metadata.Name, err)
		}
		hc.CgroupParent = cgroupParent
	}
```

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

**Special notes for your reviewer**:

**Release note**:
```release-note
NONE
```
2017-11-18 11:36:26 -08:00
Madhan Raj Mookkandy 84d87b70b7 Return nil error if checkpoint returns with KeyNotFound error 2017-11-15 14:58:31 -08:00
Seth Jennings a4bc7707d4 dockershim: remove corrupt checkpoints immediately upon detection 2017-11-13 20:34:17 -06:00
Kubernetes Submit Queue 41fe3ed5bc
Merge pull request #54405 from resouer/clean-docker-dep
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

[Part 1] Remove docker dep in kubelet startup

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

Remove dependency of docker during kubelet start up.

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

Part 1 of #54090 

**Special notes for your reviewer**:
Changes include:

1. Move docker client initialization into dockershim pkg.
2. Pass a docker `ClientConfig` from kubelet to dockershim
3. Pass parameters needed by `FakeDockerClient` thru `ClientConfig` to dockershim

(TODO, the second part) Make dockershim tolerate when dockerd is down, otherwise it will still fail kubelet

Please note after this PR, kubelet will still fail if dockerd is down, this will be fixed in the subsequent PR by making dockershim tolerate dockerd failure (initializing docker client in a separate goroutine), and refactoring cgroup and log driver detection. 

**Release note**:

```release-note
Remove docker dependency during kubelet start up 
```
2017-11-13 03:59:53 -08:00
Kubernetes Submit Queue f47a54e89b
Merge pull request #54528 from yanxuean/ds-cm-typo
Automatic merge from submit-queue (batch tested with PRs 53747, 54528, 55279, 55251, 55311). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

a typo in dockershim.cm.containerManager.doWork

Signed-off-by: yanxuean <yan.xuean@zte.com.cn>

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

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```

/sig node
2017-11-08 19:31:06 -08:00
Yu-Ju Hong 99b9c3d26c Dockershim: print docker info output at startup 2017-11-07 15:27:56 -08:00
Kubernetes Submit Queue d837a6a2ea
Merge pull request #51063 from madhanrm/cniwindows
Automatic merge from submit-queue (batch tested with PRs 53679, 51063). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fixes to enable Windows CNI 

**What this PR does / why we need it**:
This PR has fixed which enables Kubelet to use Windows CNI plugin.
**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #
#49646 
**Special notes for your reviewer**:

**Release note**:

```release-note
```
2017-11-03 15:45:11 -07:00
Kubernetes Submit Queue b448dfa0e9
Merge pull request #55028 from sjenning/remove-orphaned-checkpoints
Automatic merge from submit-queue (batch tested with PRs 55050, 53464, 54936, 55028, 54928). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubelet: dockershim: remove orphaned checkpoint files

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

Currently, `ListPodSandbox()` returns a combined list of sandboxes populated from both the runtime and the dockershim checkpoint files.  However the sandboxes in the checkpoint files might not exist anymore.

The kubelet sees the sandbox returned by `ListPodSandbox()` and determines it shouldn't be running and calls `StopPodSandbox()` on it.  This generates an error when `StopContainer()` is called as the container does not exist.  However the checkpoint file is not cleaned up.  This leads to subsequent calls to `StopPodSandbox()` that fail in the same way each time.

This PR removes the checkpoint file if StopContainer fails due to container not found.

The only other place `RemoveCheckpoint()` is called, except if it is corrupt, is from `RemoveSandbox()`.  If the container does not exist, what `RemoveSandbox()` would have done has been effectively been done already.  So this is just clean up.

@derekwaynecarr @eparis @freehan @dcbw
2017-11-03 12:59:19 -07:00
Kubernetes Submit Queue 0575f72832
Merge pull request #55020 from derekwaynecarr/fix-spam
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

StopPodSandbox should not log when container is already removed

**What this PR does / why we need it**:
StopPodSandbox should not log when a container is already gone.  It should only log if it could not stop and the container was still present.

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

**Special notes for your reviewer**:
This was seen in our production logs, need to eliminate spam.

**Release note**:
```release-note
NONE
```
2017-11-02 19:48:31 -07:00
Madhan Raj Mookkandy d7f9e22815 Sandbox Support for Windows + CNI
Following are part of this commit
+++++++++++++++++++++++++++++++++

* Windows CNI Support
	(1) Support to use --network-plugin=cni
	(2) Handled platform requirement of calling CNI ADD for all the containers.
	(2.1) For POD Infra container, netNs has to be empty
	(2.2) For all other containers, sharing the network namespace of POD container,
	      should pass netNS name as "container:<Pod Infra Container Id>", same as the
              NetworkMode of the current container
	(2.3) The Windows CNI plugin has to handle this to call into Platform.
              Sample Windows CNI Plugin code to be shared soon.
* Sandbox support for Windows
	(1) Sandbox support for Windows. Works only with Docker runtime.
	(2) Retained CONTAINER_NETWORK as a backward compatibilty flag,
	    to not break existing deployments using it.
	(3) Works only with CNI plugin enabled.

(*) Changes to reinvoke CNI ADD for every new container created. This is hooked up with PodStatus,
    but would be ideal to move it outside of this, once we have CNI GET support
2017-11-02 17:40:20 -07:00
Seth Jennings 9f66666a30 kubelet: dockershim: remove orphaned checkpoint files 2017-11-02 16:59:39 -05:00
Kubernetes Submit Queue dc35709eee
Merge pull request #54085 from yujuhong/checkpoint-pkg
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add a file store utility package in kubelet

More and more components checkpoints (i.e., persist their states) in
kubelet. Refurbish and move the implementation in dockershim to a
utility package to improve code reusability.
2017-11-02 13:50:16 -07:00
Derek Carr 79a08a1c90 StopPodSandbox should not log when container is already removed 2017-11-02 15:12:25 -04:00
Harry Zhang de1c305356 Remove docker dep in kubelet startup
Update bazel
2017-11-01 10:03:01 +08:00
yanxuean 3f3dae56cf improve setting cgroupparent
Signed-off-by: yanxuean <yan.xuean@zte.com.cn>
2017-10-31 16:47:39 +08:00
yanxuean 8da0d836f7 a typo in dockershim.cm.containerManager.doWork
Signed-off-by: yanxuean <yan.xuean@zte.com.cn>
2017-10-24 22:51:47 +08:00
Pengfei Ni 77ed72f583 Fix dockershim panic when listing images 2017-10-19 08:32:50 +08:00
Kubernetes Submit Queue e3e2e24cc5 Merge pull request #52503 from joelsmith/journald-log-fallback
Automatic merge from submit-queue (batch tested with PRs 54040, 52503). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Get fallback termination msg from docker when using journald log driver

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

When using the legacy docker container runtime and when a container has `terminationMessagePolicy=FallbackToLogsOnError` and when docker is configured with a log driver other than `json-log` (such as `journald`), the kubelet should not try to get the container's log from the json log file (since it's not there) but should instead ask docker for the logs.

**Which issue this PR fixes** fixes #52502

**Special notes for your reviewer**:

**Release note**:
```release-note
Fixed log fallback termination messages when using docker with journald log driver
```
2017-10-17 13:18:15 -07:00
Yu-Ju Hong 9f2e29f0f0 Update bazel file 2017-10-17 10:42:19 -07:00
Yu-Ju Hong 2fd59d9960 Change dockershim to use the common store package 2017-10-17 10:36:33 -07:00
Jeff Grafton aee5f457db update BUILD files 2017-10-15 18:18:13 -07:00
Kubernetes Submit Queue b543f67fc8 Merge pull request #53297 from x1957/code_format
Automatic merge from submit-queue (batch tested with PRs 53297, 53328). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

format some code in dockershim

**What this PR does / why we need it**:
format some code in dockershim

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

**Special notes for your reviewer**:

**Release note**:

```release-note
None
```
2017-10-10 11:20:34 -07:00
Yuhao Fang c1c89d986b format some code in dockershim 2017-10-08 22:30:37 +08:00
Kubernetes Submit Queue f0a061e361 Merge pull request #51152 from bobbypage/cri
Automatic merge from submit-queue (batch tested with PRs 50555, 51152). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Implement CRI stats in Docker Shim

**What this PR does / why we need it**:
This PR implements CRI Stats in the Docker Shim. It is needed to enable CRI stats for Docker and ongoing /stats/summary API changes in moving to use CRI.

Related issues:
#46984 (CRI: instruct kubelet to (optionally) consume container stats from CRI)
#45614 (CRI: add methods for container stats) 

This PR is also a followup to my original PR (https://github.com/kubernetes/kubernetes/pull/50396) to implement Windows Container Stats. The plan is that Windows Stats will use a hybrid model: pod and container level stats will come from CRI (via dockershim) and that node level stats will come from a "winstats" package that exports cadvisor like datastructures using windows specific perf counters from the node. I will update that PR to only export node level stats. 

@yujuhong @yguo0905 @dchen1107 @jdumars @anhowe @michmike

**Special notes for your reviewer**:

**Release note**:

```release-note
```
2017-10-02 14:49:12 -07:00
Kubernetes Submit Queue c6a3f26988 Merge pull request #52395 from dixudx/fix_apparmor_annotation_unconfined
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

enable to specific unconfined AppArmor profile

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

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

**Special notes for your reviewer**:
/assign @tallclair @liggitt 

**Release note**:

```release-note
enable to specific unconfined AppArmor profile
```
2017-10-02 08:03:50 -07:00
David Porter 5eae7eb166 Implement CRI stats in dockershim for Windows
Implement CRI stats for dockershim using docker stats. This enables use
of the summary api to get container metrics on Windows where CRI stats
are enabled.
2017-10-02 04:10:48 +00:00
Di Xu 5e96f7cae9 enable to specific unconfined AppArmor profile 2017-09-28 10:06:36 +08:00
Andy Goldstein 95f373fde6 Normalize RepoTags before checking for match
on projectatomic-based docker, we get "docker.io/library/busybox:latest"
when someone uses an unqualified name like "busybox". Though when we
inspect, the RepoTag will still say "docker.io/busybox:latest", So
we have reparse the tag, normalize it and try again. Please see the
additional test case.

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-09-27 20:51:31 -04:00
Kubernetes Submit Queue 0ea979a2f2 Merge pull request #50509 from feiskyer/link-logs
Automatic merge from submit-queue (batch tested with PRs 50988, 50509, 52660, 52663, 52250). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Create container log symlink for all containers

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

dockershim only makes  log symlink for running containers now, we should also create the log symlink for failed containers.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-09-27 05:32:23 -07:00
Joel Smith d53d29faf7 Get fallback termination msg from docker when using journald log driver
When using the legacy docker container runtime and when a container has
terminationMessagePolicy=FallbackToLogsOnError and when docker is
configured with a log driver other than json-log (such as journald),
the kubelet should not try to get the container's log from the
json log file (since it's not there) but should instead ask docker for
the logs.
2017-09-26 07:14:15 -06:00
Kubernetes Submit Queue 69011d10c2 Merge pull request #52319 from yujuhong/docker-metrics
Automatic merge from submit-queue (batch tested with PRs 51067, 52319, 52803, 52961, 51972). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>..

Move prometheus metrics for docker operations into dockershim
2017-09-25 14:50:51 -07:00
Kubernetes Submit Queue af411e387a Merge pull request #52287 from yujuhong/rm-nsenter
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>..

kubelet: remove the --docker-exec-handler flag

Stop supporting the "nsenter" exec handler. Only the Docker native exec
handler is supported.

The flag was deprecated in Kubernetes 1.6 and is safe to remove
in Kubernetes 1.9 according to the deprecation policy.

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

**Which issue this PR fixes** : fixes #40229

**Special notes for your reviewer**:
N/A

**Release note**:

```release-note
Remove the --docker-exec-handler flag. Only native exec handler is supported.
```
2017-09-25 12:22:57 -07:00
Yu-Ju Hong 331628b7dc Move prometheus metrics for docker operations into dockershim 2017-09-25 10:03:17 -07:00
Kubernetes Submit Queue fc8a647f78 Merge pull request #52864 from dcbw/dockershim-fix-net-teardown
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>..

dockershim: fine-tune network-ready handling on sandbox teardown and removal

If sandbox teardown results in an error, GC will periodically attempt
to again remove the sandbox.  Until the sandbox is removed, pod
sandbox status calls will attempt to enter the pod's namespace and
retrieve the pod IP, but the first teardown attempt may have already
removed the network namespace, resulting in a pointless log error
message that the network namespace doesn't exist, or that nsenter
can't find eth0.

The network-ready mechanism originally attempted to suppress those
messages by ensuring that pod sandbox status skipped network checks
when networking was already torn down, but unfortunately the ready
value was cleared too early.

Also, don't tear down the pod network multiple times if the first
time we tore it down, it succeeded.



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

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

**Special notes for your reviewer**:

**Release note**:

```release-note
```
2017-09-24 04:32:12 -07:00
Kubernetes Submit Queue ffe122d89c Merge pull request #52220 from yujuhong/rm-legacy-code
Automatic merge from submit-queue (batch tested with PRs 52240, 48145, 52220, 51698, 51777). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>..

dockershim: remove support for legacy containers

The code was first introduced in 1.6 to help pre-CRI-kubelet upgrade to
using the CRI implementation. They can safely be removed now.
2017-09-23 09:14:00 -07:00
Yu-Ju Hong 3837a016ef kubelet: remove the --docker-exec-handler flag
Stop supporting the "nsenter" exec handler. Only the Docker native exec
handler is supported.

The flag was deprecated in Kubernetes 1.6 and is safe to remove
in Kubernetes 1.9 according to the deprecation policy.
2017-09-22 12:13:31 -07:00
Dan Williams ddb5075842 dockershim: fine-tune network-ready handling on sandbox teardown and removal
If sandbox teardown results in an error, GC will periodically attempt
to again remove the sandbox.  Until the sandbox is removed, pod
sandbox status calls will attempt to enter the pod's namespace and
retrieve the pod IP, but the first teardown attempt may have already
removed the network namespace, resulting in a pointless log error
message that the network namespace doesn't exist, or that nsenter
can't find eth0.

The network-ready mechanism originally attempted to suppress those
messages by ensuring that pod sandbox status skipped network checks
when networking was already torn down, but unfortunately the ready
value was cleared too early.

Also, don't tear down the pod network multiple times if the first
time we tore it down, it succeeded.
2017-09-21 14:53:50 -05:00
Lantao Liu d387eab817 Fix CRI container/imagefs stats. 2017-09-18 07:48:20 +00:00
Kubernetes Submit Queue c6a9b1e198 Merge pull request #52125 from yujuhong/fix-file-sync
Automatic merge from submit-queue (batch tested with PRs 52339, 52343, 52125, 52360, 52301)

dockershim: check if f.Sync() returns an error and surface it

```release-note
dockershim: check the error when syncing the checkpoint.
```
2017-09-12 21:45:56 -07:00
Yu-Ju Hong aaf26b2eaa dockershim: remove support for legacy containers
The code was first introduced in 1.6 to help pre-CRI-kubelet upgrade to
using the CRI implementation. They can safely be removed now.
2017-09-11 08:44:27 -07:00
Pengfei Ni 4d5d97438b Use credentials from providers for docker sandbox image 2017-09-09 07:02:04 +08:00
Yu-Ju Hong a850614613 dockershim: check if f.Sync() returns an error and surface it 2017-09-07 16:05:02 -07:00
David Ashpole e5a6a79fd7 update cadvisor, docker, and runc godeps 2017-09-05 12:38:57 -07:00
Jan Safranek 0c767355d8 Implement mount propagation in docker shim 2017-09-01 21:36:33 +02:00
Kubernetes Submit Queue 2ab7ad14b4 Merge pull request #47991 from ncdc/fix-initial-exec-terminal-dimensions
Automatic merge from submit-queue

Fix initial exec terminal dimensions

**What this PR does / why we need it**:
Delay attempting to send a terminal resize request to docker until after
the exec has started; otherwise, the initial resize request will fail.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-08-18 14:47:11 -07:00
Kubernetes Submit Queue e86f43bcab Merge pull request #50796 from yguo0905/hc
Automatic merge from submit-queue (batch tested with PRs 50563, 50698, 50796)

Disable Docker's health check until we officially support it

Ref: https://github.com/kubernetes/kubernetes/issues/50703

Tested locally.

Without this PR:

```
CONTAINER ID        IMAGE                                                  COMMAND                  CREATED             STATUS                     PORTS               NAMES
afdd796ddddc        gcr.io/ygg-gke-dev/nginx-healthcheck                   "nginx -g 'daemon ..."   5 minutes ago       Up 5 minutes (healthy)                       k8s_test-container_test-pod_default_8a1ad225-82bf-11e7-becb-480fcf514648_0
```

With this PR:
```
e3fb2437555f        gcr.io/ygg-gke-dev/nginx-healthcheck                   "nginx -g 'daemon ..."   10 seconds ago      Up 9 seconds                            k8s_test-container_test-pod_default_de82e83c-82c0-11e7-b3fc-480fcf514648_0
```

**Release note**:

```
Disable Docker's health check until we officially support it.
```

/assign @yujuhong 
/assign @dchen1107
2017-08-17 12:18:33 -07:00
Yang Guo fe06c7ec64 Disables Docker's health check 2017-08-16 16:12:09 -07:00
Kubernetes Submit Queue c743e68fb1 Merge pull request #50694 from dims/fix-make-cross-problem-with-helpers
Automatic merge from submit-queue (batch tested with PRs 50694, 50702)

Fix make cross build failure

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

had to fix the method getSecurityOpts in helpers_windows.go to
match the implementation in helpers_linux.go from commit:
bf01fa2f00


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

Fixes #50675

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-08-15 14:28:24 -07:00
Davanum Srinivas 493ee8b285 Fix make cross build failure
had to fix the method getSecurityOpts in helpers_windows.go to
match the implementation in helpers_linux.go from commit:
bf01fa2f00

Fixes #50675
2017-08-15 14:25:35 -04:00
Michael Taufen 24bab4c20f move KubeletConfiguration out of componentconfig API group 2017-08-15 08:12:42 -07:00
Pengfei Ni ea4a3417e7 run hack/update-bazel.sh 2017-08-13 15:43:42 +08:00
Pengfei Ni c242432a3b Rename runtime/default to docker default 2017-08-13 15:42:15 +08:00
Pengfei Ni bf01fa2f00 Use seccomp from security context 2017-08-13 15:42:15 +08:00
Kubernetes Submit Queue b9b875f0d7 Merge pull request #46105 from sjenning/update-conatiner-resource-cri
Automatic merge from submit-queue (batch tested with PRs 49488, 50407, 46105, 50456, 50258)

Add UpdateContainerResources method to CRI

This is first step toward support for opinionated cpu pinning for certain guaranteed pods.

In order to do this, the kubelet needs to be able to dynamically update the cpuset at the container level, which is managed by the container runtime.  Thus the kubelet needs a method to communicate over the CRI so the runtime can then modify the container cgroup.

This is used in the situation where a core is added or removed from the shared pool to become a exclusive core for a new G pod.  The cpuset for all containers in the shared pool will need to be updated to add or remove that core.

Opening this up now so we can start discussion.  The need for a change to the CRI might be unexpected.

@derekwaynecarr @vishh @ConnorDoyle 

```release-note
NONE
```
2017-08-11 14:14:00 -07:00
Jeff Grafton a7f49c906d Use buildozer to delete licenses() rules except under third_party/ 2017-08-11 09:32:39 -07:00
Jeff Grafton 33276f06be Use buildozer to remove deprecated automanaged tags 2017-08-11 09:31:50 -07:00
Jeff Grafton cf55f9ed45 Autogenerate BUILD files 2017-08-11 09:30:23 -07:00
Pengfei Ni 9da9e2ab59 Create container log symlink for all containers 2017-08-11 17:36:28 +08:00
Seth Jennings 9fbf8f57dd add UpdateContainerResources function to CRI 2017-07-31 20:47:56 -05:00
Kubernetes Submit Queue 72c6251508 Merge pull request #47019 from jessfraz/allowPrivilegeEscalation
Automatic merge from submit-queue (batch tested with PRs 49651, 49707, 49662, 47019, 49747)

Add support for `no_new_privs` via AllowPrivilegeEscalation

**What this PR does / why we need it**:
Implements kubernetes/community#639
Fixes #38417

Adds `AllowPrivilegeEscalation` and `DefaultAllowPrivilegeEscalation` to `PodSecurityPolicy`.
Adds `AllowPrivilegeEscalation` to container `SecurityContext`.

Adds the proposed behavior to `kuberuntime`, `dockershim`, and `rkt`. Adds a bunch of unit tests to ensure the desired default behavior and that when `DefaultAllowPrivilegeEscalation` is explicitly set.

Tests pass locally with docker and rkt runtimes. There are also a few integration tests with a `setuid` binary for sanity.

**Release note**:

```release-note
Adds AllowPrivilegeEscalation to control whether a process can gain more privileges than it's parent process
```
2017-07-31 16:56:58 -07:00
Andy Goldstein a4811daf31 Fix initial exec terminal dimensions
Delay attempting to send a terminal resize request to docker until after
the exec has started; otherwise, the initial resize request will fail.
2017-07-31 11:52:27 -04:00
Kubernetes Submit Queue f2dc80bfe5 Merge pull request #48822 from caseydavenport/drive-by-fix-todo
Automatic merge from submit-queue (batch tested with PRs 47738, 49196, 48907, 48533, 48822)

Fix TODO: rename podInfraContainerID to sandboxID

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

Code-cleanup in kubelet to use consistent naming for sandbox ID. Not super urgent, but thought it would be nice to knock off some TODOs. 

**Which issue this PR fixes**

Fixes a TODO in the code, no associated issue.

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-07-28 03:10:37 -07:00
Jess Frazelle 0f349cc61f
allowPrivilegeEscalation: modify api types & add functionality
Signed-off-by: Jess Frazelle <acidburn@google.com>
2017-07-24 12:52:41 -04:00
Casey Davenport 78709456ab Fix TODO: rename podInfraContainerID to podSandboxID 2017-07-20 17:45:55 -07:00
Kubernetes Submit Queue feed4aa12a Merge pull request #49234 from mengqiy/master
Automatic merge from submit-queue (batch tested with PRs 49107, 47177, 49234, 49224, 49227)

Move util/exec to vendor

Move util/exec to vendor.
Update import paths.
Update godep

Part of #48209

Associate PR against `k8s.io/utils` repo: https://github.com/kubernetes/utils/pull/5

```release-note
NONE
```

/assign @apelisse
2017-07-20 15:08:22 -07:00
Kubernetes Submit Queue 84f773850e Merge pull request #49107 from edevil/try_remove_old_log
Automatic merge from submit-queue (batch tested with PRs 49107, 47177, 49234, 49224, 49227)

Make sure the previous symlink file is deleted before trying to create a new one

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

It deletes possibly existing symlinks to container log files.

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

fixes #49105

**Special notes for your reviewer**:

**Release note**:

```release-note
```
2017-07-20 15:08:17 -07:00
ymqytw 9b393a83d4 update godep 2017-07-20 11:03:49 -07:00
ymqytw 3dfc8bf7f3 update import 2017-07-20 11:03:49 -07:00
André Cruz 89012ccb23 Fix test 2017-07-19 17:14:35 +01:00
André Cruz 9f81cf096b Make sure the previous symlink file is deleted
before trying to create a new one.
2017-07-18 12:06:31 +01:00
Jeff Grafton 3962b5dccf Fix compilation failure in dockershim for windows 2017-07-14 18:15:26 -07:00
Yang Guo bf2ced837c Updates Docker Engine API 2017-07-13 12:55:07 -07:00
Kubernetes Submit Queue fa72912897 Merge pull request #48742 from yujuhong/rm-unused
Automatic merge from submit-queue (batch tested with PRs 48405, 48742, 48748, 48571, 48482)

dockershim: clean up unused security context code

Most of the code in the `dockershim/securitycontext` package are
unused and can be removed. This PR migrates the rest of the code,
cleans it up (e.g., remove references to kubernetes API objects),
and removes the package entirely.
2017-07-12 08:05:15 -07:00
Yu-Ju Hong e6ad8f8e48 dockershim: clean up unused security context code
Also remove references to kubernetes api objects
2017-07-10 17:48:26 -07:00
Tim Allclair a2f2e1d491 Name change: s/timstclair/tallclair/ 2017-07-10 14:05:46 -07:00
ymqytw ce561b2044 fix cross build for windows 2017-07-05 12:42:41 -07:00
ymqytw f0ce897277 move term to kubectl/util 2017-06-30 15:00:24 -07:00
Kubernetes Submit Queue 1cca341b17 Merge pull request #47850 from dcbw/checkpoint-hostnetwork
Automatic merge from submit-queue (batch tested with PRs 47850, 47835, 46197, 47250, 48284)

dockershim: checkpoint HostNetwork property

To ensure kubelet doesn't attempt network teardown on HostNetwork
containers that no longer exist but are still checkpointed, make
sure we preserve the HostNetwork property in checkpoints.  If
the checkpoint indicates the container was a HostNetwork one,
don't tear down the network since that would fail anyway.

Related: https://github.com/kubernetes/kubernetes/issues/44307#issuecomment-299548609

@freehan @kubernetes/sig-network-misc
2017-06-29 15:16:37 -07:00
Kubernetes Submit Queue c9ad8dcde0 Merge pull request #47900 from yiqinguo/yiqinguo_add_type_judgment
Automatic merge from submit-queue

Add type conversion judgment

If do not type conversion judgment, there may be panic.

**Release note**:
```release-note
NONE
```
2017-06-29 04:00:18 -07:00
Dong Liu 4df4ea2bea Move seccomp helper methods and tests to platform-specific files. 2017-06-23 09:49:06 +08:00
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