k3s/pkg
Kubernetes Submit Queue 69a9759d90 Merge pull request #46744 from karataliu/wincri4
Automatic merge from submit-queue

Support windows in dockershim

**What this PR does / why we need it**:
This is the 2nd part for https://github.com/kubernetes/kubernetes/issues/45927 .

The non-cri implementation dockertools was removed from kubelet v1.7 .
Part of previous work for supporting windows container lies in v1.6 dockertools, this PR is to port them to dockershim.

Main reference file in v1.6 dockertools windows support:
https://github.com/kubernetes/kubernetes/blob/v1.6.4/pkg/kubelet/dockertools/docker_manager_windows.go

**Which issue this PR fixes**
45927, for now catching up the implementation of v1.6

**Special notes for your reviewer**:
The code change includes 4 parts, put them together as we discussed in https://github.com/kubernetes/kubernetes/pull/46089

1. Update go-winio package to a newer version
  'go-winio' package is used by docker client.
  This change is to bring the support for Go v1.8, specifically included in the PR: https://github.com/Microsoft/go-winio/pull/48 
Otherwise it will produce a lot of error like in: https://github.com/fsouza/go-dockerclient/issues/648 

2. Add os dependent getSecurityOpts helper method. 
seccomp not supported on windows
  Corresponding code in v1.6: https://github.com/kubernetes/kubernetes/blob/v1.6.4/pkg/kubelet/dockertools/docker_manager_windows.go#L78

3. Add updateCreateConfig.
Allow user specified network mode setting. This is to be compatible with what kube-proxy package does on Windows. 
  Also, there is a Linux section in both sandbox config and container config: LinuxPodSandboxConfig, LinuxContainerConfig.
And that section later goes to Config and HostConfig section under docker container createConfig. Ideally hostconfig section should be dependent on host os, while config should depend on container image os.
  To simplify the case, here it assumes that windows host supports windows type container image only. It needs to be updated when kubernetes is to support windows host running linux container image or the like.
  Corresponding code in v1.6: https://github.com/kubernetes/kubernetes/blob/v1.6.4/pkg/kubelet/dockertools/docker_manager_windows.go#L57

4. Add podIpCache in dockershim. 
  For v1.6 windows implementation, it still does not use sandbox, thus only allow single container to be exposed.
  Here added a cache for saving container IP, to get adapted to the new CRI api.
Corresponding code in v1.6:
No sandbox: https://github.com/kubernetes/kubernetes/blob/v1.6.4/pkg/kubelet/dockertools/docker_manager_windows.go#L66
Use container id as pod ip: https://github.com/kubernetes/kubernetes/blob/v1.6.4/pkg/kubelet/dockertools/docker_manager.go#L2727

**Release note**:
2017-06-07 20:03:19 -07:00
..
api Merge pull request #46809 from rickypai/rpai/properly_validate_hostalias_hostnames 2017-06-07 08:10:50 -07:00
apimachinery/tests Fix round-trip of Unstructured.OwnerReferences 2017-06-02 11:13:33 +10:00
apis Auto generated code for StatefulSet update 2017-06-06 13:47:19 -07:00
auth
bootstrap/api
capabilities
client Implement DaemonSet history logic in controller 2017-06-03 00:44:23 -07:00
cloudprovider Merge pull request #46660 from jackfrancis/azure-cloudprovider-backoff 2017-06-07 13:30:58 -07:00
controller Merge pull request #47138 from smarterclayton/delete_collection 2017-06-07 19:01:47 -07:00
conversion
credentialprovider
features Rotate kubelet client certificate. 2017-06-01 09:29:42 -07:00
fieldpath
fields
generated Merge pull request #46756 from girikuncoro/japanese-translate 2017-06-07 00:27:51 -07:00
hyperkube
kubeapiserver Load initializers from dynamic config 2017-06-05 19:12:41 -04:00
kubectl Merge pull request #47013 from smarterclayton/fix_printer 2017-06-07 16:53:47 -07:00
kubelet Merge pull request #46744 from karataliu/wincri4 2017-06-07 20:03:19 -07:00
kubemark Group container-runtime-specific flags/options together 2017-05-30 08:10:39 -07:00
labels
master handle unversioned objects for encoding for CRs 2017-06-06 10:20:50 -04:00
metrics
printers Merge pull request #45877 from zhangxiaoyu-zidif/add-ut-for-test-podlist 2017-06-07 17:55:40 -07:00
probe
proxy Proxy: comments around ClusterCIDR use 2017-06-01 12:36:31 -07:00
quota
registry Implements StatefulSet update 2017-06-06 12:00:28 -07:00
routes
runtime
security Added host path whitelist to psp 2017-05-29 13:03:25 -04:00
securitycontext
serviceaccount
ssh
types
util Merge pull request #43005 from cmluciano/cml/consolidatesysctl 2017-06-07 13:30:54 -07:00
version
volume Merge pull request #47018 from FengyunPan/fix-attach 2017-06-07 08:10:43 -07:00
watch
BUILD Regenerate files 2017-05-28 10:11:02 -04:00
OWNERS