Commit Graph

700 Commits

Author SHA1 Message Date
wawa0210
aea228f5dd fix no-new-privileges on windows 2020-07-20 16:14:52 -04:00
Kubernetes Prow Robot
3f8f9998b0
Merge pull request #90948 from pjbgf/seccomp-least-priv-dockershim
Add seccomp least privilege for docker sandbox
2020-07-14 02:23:22 -07:00
Giuseppe Scrivano
0d2a493a8f
kubelet: skip setting the devices cgroup
use the new libcontainer feature of skipping setting the devices
cgroup.  This is necessary on cgroup v2 to avoid leaking a eBPF
program every time the cgroup is re-configured.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-07-09 09:37:46 +02:00
Paulo Gomes
8976e3620f
Add seccomp enforcement and validation based on new GA fields
Adds seccomp validation.

This ensures that field and annotation values must match when present.

Co-authored-by: Sascha Grunert <sgrunert@suse.com>
2020-07-06 09:13:25 +01:00
Antonio Ojea
6f79600e73 bump cni library version to v0.8.0
last CNI library release is 0.7.1 from Jun 11, 2019.
Since then, there was introduced new feature and bugfixes.

Currently, this library is only being used by dockershim,
the other CRI plugins are vendoring it directly

However, this will help also to mitigate some of the issues with the
CI jobs that are still using dockershim.

Signed-off-by: Antonio Ojea <antonio.ojea.garcia@gmail.com>
2020-07-01 18:09:19 +02:00
Giuseppe Scrivano
e94aebf4cb
pkg/kubelet: adapt to new libcontainer API
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-06-24 18:39:51 +02:00
Vinod K L Swamy
ac3f87346f
KubeProxy and DockerShim changes for Ipv6 dual stack support on Windows
Signed-off-by: Vinod K L Swamy <vinodko@microsoft.com>
2020-06-10 15:36:48 -07:00
Davanum Srinivas
0608e8be25
update bazel BUILD files
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-05-20 10:57:47 -04:00
Davanum Srinivas
5692926914
Move packages for slightly better UX for consumers
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-05-20 10:57:46 -04:00
Kubernetes Prow Robot
55d71532c0
Merge pull request #81165 from johscheuer/update-traffic-shaping-docs
Update internal traffic shaping docs
2020-05-17 03:01:35 -07:00
Davanum Srinivas
07d88617e5
Run hack/update-vendor.sh
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-05-16 07:54:33 -04:00
Davanum Srinivas
442a69c3bd
switch over k/k to use klog v2
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-05-16 07:54:27 -04:00
Kubernetes Prow Robot
4339ac30a0
Merge pull request #90554 from vboulineau/vboulineau/fix_win_stats_init_containers
kubelet: fix `/stats/summary` endpoint on Windows when init-containers are present on the node
2020-05-13 15:58:51 -07:00
Paulo Gomes
6db5b5c50f
Add seccomp least privilege for docker sandbox 2020-05-10 11:52:42 +01:00
mattjmcnaughton
29fa1f4566
Fix the verify job
Small changes to fix the verify job. Add the proper headers, fix lint
errors, etc...
2020-05-07 17:18:50 -04:00
mattjmcnaughton
b36f637f0d
Add dockerless tags to all files in dockershim
As the final step, add the `dockerless` tags to all files in the
dockershim. Using `-tags=dockerless` in `go build`, we can compile
kubelet without the dockershim.

Once cadvisor no longer depends on `docker/docker`, compiling with
`-tags=dockerless` should be sufficient to compile the Kubelet w/o a
dependency on `docker/docker`.
2020-05-07 17:18:50 -04:00
mattjmcnaughton
7fb6c51822
Move DockerLegacyService interface out of pkg/kubelet/dockershim
DockerLegacyService interface is used throughout `pkg/kubelet`.
It used to live in the `pkg/kubelet/dockershim` package. While we
would eventually like to remove it entirely, we need to give users some form
of warning.

By including the interface in
`pkg/kubelet/legacy/logs.go`, we ensure the interface is
available to `pkg/kubelet`, even when we are building with the `dockerless`
tag (i.e. not compiling the dockershim).
While the interface always exists, there will be no implementations of the
interface when building with the `dockerless` tag. The lack of
implementations should not be an issue, as we only expect `pkg/kubelet` code
to need an implementation of the `DockerLegacyService` when we are using
docker. If we are using docker, but building with the `dockerless` tag, than
this will be just one of many things that breaks.

`pkg/kubelet/legacy` might not be the best name for the package... I'm
very open to finding a different package name or even an already
existing package.
2020-05-07 17:18:49 -04:00
mattjmcnaughton
e0e6d54cdf
Extract running Dockershim into own file
Extract a `runDockershim` function into a file outside of `kubelet.go`.
We can use build tags to compile two separate functions... one which
actually runs dockershim and one that is a no-op.
2020-05-07 17:18:48 -04:00
Vincent Boulineau
3bff11244b
kubelet: fix /stats/summary endpoint on Windows when init-containers are present on the node
Following changes in #87730, Kubelet is directly hcsshim to gather stats.
However, unlike `docker stats` API that was used before, hcsshim does not
keep information about exited containers.

When the Kubelet lists containers (`docker_container.go:ListContainers()`),
it sets `All: true`, retrieving non-running containers.

When docker stats is called with such container id, it'll return a valid JSON
with all values set to 0. The non-running containers are filtered later on in the process.

When the hcsshim is called with such container id, it'll return an error, effectively
stopping the stats retrieval for all containers.
2020-05-04 14:42:02 +02:00
ZP-AlwaysWin
5796b7a32e Repair description 2020-04-17 09:36:38 +08:00
Kubernetes Prow Robot
6239abe698
Merge pull request #89225 from andrewsykim/apparmor-api
move apparmor annotation constants to k8s.io/api/core/v1
2020-04-12 19:11:50 -07:00
Tim Hockin
9551ecb7c3 Cleanup: Change "Ip" to "IP" in func and var names 2020-04-10 15:29:50 -07:00
Tim Hockin
efb24d44c6 Rename iptables IsIpv6 to IsIPv6 2020-04-10 15:29:50 -07:00
Tim Hockin
ef934a2c5e Add Protocol() method to iptables
Enables simpler printing of which IP family the iptables interface is
managing.
2020-04-10 15:29:49 -07:00
Andrew Sy Kim
2e56866c97 move apparmor annotation constants to k8s.io/api/core/v1
Signed-off-by: Andrew Sy Kim <kim.andrewsy@gmail.com>
2020-04-06 10:22:04 -04:00
Davanum Srinivas
7368359782
Stop using deprecated method
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-04-03 15:48:32 -04:00
Kubernetes Prow Robot
dfb6993947
Merge pull request #89182 from dims/just-use-runtime-numcpu
Just use runtime.NumCPU on windows
2020-03-19 06:05:51 -07:00
Kubernetes Prow Robot
761c72f691
Merge pull request #88348 from tedyu/image-not-nil
Check that ImageInspect pointer is not nil
2020-03-17 16:21:01 -07:00
Davanum Srinivas
25c3ddf22e
Just use runtime.NumCPU on windows
docker folks added NumCPU implementation for windows that
supported hot-plugging of CPUs. The implementation used the
GetProcessAffinityMask to be able to check which CPUs are
active as well.
3707a76921

The golang "runtime" package has also bene using GetProcessAffinityMask
since 1.6 beta1:
6410e67a1e

So we don't seem to need the sysinfo.NumCPU from docker/docker.

(Note that this is PR is an effort to get away from dependencies from
docker/docker)

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-03-17 15:53:52 -04:00
Patrick Lang
19acf7d051 Fix cpu resource limit on Windows 2020-02-24 19:46:39 +00:00
Kubernetes Prow Robot
0943976757
Merge pull request #83295 from oshothebig/typo
Fix typo in docker_sandbox.go
2020-02-21 10:32:32 -08:00
Kubernetes Prow Robot
d0983b562d
Merge pull request #84731 from verb/ec-pid
Add namespace targeting mode to CRI and kubelet
2020-02-20 04:29:17 -08:00
Ted Yu
884e5ee3d4 Check that ImageInspect pointer is not nil 2020-02-19 12:45:54 -08:00
Kubernetes Prow Robot
3d70825195
Merge pull request #87933 from jdef/fix/86367
Fix docker/journald logging conformance
2020-02-18 20:58:25 -08:00
James DeFelice
0e178f9341 rename to sharedLimitWriter 2020-02-14 13:48:41 -06:00
Benjamin Elder
1631825e44 bump pause to 3.2 in kubelet 2020-02-14 11:40:15 -08:00
Tim Hockin
fc5b08569f Create an OWNERS alias for net-driver-approvers 2020-02-13 14:43:45 -08:00
James DeFelice
a4230055f3 address review feedback 2020-02-13 11:44:11 -06:00
James DeFelice
6f8dfdfb0e Fix docker/journald logging conformance
See issue #86367
2020-02-07 16:04:27 -06:00
Kubernetes Prow Robot
8af70aeafc
Merge pull request #87390 from mattjmcnaughton/mattjmcnaughton/refactor-docker-specific-oom-out-of-qos-pkg
Refactor docker specific oom const out of qos pkg
2020-02-07 12:31:48 -08:00
marosset
999fdfaddf Calling hcsshim instead of docker api to get stats for windows to greatly reduce latency 2020-02-06 17:59:10 +00:00
Lee Verberne
d05bcf6800 Add namespace mode targeting to dockershim 2020-01-30 15:31:43 +01:00
mattjmcnaughton
73b2d83125
Refactor docker specific oom const out of qos pkg
Previously, `pkg/kubelet/qos` contained two different docker-specific
OOM constants. One set the oom adj for sandbox docker containers and the
other set the oom adj for the docker daemon. Move both to be closer to
their actual usages in `dockershim`.

This change addresses a TODO and leads us towards the overall goal of
making `pkg/kubelet` runtime agnostic except for `dockershim`.
2020-01-20 10:22:31 -05:00
Kubernetes Prow Robot
f4db8212be
Merge pull request #76496 from danielqsj/metrics-2
Clean deprecated metrics
2020-01-13 20:53:09 -08:00
Kubernetes Prow Robot
8467561f2c
Merge pull request #86783 from mattjmcnaughton/mattjmcnaughton/remove-unnecessary-modification-container-pid-namespace
Remove no longer needed `modifyContainerPIDNamespaceOverrides`
2020-01-10 15:43:50 -08:00
danielqsj
ab182552b4 clean SinceInMicroseconds, convert to SinceInSeconds 2020-01-10 17:05:38 +08:00
danielqsj
8ae3f80048 remove deprecated metrics of dockershim 2020-01-10 17:05:38 +08:00
Kubernetes Prow Robot
7a50fdb2a6
Merge pull request #85993 from chendotjs/fix-cidr
kubenet: replace gateway with cni result
2020-01-09 20:13:04 -08:00
Kubernetes Prow Robot
49e24adf3e
Merge pull request #86832 from mattjmcnaughton/mattjmcnaughton/remove-dead-code-in-fake-docker-client
Remove dead code in fake docker client
2020-01-07 07:36:18 -08:00
louisgong
324e5ce7e3 hollow-node use remote CRI 2020-01-07 11:00:45 +08:00