Commit Graph

8604 Commits

Author SHA1 Message Date
Kubernetes Prow Robot
036fcda230
Merge pull request #89412 from coderanger/fix-kubelet-method-metrics
Apply the same style of fix as #87913 but for HTTP methods too.
2020-05-18 17:43:36 -07:00
Kubernetes Prow Robot
f4112710f5
Merge pull request #90061 from marosset/runtimehandler-image-spec-annotations
Add annotations to CRI ImageSpec objects
2020-05-18 16:29:36 -07: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
Kubernetes Prow Robot
5bace30840
Merge pull request #91148 from liggitt/kubelet-client-metric
Add kubelet_certificate_manager_client_ttl_seconds gauge
2020-05-16 19:00:24 -07:00
Kubernetes Prow Robot
b170451caa
Merge pull request #90183 from dims/update-kubernetes-to-klog-v2
Update kubernetes to klog v2
2020-05-16 18:59:51 -07:00
Kubernetes Prow Robot
f011430e85
Merge pull request #84599 from mrobson/log-destroy
Errors from cgroup destroy are swallowed. Log error at warning level.
2020-05-16 18:59:36 -07:00
Amim Knabben
8459c9b6f4 Moving enable-server and provider-id 2020-05-16 21:34:13 -04:00
Kubernetes Prow Robot
cb493760d8
Merge pull request #89730 from saschagrunert/sprintf
Remove unnecessary sprintf in node status tests
2020-05-16 16:09:50 -07:00
Kubernetes Prow Robot
42fa1c081f
Merge pull request #88568 from RainbowMango/pr_cleanup_resource_metrics_ut
Clean up duplicate code and remove import cycle.
2020-05-16 16:09:36 -07:00
Kubernetes Prow Robot
9769e0f5da
Merge pull request #90008 from gavinfish/scheduler-utilparsers
Scheduler: remove direct import to /pkg/util/parsers
2020-05-16 07:35:49 -07:00
Kubernetes Prow Robot
ac5a6aced2
Merge pull request #89681 from iobuf/cleanup-kubelet
[pkg/kubelet]: make func a little comfortable
2020-05-16 07:35:36 -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
Davanum Srinivas
9006b2db69
Fix for API change in cadvisor
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-05-16 07:53:03 -04:00
Kubernetes Prow Robot
e5b8e3ae19
Merge pull request #91106 from RobbinBaauw/fix-fsstats-tag
Add inline tag to FsStats
2020-05-15 23:02:32 -07:00
Jordan Liggitt
2408d8101f Fix kubelet client certificate gauge 2020-05-15 12:57:34 -04:00
Kubernetes Prow Robot
8a9206c9b2
Merge pull request #91046 from wawa0210/remove-beta-os-label
kubelet no longer registers "beta.kubernetes.io/os" and "beta.kubernetes.io/arch" node labels to apiserver
2020-05-15 02:48:58 -07:00
Kubernetes Prow Robot
96e13de777
Merge pull request #88980 from tedyu/evict-delay-sorting
Delay sorting of evictUnits slice in kuberuntime_gc
2020-05-14 21:24:58 -07:00
Kubernetes Prow Robot
2b00dd8536
Merge pull request #90409 from rphillips/fixes/add_logging_around_pod_container_deletor
add logging around pod_container_deletor DeleteContainer
2020-05-14 13:38:58 -07:00
Robbin Baauw
77a2a72541
Add inline tag to FsStats
Co-authored-by: Victor Roest <victor@xirion.net>
2020-05-14 14:23:36 +02:00
Kubernetes Prow Robot
dc1934e078
Merge pull request #90477 from rphillips/feat/add_tracing_to_remote_runtime
kubelet: add remote_runtime tracing at log level 10
2020-05-14 00:46:22 -07:00
Kubernetes Prow Robot
f975b4b0df
Merge pull request #91066 from rphillips/fixes/exec-probe_log
kubelet: tweak exec-probe log statement to be more concise
2020-05-13 22:14:35 -07:00
Kubernetes Prow Robot
0d0c400715
Merge pull request #91004 from cwdsuzhou/May/relplace_log
Use klog to replace log to keep them in consistence
2020-05-13 15:59:33 -07: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
Kubernetes Prow Robot
2ca3347dc0
Merge pull request #90499 from knabben/kubelet-testing-flags
Deprecating Kubelet not used testing flags
2020-05-13 15:58:37 -07:00
Ryan Phillips
348d9941b1 kubelet: tweak exec-probe log statement to be more concise 2020-05-13 11:42:43 -05:00
wawa0210
54c0f8b677
Remove the 'beta' version of the node label (os and arch types) 2020-05-13 22:51:52 +08:00
Kubernetes Prow Robot
fb3009c3c0
Merge pull request #86034 from tahsinrahman/kubeletconfig-tests
Add tests for KubeletConfig
2020-05-13 00:18:26 -07:00
caiweidong
5ed8fb690c Use klog to replace log to keep them in consistence 2020-05-12 13:49:10 +08:00
Kubernetes Prow Robot
e26af96b8e
Merge pull request #90951 from mattjmcnaughton/mattjmcnaughton/clarify-dockershim-no-docker-error-message
Clarify `kubelet_dockershim_nodocker` error message
2020-05-11 18:08:42 -07:00
Kubernetes Prow Robot
751fe16b93
Merge pull request #90927 from BenTheElder/unit-shmunit
remove oom TestStartingWatcher ""unit"" test
2020-05-11 18:08:28 -07:00
Tim Allclair
029a144ae9 Remove tallclair from some OWNERS files 2020-05-11 11:44:38 -07:00
mattjmcnaughton
1a63e6fead
Clarify kubelet_dockershim_nodocker error message
Clarify the error message returned when trying to use the docker runtime
on a Kubelet that was compiled without Docker.

We removed the "w/" and "w/o", which can be confusing abbreviations, and
also add slightly more detail on the actual error.
2020-05-10 10:22:56 -04:00
Kubernetes Prow Robot
ba35704b51
Merge pull request #81443 from mikedanese/socks5
rest.Config: support configuring an explict proxy URL
2020-05-10 06:05:50 -07:00
Paulo Gomes
6db5b5c50f
Add seccomp least privilege for docker sandbox 2020-05-10 11:52:42 +01:00
Kubernetes Prow Robot
423c17d859
Merge pull request #90086 from rvillablanca/fix/handle-error-parseform
Handling error returned by request.Request.ParseForm()
2020-05-09 22:07:50 -07:00
Benjamin Elder
c6c68a73e1 remove oom TestStartingWatcher ""unit"" test 2020-05-08 23:25:28 -07:00
Md Tahsin Rahman
ea15f60328 Add tests for KubeletConfig 2020-05-09 00:06:16 +08:00
mattjmcnaughton
49fc82f7ab
Ensure we only run the cadvisor/docker init in !dockerless
We do not want to run the `cadvisor/docker` init when we are using the
dockerless build tags. We can ensure this by isolating into a separate
file with the proper build tag constraints.
2020-05-07 17:18:51 -04: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
34c8f51dcb
Remove all uses of dockershim from cmd/kubelet
We can remove all uses of `dockershim` from `cmd/kubelet`, by just
passing the docker options to the kubelet in their pure form, instead of
using them to create a `dockerClientConfig` (which is defined in
dockershim). We can then construct the `dockerClientConfig` only when we
actually need it.
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
mattjmcnaughton
53adde65ce
Remove ExperimentalDockershim from kubelet
Remove one of two uses of Dockershim in `cmd/kubelet`. The other is for
creating a docker client which we pass to the Kubelet... we will handle
that refactor in a separate diff.

I'm fairly confident, though need to double check, that no one is
actually using this experimental dockershim behavior. If they are, I
think we will want to find a new way to support it (that doesn't require
using the Kubelet only to launch Dockershim).
2020-05-07 17:18:48 -04:00
Mike Danese
652a48d2e7 wire up proxier in spdy transport
and delete useless function
2020-05-07 09:13:58 -07:00
Kubernetes Prow Robot
dc6c640a12
Merge pull request #90375 from cici37/removeConfigz
move pkg/util/configz to k8s.io/component-base
2020-05-04 13:46:09 -07: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
Kubernetes Prow Robot
f372c5417b
Merge pull request #90628 from liggitt/pod-ip-status
Fix podIP validation
2020-04-30 19:30:07 -07:00
Amim Knabben
fe9eb1ba46 Migrating Kubelet testing flags to configuration 2020-04-30 22:12:39 -04:00
Jordan Liggitt
23e9fb1bb5 Fix podIP validation 2020-04-30 19:49:45 -04:00
cici37
7f4d19167e Move pkg/util/configz to k8s.io/component-base 2020-04-29 12:17:25 -07:00
Kubernetes Prow Robot
961a5ed144
Merge pull request #90380 from spiffxp/import-boss-test-files
Update import-boss files to yaml, include test files in CI job
2020-04-28 15:58:24 -07:00
Kubernetes Prow Robot
f7907083c2
Merge pull request #89160 from tedyu/symlink-first-seen
Remove potentially unhealthy symlink only for dead containers
2020-04-28 09:58:07 -07:00
Aaron Crickenberger
a7af20922f use forbiddenPrefixes instead of allowedPrefixes 2020-04-28 08:41:36 -07:00
Aaron Crickenberger
f306a0dbb4 convert .import-restrictions to yaml
yaml has comments, so we can explain why we have certain rules or
certain prefixes

for those files that weren't already commented yaml, I converted them to
yaml and took a best guess at comments based on the PRs that introduced
or updated them
2020-04-28 08:41:36 -07:00
Kubernetes Prow Robot
7fdc1275d9
Merge pull request #90377 from cbf123/container_cpuset_fixup_2
Fix exclusive CPU allocations being deleted at container restart
2020-04-27 13:40:04 -07:00
Kubernetes Prow Robot
561b2aba94
Merge pull request #90419 from klueska/upstream-update-reusable-cpus-strategy
Update strategy used to reuse CPUs from init containers in CPUManager
2020-04-27 12:09:23 -07:00
Chris Friesen
ab5870d808 Fix exclusive CPU allocations being deleted at container restart
The expectation is that exclusive CPU allocations happen at pod
creation time. When a container restarts, it should not have its
exclusive CPU allocations removed, and it should not need to
re-allocate CPUs.

There are a few places in the current code that look for containers
that have exited and call CpuManager.RemoveContainer() to clean up
the container.  This will end up deleting any exclusive CPU
allocations for that container, and if the container restarts within
the same pod it will end up using the default cpuset rather than
what should be exclusive CPUs.

Removing those calls and adding resource cleanup at allocation
time should get rid of the problem.

Signed-off-by: Chris Friesen <chris.friesen@windriver.com>
2020-04-27 11:36:54 -06:00
drfish
0b715ea690 Scheduler: remove direct import to /pkg/util/parsers 2020-04-26 23:41:52 +08:00
Ryan Phillips
aecddc9f13 kubelet: add remote_runtime tracing at log level 10 2020-04-24 17:37:27 -05:00
Kubernetes Prow Robot
7297fbd0ce
Merge pull request #90413 from PurelyApplied/nil-expiry
Improve error message when refresh token expiry is nil.
2020-04-24 15:32:07 -07:00
Kubernetes Prow Robot
f8297af392
Merge pull request #90284 from wawa0210/kubelet-nodename-clean
Remove duplicate calculation nodename、hostname、hostnameOverridden when kubelet is initialized
2020-04-24 12:15:34 -07:00
Kubernetes Prow Robot
30cefca5a6
Merge pull request #89128 from vincent178/move-runonce-kubeletconfiguration
move runonce from flag to config
2020-04-23 17:20:07 -07:00
wawa0210
40da2c521a
Remove duplicate calculation nodename 、hostname 、hostnameOverridden 2020-04-24 07:49:33 +08:00
Patrick Rhomberg
5ea1cef4c5 gofmt fix. 2020-04-23 23:32:04 +00:00
Patrick Rhomberg
a262b2762a Improve error message when refresh token expiry is nil.
Add test coverage for this case.
2020-04-23 20:52:58 +00:00
Kevin Klues
751b9f3e13 Update strategy used to reuse CPUs from init containers in CPUManager
With the old strategy, it was possible for an init container to end up
running without some of its CPUs being exclusive if it requested more
guaranteed CPUs than the sum of all guaranteed CPUs requested by app
containers. Unfortunately, this case was not caught by our unit tests
because they didn't validate the state of the defaultCPUSet to ensure
there was no overlap with CPUs assigned to containers. This patch
updates the strategy to reuse the CPUs assigned to init containers
across into app containers, while avoiding this edge case. It also
updates the unit tests to now catch this type of error in the future.
2020-04-23 20:27:43 +00:00
Ryan Phillips
a464299e97 add logging around pod_container_deletor DeleteContainer 2020-04-23 09:54:01 -05:00
Kubernetes Prow Robot
3e2ae631b4
Merge pull request #90209 from ZP-AlwaysWin/dev
Repair description
2020-04-23 03:57:59 -07:00
Kubernetes Prow Robot
168686a0ab
Merge pull request #90314 from tangcong/fix-kubelet-staticcheck-err
fix kubelet stats staticcheck error
2020-04-21 20:56:05 -07:00
Ted Yu
18e9f33fc6 Remove unhealthy symlink only for dead containers
Signed-off-by: Ted Yu <yuzhihong@gmail.com>
2020-04-21 12:30:51 -07:00
Kubernetes Prow Robot
13561c94e5
Merge pull request #90289 from tanjunchen/fix-comment-20200420
pkg/kubelet/remote/remote_runtime.go:fix the incorrect klog comment
2020-04-21 09:17:27 -07:00
tangcong
2b984b3e3a fix kubelet stats staticcheck error 2020-04-21 07:16:58 +08:00
Kubernetes Prow Robot
d92fdebd85
Merge pull request #89897 from giuseppe/test-e2e-node
kubelet: fix e2e-node cgroups test on cgroup v2
2020-04-20 15:54:12 -07:00
marosset
90367729a3 Adding/updating kubelet/kuberuntime tests 2020-04-20 22:25:05 +00:00
tanjunchen
21039d5bd3 pkg/kubelet/remote/remote_runtime.go:fix the incorrect klog comment 2020-04-20 09:55:40 +08:00
Gaurav Singh
5ed70c66e8 [kubelet] nodestatus: remove slice nil check 2020-04-19 11:16:21 -04:00
marosset
03479e4d12 kubelet - adding pod annotations to various image calls to get runtime-handler info to CRI 2020-04-17 23:57:09 +00:00
ZP-AlwaysWin
5796b7a32e Repair description 2020-04-17 09:36:38 +08:00
Rodrigo Villablanca
1014d307a5 After run ./hack/update-bazel.sh 2020-04-15 09:24:54 -04:00
Kubernetes Prow Robot
d0183703cb
Merge pull request #90059 from ahg-g/ahg-nodeinfo2
Cleanup obsolete NodeInfo methods
2020-04-14 17:32:04 -07:00
Kubernetes Prow Robot
6c499314cd
Merge pull request #88480 from savitharaghunathan/kubelet_flag_migration_1
Kubelet flag migration - Part 1
2020-04-14 12:33:39 -07:00
Abdullah Gharaibeh
d6522e0e74 rename framework pkg with schedulerframework for all instances under pkg/kubelet 2020-04-14 14:24:07 -04:00
Kubernetes Prow Robot
105c0c6951
Merge pull request #88970 from mysunshine92/correct-NodeAllocatableRoot
fix function NodeAllocatableRoot
2020-04-14 11:04:13 -07:00
Kubernetes Prow Robot
342d328064
Merge pull request #89934 from tedyu/unregister-plugin
Simplify the unregistration of csiplugin
2020-04-13 16:21:11 -07:00
Ted Yu
1001be85ad Simplify unregistration of csiplugin
Signed-off-by: Ted Yu <yuzhihong@gmail.com>
2020-04-13 15:04:52 -07:00
vincent178
745b742de5 move runonce from flag to config 2020-04-14 06:00:43 +08:00
Keerthan Reddy,Mala
9b9cf33771 fake remote runtime should call correct method on remove pod sandbox 2020-04-13 14:36:35 -07:00
Keerthan Reddy,Mala
70e2559aca use runtime sandbox status instead of calling cri 2020-04-13 14:36:34 -07:00
Keerthan Reddy,Mala
c24349e9f2 update the build file for bazel 2020-04-13 14:36:34 -07:00
Keerthan Reddy,Mala
1e42737e58 add unit tests 2020-04-13 14:36:34 -07:00
Keerthan Reddy,Mala
aae8a2847a Check for sandboxes before deleting the pod from apiserver 2020-04-13 14:36:34 -07:00
Rodrigo Villablanca
ae603b8ef1 Add some testing 2020-04-13 12:47:07 -04:00
Rodrigo Villablanca
0972c9ba4d Improvements 2020-04-13 12:47:07 -04:00
Rodrigo Villablanca
a68482290d Handling error returned by request.Request.ParseForm() 2020-04-13 12:47:07 -04: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
Abdullah Gharaibeh
bed9b2f23b Cleanup obsolete NodeInfo methods 2020-04-12 18:13:46 -04: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
Giuseppe Scrivano
26d94ad628
kubelet: do not configure the device cgroup
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-04-09 16:18:06 +02:00
Giuseppe Scrivano
a9772b2290
kubelet: adapt cgroup_manager to cgroup v2
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-04-09 16:18:04 +02:00
Giuseppe Scrivano
6d16fee229
kubelet: cpu hard capping is supported on cgroup v2
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-04-09 16:18:03 +02:00
Kubernetes Prow Robot
a34b914e82
Merge pull request #89921 from fromanirh/cpumanager-checkpoint
cpumanager: drop old custom file backend
2020-04-08 13:37:58 -07:00
Kubernetes Prow Robot
7061dddf26
Merge pull request #88521 from mattjmcnaughton/mattjmcnaughton/add-error-testing-image-service
Add error path testing to image handling by `kubeGenericRuntimeManager`
2020-04-07 22:45:43 -07:00
Francesco Romani
623587ec8b cpumanager: test: add missing helper
add back the missing AssertStateEqual helper;
it is needed by some tests we still want to run.

Signed-off-by: Francesco Romani <fromani@redhat.com>
2020-04-07 16:59:07 +02:00
Francesco Romani
be0fe3df9b cpumanager: drop old custom file backend
The cpumanager file-based state backend was obsoleted since few
releases, aving the cpumanager moved to the checkpointmanager common
infrastructure.
The old test checking compatibility to/from the old format is
also no longer needed, because the checkpoint format is stable
(see
https://github.com/kubernetes/kubernetes/tree/master/pkg/kubelet/checkpointmanager).

Signed-off-by: Francesco Romani <fromani@redhat.com>
2020-04-07 13:24:48 +02:00
Kubernetes Prow Robot
037db1cb6c
Merge pull request #89687 from dims/update-docker-dependency
Update docker dependency and remove deprecated method use
2020-04-06 15:42:14 -07:00
Kubernetes Prow Robot
8cdf21ab4c
Merge pull request #86409 from sshukun/fix-golint
Fix go-lint issues in package pkg/kubelet/checkpointmanager/testing/example_checkpoint_formats/v1
2020-04-06 15:42:01 -07:00
Kubernetes Prow Robot
0d8b4b5df4
Merge pull request #85994 from coderanger/patch-1
Tiny typo in a comment.
2020-04-06 15:41:47 -07:00
Kubernetes Prow Robot
9441df3aad
Merge pull request #89808 from fuweid/close-resize-chan
remotecommand: close resize channel for notification
2020-04-06 13:47:46 -07:00
Wei Fu
d2b59f10c5 remotecommand: close resize channel for notification
Remotecommand package should notify executor by closing resizeChan.

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2020-04-06 23:32:23 +08: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
b030be376b
Merge pull request #89581 from Wenfeng-GAO/simplify
simplify code in topologymanager
2020-04-02 23:07:46 -07:00
Kubernetes Prow Robot
adcbe470d7
Merge pull request #89619 from mattjmcnaughton/mattjmcnaughton/delete-unused-builder-type
Delete unused `Builder` type from `kubelet.go`
2020-04-02 21:40:31 -07:00
Kubernetes Prow Robot
69681d7df8
Merge pull request #89286 from uzuku/mar-fix-nil-pointer-in-format
Handle nil pod in pod format
2020-04-02 19:04:00 -07:00
Kubernetes Prow Robot
4e6a12223b
Merge pull request #89567 from giuseppe/cgroupv2-unit-test
kubelet: add tests for cgroup v2 conversions
2020-04-02 12:42:52 -07:00
Kubernetes Prow Robot
bbe5594409
Merge pull request #89296 from danwinship/random-emptily
Don't log whether we're using iptables --random-fully
2020-04-02 12:42:24 -07:00
Noah Kantrowitz
14969831e9 Apply the same style of fix as #87913 but for HTTP methods too.
Go does not validate HTTP methods beyond len!=0 and that they don't contain HTTP meta chars like a newline. Also to using string sets instead of maps.
2020-04-02 02:15:04 -07:00
Sascha Grunert
2dfb22b5b7
Remove unnecessary sprintf in node status tests
There is no invocation to sprintf needed for those strings so we can
remove them.

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2020-04-01 14:16:28 +02:00
Andrew Sy Kim
e2bc3a755f
move well-known kubelet cloud provider annotations to k8s.io/cloud-provider (#88631)
* move well-known kubelet cloud provider annotations to k8s.io/cloud-provider

Signed-off-by: andrewsykim <kim.andrewsy@gmail.com>

* cloud provider: rename AnnotationProvidedIPAddr to AnnotationAlphaProvidedIPAddr to indicate alpha status

Signed-off-by: Andrew Sy Kim <kim.andrewsy@gmail.com>
2020-03-31 23:01:27 -07:00
Kubernetes Prow Robot
357d3c9f93
Merge pull request #89584 from kevtaylor/kep/VolumeSubpathExpansion-Remove-FeatureGate
Remove VolumeSubpathEnvExpansion Feature Gate
2020-03-31 20:03:27 -07:00
Kubernetes Prow Robot
1168b4b812
Merge pull request #88006 from tedyu/socket-path
Unregister csiplugin even if socket path is gone
2020-03-31 10:54:40 -07:00
Ted Yu
c7bde41478 Unregister csiplugin even if socket path is gone
Signed-off-by: Ted Yu <yuzhihong@gmail.com>
2020-03-31 06:57:05 -07:00
Zhou Peng
930bedf144 [pkg/kubelet]: make func a little comfortable
This func has only 1 argument, don't wrap it across multiple lines

Signed-off-by: Zhou Peng <p@ctriple.cn>
2020-03-31 16:47:32 +08:00
Davanum Srinivas
a1bceb8915
add import restrictions
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-03-30 10:45:22 -04:00
Davanum Srinivas
765e926d35
Avoid using internal packages for streaming/ package
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-03-29 18:42:27 -04:00
mattjmcnaughton
6b5b8bb186
Delete unused Builder type from kubelet.go
As far as I can tell, nothing uses this type. As a result, it doesn't
really provide any benefit, and just clutters `kubelet.go`.

There's also the risk of it falling out of date with `NewMainKubelet`,
as nothing enforces `NewMainKubelet` being of the `Builder` type.
2020-03-28 20:04:58 -04:00
Kubernetes Prow Robot
fca2963aa2
Merge pull request #89540 from dashpole/fix_metric
Fix cpu resource metric type by changing to counter
2020-03-27 14:36:07 -07:00
Kevin Taylor
9fd48b4039 Remove VolumeSubpathEnvExpansion Feature Gate 2020-03-27 16:28:33 +00:00
Wenfeng-GAO
1aebbee7da simplify code in topologymanager 2020-03-28 00:04:51 +08:00
Giuseppe Scrivano
c4429d8bd4
kubelet: add tests for cgroup v2 conversions
follow-up for https://github.com/kubernetes/kubernetes/pull/85218

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-03-27 13:50:57 +01:00
Kubernetes Prow Robot
708dd2ea7a
Merge pull request #89308 from zshihang/sync
sync api/v1/pod/util with api/pod/util
2020-03-26 14:10:49 -07:00
Kubernetes Prow Robot
34c8b26c9f
Merge pull request #85218 from giuseppe/cgroupv2
kubelet: add initial support for cgroupv2
2020-03-26 14:10:23 -07:00
David Ashpole
86192d4b9a fix cpu resource metric type by changing to counter 2020-03-26 13:30:36 -07:00
Kubernetes Prow Robot
4488fd4749
Merge pull request #89053 from bg-chun/move_package
migration of re-usable package from pkg/kubelet/cm/cpumanager to pkg/kubelet/cm
2020-03-26 11:14:09 -07:00
yameiwang
6783f991c3 fix function NodeAllocatableRoot 2020-03-26 18:48:05 +08:00
Shihang Zhang
b56da85a77 sync api/v1/pod/util with api/pod/util and remove DefaultContainers 2020-03-24 16:42:32 -07:00
Kubernetes Prow Robot
89dfebb214
Merge pull request #89359 from gongguan/process
eviction by process number
2020-03-24 15:27:25 -07:00
Kubernetes Prow Robot
f321d0ed12
Merge pull request #89361 from fuweid/me-use-statsfunc
eviction: use previous statsFunc
2020-03-24 00:28:46 -07:00
Kubernetes Prow Robot
907d4c1bb9
Merge pull request #89381 from dashpole/comment_disable_readonly
Add comment explaining when to remove cadvisor json endpoints
2020-03-23 20:31:19 -07:00
louisgong
e56d40d048 remove unused param 2020-03-24 09:25:04 +08:00
louisgong
0efb70c0a2 eviction by process number 2020-03-24 09:25:04 +08:00
David Ashpole
b4ed7273da add comment explaining when to remove the --enable-cadvisor-json-endpoints 2020-03-23 12:52:00 -07:00
Wei Fu
a809aaf03d eviction: use previous statsFunc
No need to use summary to create statsFunc for localStorageEviction.
Just use vals from makeSignalObservations.

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2020-03-23 19:11:17 +08:00
Dan Winship
8edd656238 Don't log whether we're using iptables --random-fully 2020-03-20 08:06:27 -04:00
Uzuku
302cda742a Handle nil pod in pod format 2020-03-20 15:30:44 +08:00
Kubernetes Prow Robot
e74ad38854
Merge pull request #89013 from dims/copy-jsonlog-from-docker/docker-locally
Copy jsonlog from docker/docker locally
2020-03-19 12:08:37 -07: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
Odin Ugedal
2830827442
Add support for removing unsupported huge page sizes
When kubelet is restarted, it will now remove the resources for huge
page sizes no longer supported. This is required when:
- node disables huge pages
- changing the default huge page size in older versions of linux
(because it will then only support the newly set default).
- Software updates that change what sizes are supported (eg. by changing
boot parameters).
2020-03-19 13:08:08 +01:00
Kubernetes Prow Robot
34ad7d1984
Merge pull request #88450 from shikanon/fix/golintTypo
fix typos error in handlers_test.go file
2020-03-18 14:24:44 -07:00
Kubernetes Prow Robot
0c8ac83e04
Merge pull request #88871 from dashpole/fix_oom
Use the container whose limit is hit for system OOMs
2020-03-17 19:27:54 -07:00
Davanum Srinivas
825f99c396
run update-vendor.sh
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-03-17 21:26:07 -04:00
Davanum Srinivas
0c52ffe08f
make local copy of JSONLog
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-03-17 21:25:55 -04: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
Kubernetes Prow Robot
ffc87f2d0c
Merge pull request #88266 from mattjmcnaughton/mattjmcnaughton/delete-pluginwatcher-DOS-TODO
Delete TODO around implementing rate limiting to protect against DOS
2020-03-17 16:20:34 -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
Eric Mountain
22e0ee768b Removes container RefManager 2020-03-16 14:30:57 +01:00
Byonggon Chun
a3047672d0 move pkg/kubelet/cm/cpumanager/containermap to pkg/kubelet/cm/containermap for reusing
containerMap is used in CPU Manager to store all containers information in the node.
containerMap provides a mapping from (pod, container) -> containerID for all containers a pod
It is reusable in another component in pkg/kubelet/cm which needs to track changes of all containers in the node.

Signed-off-by: Byonggon Chun <bg.chun@samsung.com>
2020-03-14 02:38:51 +09:00
Giuseppe Scrivano
bb5ed1b797
kubelet: add initial support for cgroupv2
do a conversion from the cgroups v1 limits to cgroups v2.

e.g. cpu.shares on cgroups v1 has a range of [2-262144] while the
equivalent on cgroups v2 is cpu.weight that uses a range [1-10000].

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-03-12 08:50:19 +01:00
Kubernetes Prow Robot
562a420d86
Merge pull request #88915 from roycaihw/fix/image-manager-data-race
Fix a data race in kubelet image manager
2020-03-11 15:04:37 -07:00
Kubernetes Prow Robot
a37d68ec05
Merge pull request #88917 from adelina-t/fix_pod_admit_handler
Implement noopWindowsResourceAllocator
2020-03-11 07:45:37 -07:00
Kubernetes Prow Robot
7989ca4324
Merge pull request #88734 from joelsmith/master
Work-around for missing memory metrics on CRI-O exited containers
2020-03-10 16:21:36 -07:00
Haowei Cai
462b75388f let image cache do sort on write instead of on read to avoid data
race and improve efficienty
2020-03-10 15:33:34 -07:00
Adelina Tuvenie
a9f834d17d Implement noopWindowsResourceAllocator
On Windows, the podAdmitHandler returned by the GetAllocateResourcesPodAdmitHandler() func
and registered by the Kubelet is nil.

We implement a noopWindowsResourceAllocator that would admit any pod for Windows in order
to be consistent with the original implementation.
2020-03-10 21:32:23 +01:00
Savitha Raghunathan
3234d34714 moving volume plugin dir to kubelet config - part 1 2020-03-10 16:22:29 -04:00
Clayton Coleman
c26653ced9
kubelet: Also set PodIPs when assign a host network PodIP
When we clobber PodIP we should also overwrite PodIPs and not rely
on the apiserver to fix it for us - this caused the Kubelet status
manager to report a large string of the following warnings when
it tried to reconcile a host network pod:

```
 I0309 19:41:05.283623    1326 status_manager.go:846] Pod status is inconsistent with cached status for pod "machine-config-daemon-jvwz4_openshift-machine-config-operator(61176279-f752-4e1c-ac8a-b48f0a68d54a)", a reconciliation should be triggered:
   &v1.PodStatus{
           ... // 5 identical fields
           HostIP:                "10.0.32.2",
           PodIP:                 "10.0.32.2",
 -         PodIPs:                []v1.PodIP{{IP: "10.0.32.2"}},
 +         PodIPs:                []v1.PodIP{},
           StartTime:             s"2020-03-09 19:41:05 +0000 UTC",
           InitContainerStatuses: nil,
           ... // 3 identical fields
   }
```

With the changes to the apiserver, this only happens once, but it is
still a bug.
2020-03-09 18:15:32 -04:00
zyu
78e2668539 Delay sorting of evictUnits slice in kuberuntime_gc
Signed-off-by: zyu <yuzhihong@gmail.com>
2020-03-09 12:24:42 -07:00
Kubernetes Prow Robot
ef672c1c2d
Merge pull request #88678 from verult/slow-rxm-attach
Parallelize attach operations across different nodes for volumes that allow multi-attach
2020-03-06 13:17:21 -08:00
David Ashpole
fc6b4719fd Use the container whose limit is hit for system OOMs 2020-03-06 11:06:16 -08:00
Christian Huffman
c6fd25d100 Updated CSIDriver references 2020-03-06 08:21:26 -05:00
Kubernetes Prow Robot
5708511499
Merge pull request #88708 from mikedanese/deleteopts
Migrate clientset metav1.DeleteOpts to pass-by-value
2020-03-05 23:09:23 -08:00
Cheng Xing
ef3d66b98b Parallelize attach operations across different nodes for volumes that allow multi-attach 2020-03-05 22:22:05 -08:00
Kubernetes Prow Robot
cd0057c16a
Merge pull request #88876 from nolancon/none-policy-fix
Topology Manager none policy bug fix
2020-03-05 21:40:33 -08:00
Kubernetes Prow Robot
e90c908f64
Merge pull request #88141 from tedyu/pvc-being-del
Don't try to create VolumeSpec immediately after underlying PVC is being deleted
2020-03-05 21:39:23 -08:00
Kubernetes Prow Robot
ce01a9bad0
Merge pull request #88857 from nolancon/test-fix
Check for nil cpuManager in container manager
2020-03-05 20:05:14 -08:00
Kubernetes Prow Robot
48541a0b16
Merge pull request #87650 from nolancon/beta-feature-gate
Update TopologyManager Feature Gate
2020-03-05 20:03:04 -08:00
Ted Yu
723761aa88 Don't try to create VolumeSpec immediately after underlying PVC is being deleted
Signed-off-by: Ted Yu <yuzhihong@gmail.com>
2020-03-05 16:45:50 -08:00
Mike Danese
76f8594378 more artisanal fixes
Most of these could have been refactored automatically but it wouldn't
have been uglier. The unsophisticated tooling left lots of unnecessary
struct -> pointer -> struct transitions.
2020-03-05 14:59:47 -08:00
Mike Danese
c58e69ec79 automated refactor 2020-03-05 14:59:46 -08:00
Joel Smith
da988294ec Work-around for missing metrics on CRI-O exited containers
HPA needs metrics for exited init containers before it will
take action. By setting memory and CPU usage to zero for any
containers that cAdvisor didn't provide statistics for, we
are assured that HPA will be able to correctly calculate
pod resource usage.
2020-03-05 13:20:43 -07:00
nolancon
0551d408ac Bug fix for TM none policy 2020-03-05 14:25:48 +00:00
nolancon
4baa1d967d Check for nil cpuManager 2020-03-05 07:54:33 +00:00
Kubernetes Prow Robot
7a513b575a
Merge pull request #88440 from smarterclayton/container_success_fix
Ensure Kubelet always reports terminating pod container status
2020-03-04 20:13:04 -08:00
Kubernetes Prow Robot
ac32644d6e
Merge pull request #87759 from klueska/upstream-move-cpu-allocation-to-pod-admit
Guarantee aligned resources across containers
2020-03-04 20:12:37 -08:00
Clayton Coleman
8bc5cb01a9
kubelet: Clear the podStatusChannel before invoking syncBatch
The status manager syncBatch() method processes the current state
of the cache, which should include all entries in the channel. Flush
the channel before we call a batch to avoid unnecessary work and
to unblock pod workers when the node is congested.

Discovered while investigating long shutdown intervals on the node
where the status channel stayed full for tens of seconds.

Add a for loop around the select statement to avoid unnecessary
invocations of the wait.Forever closure each time.
2020-03-04 13:34:25 -05:00
Clayton Coleman
8722c834e5
kubelet: Never restart containers in deleting pods
When constructing the API status of a pod, if the pod is marked for
deletion no containers should be started. Previously, if a container
inside of a terminating pod failed to start due to a container
runtime error (that populates reasonCache) the reasonCache would
remain populated (it is only updated by syncPod for non-terminating
pods) and the delete action on the pod would be delayed until the
reasonCache entry expired due to other pods.

This dramatically reduces the amount of time the Kubelet waits to
delete pods that are terminating and encountered a container runtime
error.
2020-03-04 13:34:25 -05:00
Yu-Ju Hong
2364c10e2e
kubelet: Don't delete pod until all container status is available
After a pod reaches a terminal state and all containers are complete
we can delete the pod from the API server. The dispatchWork method
needs to wait for all container status to be available before invoking
delete. Even after the worker stops, status updates will continue to
be delivered and the sync handler will continue to sync the pods, so
dispatchWork gets multiple opportunities to see status.

The previous code assumed that a pod in Failed or Succeeded had no
running containers, but eviction or deletion of running pods could
still have running containers whose status needed to be reported.

This modifies earlier test to guarantee that the "fallback" exit
code 137 is never reported to match the expectation that all pods
exit with valid status for all containers (unless some exceptional
failure like eviction were to occur while the test is running).
2020-03-04 13:34:25 -05:00
Clayton Coleman
ad3d8949f0
kubelet: Preserve existing container status when pod terminated
The kubelet must not allow a container that was reported failed in a
restartPolicy=Never pod to be reported to the apiserver as success.
If a client deletes a restartPolicy=Never pod, the dispatchWork and
status manager race to update the container status. When dispatchWork
(specifically podIsTerminated) returns true, it means all containers
are stopped, which means status in the container is accurate. However,
the TerminatePod method then clears this status. This results in a
pod that has been reported with status.phase=Failed getting reset to
status.phase.Succeeded, which is a violation of the guarantees around
terminal phase.

Ensure the Kubelet never reports that a container succeeded when it
hasn't run or been executed by guarding the terminate pod loop from
ever reporting 0 in the absence of container status.
2020-03-04 13:34:24 -05:00
Kubernetes Prow Robot
9d0cbb7503
Merge pull request #88673 from jsafrane/block-feature-ga
Promote block volumes to GA
2020-03-03 12:17:12 -08:00
Kubernetes Prow Robot
06b798781a
Merge pull request #88591 from smarterclayton/status_update
kubelet: Avoid sending no-op patches
2020-03-03 09:43:38 -08:00
Jan Safranek
3af671011a Generated API 2020-03-02 22:21:42 +01:00
Jan Safranek
8536787133 Add unit tests 2020-03-02 12:54:02 +01:00
nolancon
e8538d9b76 Add mutex to Topology Manager Add/RemoveContainer
This was exposed as a potential bug during e2e test debugging of this
PR.
2020-03-02 04:07:21 +00:00
nolancon
1e613e5a4c Update TopologyManager Feature Gate:
- Alpha to Beta.
- True by default.
- Remove redundant validation checks.
2020-03-02 03:32:05 +00:00
Rob Scott
132d2afca0
Adding IngressClass to networking/v1beta1
Co-authored-by: Christopher M. Luciano <cmluciano@us.ibm.com>
2020-03-01 18:17:09 -08:00
Jan Safranek
2c1b743766 Promote block volume features to GA 2020-02-28 20:48:38 +01:00
James Munnelly
d5dae04898 certificates: update controllers to understand signerName field
Signed-off-by: James Munnelly <james.munnelly@jetstack.io>
2020-02-27 15:54:31 +00:00