Commit Graph

2088 Commits

Author SHA1 Message Date
wojtekt
53ce79a18a Migrate to k8s.io/utils/clock in pkg/kubelet 2021-09-10 12:20:09 +02:00
Antonio Ojea
0cd75e8fec run hack/update-netparse-cve.sh 2021-08-20 10:42:09 +02:00
Kubernetes Prow Robot
8dbc33d649
Merge pull request #101081 from rphillips/add_graceful_shutdown_event
kubelet: add graceful shutdown events
2021-08-17 22:08:08 -07:00
Wesley Williams
ff165c8823
Replace usage of Whitelist with Allowlist within Kubelet's sysctl package (#102298)
* Change uses of whitelist to allowlist in kubelet sysctl

* Rename whitelist files to allowlist in Kubelet sysctl

* Further renames of whitelist to allowlist in Kubelet

* Rename podsecuritypolicy uses of whitelist to allowlist

* Update pkg/kubelet/kubelet.go

Co-authored-by: Danielle <dani@builds.terrible.systems>

Co-authored-by: Danielle <dani@builds.terrible.systems>
2021-08-04 18:59:35 -07:00
Kubernetes Prow Robot
dab6f6a43d
Merge pull request #102344 from smarterclayton/keep_pod_worker
Prevent Kubelet from incorrectly interpreting "not yet started" pods as "ready to terminate pods" by unifying responsibility for pod lifecycle into pod worker
2021-07-08 16:48:53 -07:00
Li Bo
c3d9b10ca8 feature: support Memory QoS for cgroups v2 2021-07-08 09:26:46 +08:00
Akihiro Suda
26e83ac4d4
kubelet: ignore /dev/kmsg error when running in userns
oomwatcher.NewWatcher returns "open /dev/kmsg: operation not permitted" error,
when running with sysctl value `kernel.dmesg_restrict=1`.

The error is negligible for KubeletInUserNamespace.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2021-07-07 14:23:31 +09:00
Clayton Coleman
3eadd1a9ea
Keep pod worker running until pod is truly complete
A number of race conditions exist when pods are terminated early in
their lifecycle because components in the kubelet need to know "no
running containers" or "containers can't be started from now on" but
were relying on outdated state.

Only the pod worker knows whether containers are being started for
a given pod, which is required to know when a pod is "terminated"
(no running containers, none coming). Move that responsibility and
podKiller function into the pod workers, and have everything that
was killing the pod go into the UpdatePod loop. Split syncPod into
three phases - setup, terminate containers, and cleanup pod - and
have transitions between those methods be visible to other
components. After this change, to kill a pod you tell the pod worker
to UpdatePod({UpdateType: SyncPodKill, Pod: pod}).

Several places in the kubelet were incorrect about whether they
were handling terminating (should stop running, might have
containers) or terminated (no running containers) pods. The pod worker
exposes methods that allow other loops to know when to set up or tear
down resources based on the state of the pod - these methods remove
the possibility of race conditions by ensuring a single component is
responsible for knowing each pod's allowed state and other components
simply delegate to checking whether they are in the window by UID.

Removing containers now no longer blocks final pod deletion in the
API server and are handled as background cleanup. Node shutdown
no longer marks pods as failed as they can be restarted in the
next step.

See https://docs.google.com/document/d/1Pic5TPntdJnYfIpBeZndDelM-AbS4FN9H2GTLFhoJ04/edit# for details
2021-07-06 15:55:22 -04:00
Elana Hashman
0deef4610e
Set MemorySwapLimitInBytes for CRI when NodeSwapEnabled 2021-06-29 11:59:02 -07:00
Ryan Phillips
d9be5abc37 kubelet: add shutdown events 2021-06-23 16:44:19 -05:00
Sascha Grunert
8b7003aff4
Add SeccompDefault feature
This adds the gate `SeccompDefault` as new alpha feature. Seccomp path
and field fallbacks are now passed to the helper functions, whereas unit
tests covering those code paths have been added as well.

Beside enabling the feature gate, the feature has to be enabled by the
`SeccompDefault` kubelet configuration or its corresponding
`--seccomp-default` CLI flag.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>

Apply suggestions from code review

Co-authored-by: Paulo Gomes <pjbgf@linux.com>
Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2021-06-23 10:22:57 +02:00
Artyom Lukianov
03830db82d Implement all necessary methods to provide memory manager data under pod resources metrics
Signed-off-by: Artyom Lukianov <alukiano@redhat.com>
2021-06-22 13:06:32 +03:00
sanwishe
9e257ec194 Optimization logging format for pkg/kubelet
Signed-off-by: sanwishe <jiang.mingzhi35@zte.com.cn>
2021-05-25 08:52:08 +08:00
Danil-Grigorev
5d57b3794c Add DisableCloudProviders FG
FeatureGate acts as a secondary switch to disable cloud-controller loops
in KCM, Kubelet and KAPI.

Provide comprehensive logging information to users, so they will be
guided in adoption of out-of-tree cloud provider implementation.
2021-05-21 16:09:44 +02:00
Kubernetes Prow Robot
3e588be763
Merge pull request #101712 from SergeyKanzhelev/disableAcceleratorUsageMetricsOnContainerd
disable collecting of accelerator metrics in cAdvisor
2021-05-17 13:39:51 -07:00
Kubernetes Prow Robot
cff652d951
Merge pull request #101369 from markusthoemmes/status-simplification
pkg/kubelet: Simplify status string generation on probes
2021-05-03 17:21:22 -07:00
Sergey Kanzhelev
e8ae653c1d disable collecting of accelerator metrics and exposing it for containerd 2021-04-30 22:16:34 +00:00
yuzhiquan
02c3d53a23 typo 2021-04-23 17:55:54 +08:00
Markus Thömmes
f00441d2ee pkg/kubelet: Simplify status string generation on probes 2021-04-22 14:06:18 +02:00
Lubomir I. Ivanov
7deac5e697 pkg/kubelet: improve the node informer sync check
GetNode() is called in a lot of places including a hot loop in
fastStatusUpdateOnce. Having a poll in it is delaying
the kubelet /readyz status=200 report.

If a client is available attempt to wait for the sync to happen,
before starting the list watch for pods at the apiserver.
2021-04-21 22:46:27 +03:00
Niekvdplas
fec272a7b2 Fixed several spelling mistakes 2021-03-30 23:02:09 +02:00
Elana Hashman
6af7eb6d49
Migrate missed log entries in kubelet
Co-Authored-By: pacoxu <paco.xu@daocloud.io>
2021-03-18 14:26:26 -07:00
Navid Shaikh
be91ea5bd1 Migrate pkg/kubelet/kubelet.go to structured logging 2021-03-17 14:39:08 +05:30
Kubernetes Prow Robot
4b6e3e164f
Merge pull request #99221 from jsturtevant/windows-host-stats-provider
Get filesystem stats for files on Windows
2021-03-10 11:09:23 -08:00
fengzixu
edc1c62471 feature: add CSIVolumeHealth feature and gate
1. add EventRecorder to ResourceAnalyzer
2. add CSIVolumeHealth feature and gate
2021-03-10 01:16:37 +09:00
Kubernetes Prow Robot
b1367af8b5
Merge pull request #99799 from QiWang19/kobj-slice
Refactor pods format to return ObjRef slice
2021-03-08 16:27:19 -08:00
James Sturtevant
c9eff4e906 Get filesystem stats for files on Windows 2021-03-08 12:50:23 -08:00
Kubernetes Prow Robot
eb4dafb7f1
Merge pull request #99651 from umohnani8/cri
Move CRIContainerLogRotation to GA
2021-03-08 12:07:20 -08:00
chenyw1990
57a3b0abd6 reduce configmap and secret watch of kubelet 2021-03-08 16:55:39 +08:00
Kubernetes Prow Robot
c193c1b234
Merge pull request #98376 from matthyx/mega
Make all health checks probing consistent
2021-03-06 11:45:41 -08:00
Qi Wang
8133d29586 Refactor pods format to ObjRef slice
Refactor format.Pods to return a slice of ObjRef for structured logging.
Ref: https://github.com/kubernetes/kubernetes/pull/99029#discussion_r586785552

Signed-off-by: Qi Wang <qiwan@redhat.com>
2021-03-06 11:26:50 -05:00
Kubernetes Prow Robot
55f255208a
Merge pull request #83730 from claudiubelu/windows/containerd-etc-hosts
Windows: Fixes /etc/hosts file mounting support for containerd
2021-03-05 05:08:22 -08:00
Matthias Bertschy
431e6a7044 Move readinessManager updates handling to kubelet 2021-03-05 07:02:25 +01:00
Matthias Bertschy
eed218a3a2 Move startupManager updates handling to kubelet 2021-03-05 07:02:25 +01:00
Urvashi Mohnani
ca99aa587d Move CRIContainerLogRotation to GA
Graduate the CRIContainerLogRotation feature gate
from beta to GA.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2021-03-04 09:40:02 -05:00
pacoxu
cd54bd94e9 deprecate cAdvisor json metrics collected by Kubelet
- remove unused code for cadvisor json metrics collected

Signed-off-by: pacoxu <paco.xu@daocloud.io>
2021-03-02 15:36:21 +08:00
Kubernetes Prow Robot
17c3ee8708
Merge pull request #98742 from gjkim42/sync-until-terminate-containers
kubelet: Sync completed pods until their containers have been terminated
2021-02-24 15:29:26 -08:00
Kubernetes Prow Robot
739a72b9cc
Merge pull request #99158 from wgahnagl/lock-sysctls
Graduate sysctls to GA
2021-02-24 13:39:24 -08:00
xiaofei.sun
fd62f32125 Scheduler: remove pkg/apis/core/field_constants.go 2021-02-24 18:06:29 +08:00
pacoxu
3de4dd841f
remove featuregate for sysctl
Co-authored-by: Skyler Clark <wgahnagl@protonmail.com>
2021-02-22 16:51:43 -05:00
Sri Saran Balaji Vellore Rajakumar
af05a7eca3 Refactor Kubelet Server to take kubeConfiguration instead of multiple fields 2021-02-11 16:15:35 -08:00
Sri Saran Balaji Vellore Rajakumar
51cdf4e97b Add support to disable /debug/pprof and /debug/flags/v endpoint
Co-authored-by: xiaofei.sun <sunxiaofei@kuaishou.com>
Co-authored-by: SaranBalaji90 <srisaranbalaji@gmail.com>
2021-02-11 15:56:53 -08:00
Geonju Kim
321ca8af52 kubelet: Sync completed pods until their containers have been terminated 2021-02-06 14:06:50 +09:00
Ryan Phillips
f918e11e3a register all pending pod deletions and check for kill
do not delete the cgroup from a pod when it is being killed
2021-02-04 11:45:42 -06:00
Claudiu Belu
de4602995b Windows: Fixes /etc/hosts file mounting support for containerd
If Containerd is used on Windows, then we can also mount individual
files into containers (e.g.: /etc/hosts), which was not possible with Docker.

Checks if the container runtime is containerd, and if it is, then also
mount /etc/hosts file (to C:\Windows\System32\drivers\etc\hosts).
2021-01-30 04:54:42 -08:00
Kubernetes Prow Robot
9ec1e23e41
Merge pull request #98005 from wzshiming/fix-rescheduling-to-the-shutdown-node
Sync node status during kubelet node shutdown
2021-01-28 17:51:53 -08:00
Kubernetes Prow Robot
e05c9ab04b
Merge pull request #97932 from ehashman/kubelet-standalone-doc
Add explanation for kubeClient != nil in NewMainKubelet
2021-01-28 16:59:59 -08:00
wzshiming
d9df265af0 Sync node status during kubelet node shutdown 2021-01-21 11:01:13 +08:00
Kubernetes Prow Robot
09f4baed35
Merge pull request #98103 from gjkim42/delete-static-pod-gracefully
Delete static pod gracefully and fix mirrorPodTerminationMap leak
2021-01-19 10:01:44 -08:00
chymy
f25b902b83 kubelet logs print 'kubelet nodes sync' frequently
Signed-off-by: chymy <chang.min1@zte.com.cn>
2021-01-19 08:57:35 +08:00