Commit Graph

2136 Commits

Author SHA1 Message Date
Adrian Reber
fc37a7a990
kubelet: wire checkpoint container support through
This adds the last pieces to wire through the container checkpoint
support in the kubelet.

Signed-off-by: Adrian Reber <areber@redhat.com>
2022-07-14 10:27:41 +00:00
Adrian Reber
564f0e9a25
kubelet: add checkpoint/restore infrastructure
This adds the first infrastructure code parts to the kubelet
to support checkpoint/restore.

Signed-off-by: Adrian Reber <areber@redhat.com>
2022-07-14 10:27:40 +00:00
Patrick Ohly
65385fec20 kubelet: convert node shutdown manager to contextual logging
This will make output checking easier (done in a separate commit). kubelet
itself still uses the global logger.
2022-06-24 11:20:34 +02:00
Ryan Phillips
230124f3d4 kubelet: add e2e test to verify probe readiness 2022-06-06 17:00:55 -05:00
Clayton Coleman
1d518adb76 kubelet: Pod probes should be handled by pod worker
The pod worker is the owner of when a container is running or not,
and the start and stop of the probes for a given pod should be
handled during the pod sync loop. This ensures that probes do not
continue running even after eviction.

Because the pod semantics allow lifecycle probes to shorten grace
period, the probe is removed after the containers in a pod are
terminated successfully. As an optimization, if the pod will have
a very short grace period (0 or 1 seconds) we stop the probes
immediately to reduce resource usage during eviction slightly.

After this change, the probe manager is only called by the pod
worker or by the reconcile loop.
2022-06-06 17:00:54 -05:00
Jordan Liggitt
410ac59c0d Remove PodSecurityPolicy admission plugin 2022-05-04 16:00:56 -04:00
Kubernetes Prow Robot
a6e65a246c
Merge pull request #107986 from wzshiming/promote/shutdown-based-on-pod-priority
Promote graceful shutdown based on pod priority to beta
2022-03-23 08:06:09 -07:00
Clayton Coleman
69a3820214
kubelet: Delay writing a terminal phase until the pod is terminated
Other components must know when the Kubelet has released critical
resources for terminal pods. Do not set the phase in the apiserver
to terminal until all containers are stopped and cannot restart.

As a consequence of this change, the Kubelet must explicitly transition
a terminal pod to the terminating state in the pod worker which is
handled by returning a new isTerminal boolean from syncPod.

Finally, if a pod with init containers hasn't been initialized yet,
don't default container statuses or not yet attempted init containers
to the unknown failure state.
2022-03-16 13:15:00 -04:00
Shiming Zhang
5eb3e88f6b Support metrics for node shutdown 2022-03-11 17:31:10 +08:00
Kubernetes Prow Robot
06e107081e
Merge pull request #104732 from mengjiao-liu/remove-flag-experimental-check-node-capabilities-before-mount
kubelet: Remove the deprecated flag `--experimental-check-node-capabilities-before-mount`
2022-02-24 07:56:30 -08:00
Kubernetes Prow Robot
1659924a97
Merge pull request #108070 from jsafrane/remove-selinux
Remove util/selinux package
2022-02-11 18:19:47 -08:00
Jan Safranek
77aa06d0c8 Remove util/selinux package
The package says:

> the libcontainer SELinux package is only built for Linux, so it is
> necessary to have a NOP wrapper which is built for non-Linux platforms

This is not true, Kubernetes now imports
github.com/opencontainers/selinux/go-selinux and it has proper
multiplatform support (i.e. NOOP on non-Linux platforms).

Removing the whole package and calling go-selinux directly.
2022-02-11 15:20:35 +01:00
Ciprian Hacman
0819451ea6 Clean up logic for deprecated flag --container-runtime in kubelet
Signed-off-by: Ciprian Hacman <ciprian@hakman.dev>
2022-02-10 13:26:59 +02:00
Kubernetes Prow Robot
8d01b02c60
Merge pull request #107096 from hakman/remove_non-masquerade-cidr
Remove deprecated flag --non-masquerade-cidr in kubelet
2022-02-08 12:42:50 -08:00
Kubernetes Prow Robot
4dba52cdf4
Merge pull request #107821 from liggitt/kubelet-secret-manager
Move kubelet secret and configmap manager calls to sync_Pod functions
2022-01-27 08:26:58 -08:00
Jordan Liggitt
085693eff2 Move kubelet secret and configmap manager calls to sync_Pod functions 2022-01-27 10:09:13 -05:00
Marcel Zięba
b4b4b8fd6d Use FakeProber in kubemark clusters 2022-01-26 09:29:04 +00:00
Sergey Kanzhelev
7e7bc6d53b remove DynamicKubeletConfig logic from kubelet 2022-01-19 22:38:04 +00:00
Ciprian Hacman
21809043b5 Remove deprecated flag --non-masquerade-cidr in kubelet
Signed-off-by: Ciprian Hacman <ciprian@hakman.dev>
2022-01-19 09:17:26 +02:00
cyclinder
07999dac70 Clean up dockershim flags in the kubelet
Signed-off-by: cyclinder <qifeng.guo@daocloud.io>
Co-authored-by: Ciprian Hacman <ciprian@hakman.dev>
Signed-off-by: Ciprian Hacman <ciprian@hakman.dev>
2022-01-14 16:02:50 +02:00
Patrick Ohly
9eaa2dc554 avoid klog Info calls without verbosity
In the following code pattern, the log message will get logged with v=0 in JSON
output although conceptually it has a higher verbosity:

   if klog.V(5).Enabled() {
       klog.Info("hello world")
   }

Having the actual verbosity in the JSON output is relevant, for example for
filtering out only the important info messages. The solution is to use
klog.V(5).Info or something similar.

Whether the outer if is necessary at all depends on how complex the parameters
are. The return value of klog.V can be captured in a variable and be used
multiple times to avoid the overhead for that function call and to avoid
repeating the verbosity level.
2022-01-12 07:48:36 +01:00
Kubernetes Prow Robot
b5103f6117
Merge pull request #107426 from yanghesong/remove_validate_runtime
Remove runtime in validate
2022-01-11 20:50:36 -08:00
Kubernetes Prow Robot
7eb5046064
Merge pull request #106470 from qmloong/qmloong/fix
fix: some typos and syncPod outdated workflow annotation
2022-01-11 10:48:38 -08:00
Kubernetes Prow Robot
a0dfd958d5
Merge pull request #107163 from cyclinder/fix_leak_goroutine
fix goroutine leaks in TestConfigurationChannels
2022-01-10 17:23:16 -08:00
cyclinder
928e686877 fix goroutine leaks in TestConfigurationChannels
Signed-off-by: cyclinder <qifeng.guo@daocloud.io>
2022-01-10 19:51:16 +08:00
yanghesong
6905fef761 Remove runtime in validate
Validate is useless as dockershim is removed

Signed-off-by: yanghesong <hesong.yang@foxmail.com>
2022-01-09 09:11:49 +08:00
Mengjiao Liu
beda4cafb6 kubelet: Remove the deprecated flag --experimental-check-node-capabilities-before-mount 2022-01-06 11:47:11 +08:00
Kubernetes Prow Robot
73b68f5233
Merge pull request #106979 from a2ush/fix_typo
Fix comment out typo (from resolve.conf to resolv.conf) and change the content name (from maxResolveConfLength to maxResolvConfLength)
2022-01-05 16:08:26 -08:00
Kubernetes Prow Robot
19591a1324
Merge pull request #105829 from yuanchen8911/master
Fix and improve comments on kubelet metrics
2022-01-04 23:02:32 -08:00
Ciprian Hacman
5bae9b9288 Clean up DockerLegacyService interface
Signed-off-by: Ciprian Hacman <ciprian@hakman.dev>
2021-12-18 12:24:54 +02:00
a2ush
d775483381 Fix comment out typo 2021-12-11 22:27:38 +09:00
Davanum Srinivas
bc78dff42e
update files to drop dockershim
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2021-12-07 15:15:13 -05:00
menglong.qi
12eff56460 fix: syncPod outdated workflow comment 2021-11-28 17:21:29 +08:00
Shiming Zhang
545313bdc7 Implement graceful shutdown based on Pod priority 2021-11-17 11:47:12 +08:00
caozhiyuan
bad4faf1b9 migrate --register-with-taints to KubeletConfiguration 2021-11-16 19:10:36 +08:00
Peter Hunt
7866287ba1 kubelet stats: wire up podAndContainerStatsFromCRI feature gate
though it is currently unused

Signed-off-by: Peter Hunt <pehunt@redhat.com>
2021-10-29 09:40:20 -04:00
Kubernetes Prow Robot
17da6a2345
Merge pull request #105699 from yuzhiquan/remove-format-pods
Remove format.pods func, instead with klog.Kobjs
2021-10-25 15:53:30 -07:00
Yuan Chen
b99495d1d9 Fix and improve comments on kubelet metrics 2021-10-21 17:38:25 -07:00
yuzhiquanlong
27fe56e916 remove unused import 2021-10-15 18:40:31 +08:00
yuzhiquanlong
be9e1fda5e remove format pods func, instead with klog.Kobjs 2021-10-15 18:26:02 +08:00
Shiming Zhang
b468c24e85 Refactor to use structure to pass parameters 2021-10-15 11:16:21 +08:00
Kubernetes Prow Robot
a923852ba0
Merge pull request #105215 from rphillips/add_probe_shutdown
kubelet: add probe termination to graceful shutdowns
2021-10-11 21:19:46 -07:00
wojtekt
65d8037ae3 Add jittering for Kubelet status computing 2021-09-27 19:39:50 +02:00
Ryan Phillips
e2e938066d kubelet: add probe termination to graceful shutdowns 2021-09-22 14:13:25 -05:00
Clayton Coleman
d5719800bf
kubelet: Handle UID reuse in pod worker
If a pod is killed (no longer wanted) and then a subsequent create/
add/update event is seen in the pod worker, assume that a pod UID
was reused (as it could be in static pods) and have the next
SyncKnownPods after the pod terminates remove the worker history so
that the config loop can restart the static pod, as well as return
to the caller the fact that this termination was not final.

The housekeeping loop then reconciles the desired state of the Kubelet
(pods in pod manager that are not in a terminal state, i.e. admitted
pods) with the pod worker by resubmitting those pods. This adds a
small amount of latency (2s) when a pod UID is reused and the pod
is terminated and restarted.
2021-09-15 14:02:00 -04:00
Kubernetes Prow Robot
047a6b9f86
Merge pull request #104874 from wojtek-t/migrate_clock_1
Unify towards k8s.io/utils/clock - part 1
2021-09-13 19:09:20 -07:00
wojtekt
53ce79a18a Migrate to k8s.io/utils/clock in pkg/kubelet 2021-09-10 12:20:09 +02:00
Clayton Coleman
17d32ed0b8
kubelet: Rejected pods should be filtered from admission
A pod that has been rejected by admission will have status manager
set the phase to Failed locally, which make take some time to
propagate to the apiserver. The rejected pod will be included in
admission until the apiserver propagates the change back, which
was an unintended regression when checking pod worker state as
authoritative.

A pod that is terminal in the API may still be consuming resources
on the system, so it should still be included in admission.
2021-09-08 10:23:45 -04:00
Sascha Grunert
46077e6be7
Remove deprecated --seccomp-profile-root/seccompProfileRoot configuration
The configuration is deprecated and targets removal for v1.23. Tests
cases have been changed as well.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2021-08-31 09:55:28 +02:00
Antonio Ojea
0cd75e8fec run hack/update-netparse-cve.sh 2021-08-20 10:42:09 +02:00