Commit Graph

122 Commits

Author SHA1 Message Date
Paco Xu
feb833f129
fix nil pointer dereference when EventedPLEG is enabled 2023-12-25 16:09:30 +08:00
Kubernetes Prow Robot
e823b56a0b
Merge pull request #116932 from my-git9/ut-preemption
[ut] Increase test coverage for kubelet/pleg
2023-10-31 01:22:47 +01:00
Kubernetes Prow Robot
c5815fee72
Merge pull request #113825 from harche/ep_comments
Keep PLEG interruptions in a separate interface
2023-10-17 03:37:57 +02:00
Quan Tian
d9b941b782 Remove undesired verbose fields from log
The if and else branches have the exactly same code, which looks
confusing and doesn't make sense. According to the comment, the else
branch should log the error and podUID only.

Signed-off-by: Quan Tian <qtian@vmware.com>
2023-05-18 16:07:45 +08:00
Harshal Patil
05f04f866e Keep PLEG interruptions in a separate interface
Signed-off-by: Harshal Patil <harpatil@redhat.com>
Co-authored-by: Ed Bartosh <eduard.bartosh@intel.com>
2023-04-26 12:14:26 -04:00
mantuliu
17db22d055 Fix potential mutex usage bug
Signed-off-by: mantuliu <240951888@qq.com>
2023-04-21 23:50:33 +08:00
Tim Hockin
29c0b73d64
Replace uses of diff.ObjectDiff with cmp.Diff
ObjectDiff is already a shim over cmp.Diff, so no actual output or
behavior changes
2023-04-12 08:46:12 -07:00
xin.li
e0f2ed1b92 [ut] Increase test coverage for kubelet/pleg
Signed-off-by: xin.li <xin.li@daocloud.io>
2023-04-01 15:45:05 +08:00
Harshal Patil
412b4b3329 Add connection related metrics to EventedPLEG
Signed-off-by: Harshal Patil <harpatil@redhat.com>
2023-03-01 11:35:27 -05:00
Chen Wang
7db339dba2 This commit contains the following:
1. Scheduler bug-fix + scheduler-focussed E2E tests
2. Add cgroup v2 support for in-place pod resize
3. Enable full E2E pod resize test for containerd>=1.6.9 and EventedPLEG related changes.

Co-Authored-By: Vinay Kulkarni <vskibum@gmail.com>
2023-02-24 18:21:21 +00:00
Vinay Kulkarni
f2bd94a0de In-place Pod Vertical Scaling - core implementation
1. Core Kubelet changes to implement In-place Pod Vertical Scaling.
2. E2E tests for In-place Pod Vertical Scaling.
3. Refactor kubelet code and add missing tests (Derek's kubelet review)
4. Add a new hash over container fields without Resources field to allow feature gate toggling without restarting containers not using the feature.
5. Fix corner-case where resize A->B->A gets ignored
6. Add cgroup v2 support to pod resize E2E test.
KEP: /enhancements/keps/sig-node/1287-in-place-update-pod-resources

Co-authored-by: Chen Wang <Chen.Wang1@ibm.com>
2023-02-24 18:21:21 +00:00
ruiwen-zhao
fabcc91956 Ignore container events with nil PodSandboxStatus
Signed-off-by: ruiwen-zhao <ruiwen@google.com>
2023-01-31 22:50:51 +00:00
Harshal Patil
86284d42f8
Add support for Evented PLEG
Signed-off-by: Harshal Patil <harpatil@redhat.com>
Co-authored-by: Swarup Ghosh <swghosh@redhat.com>
2022-11-08 20:06:16 +05:30
David Ashpole
64af1adace
Second attempt: Plumb context to Kubelet CRI calls (#113591)
* plumb context from CRI calls through kubelet

* clean up extra timeouts

* try fixing incorrectly cancelled context
2022-11-05 06:02:13 -07:00
Antonio Ojea
9c2b333925 Revert "plumb context from CRI calls through kubelet"
This reverts commit f43b4f1b95.
2022-11-02 13:37:23 +00:00
David Ashpole
f43b4f1b95
plumb context from CRI calls through kubelet 2022-10-28 02:55:28 +00:00
XuzhengChang
6266554b34 refactor: pleg/getContainersFromPods 2022-04-06 14:12:52 +08:00
Patrick Ohly
edffc700a4 enhance and fix log calls
Some of these changes are cosmetic (repeatedly calling klog.V instead of
reusing the result), others address real issues:

- Logging a message only above a certain verbosity threshold without
  recording that verbosity level (if klog.V().Enabled() { klog.Info... }):
  this matters when using a logging backend which records the verbosity
  level.

- Passing a format string with parameters to a logging function that
  doesn't do string formatting.

All of these locations where found by the enhanced logcheck tool from
https://github.com/kubernetes/klog/pull/297.

In some cases it reports false positives, but those can be suppressed with
source code comments.
2022-03-24 11:13:50 +01: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
5f4914604d
Merge pull request #106353 from gjkim42/remove-false-pleg-errors
kubelet: Remove false PLEG errors
2022-01-11 10:48:26 -08:00
Sascha Grunert
de37b9d293
Make CRI v1 the default and allow a fallback to v1alpha2
This patch makes the CRI `v1` API the new project-wide default version.
To allow backwards compatibility, a fallback to `v1alpha2` has been added
as well. This fallback can either used by automatically determined by
the kubelet.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2021-11-17 11:05:05 -08:00
Gunju Kim
2dd4a00509
kubelet: Remove false PLEG errors 2021-11-12 00:03:01 +09:00
Kubernetes Prow Robot
cab54856f1
Merge pull request #104933 from vikramcse/automate_mockery
conversion of tests from mockery to mockgen
2021-09-30 18:33:21 -07:00
vikram Jadhav
0de4397490 mockery to mockgen conversion 2021-09-25 16:15:08 +00:00
wojtekt
53ce79a18a Migrate to k8s.io/utils/clock in pkg/kubelet 2021-09-10 12:20:09 +02:00
Kubernetes Prow Robot
91656fa6eb
Merge pull request #101308 from pacoxu/doc-kubelet-running-pods
kubelet_running_pods shows number of pods that have a running pod sandbox
2021-05-26 03:17:20 -07:00
pacoxu
650666406e update kubelet_running_pods metrics comments: pods that have a running pod sandbox
Signed-off-by: pacoxu <paco.xu@daocloud.io>
Co-authored-by: Elana Hashman <ehashman@users.noreply.github.com>
2021-04-29 11:05:52 +08:00
yuzhiquan
d483872d64 fix potential nil pointer 2021-04-26 15:31:34 +08:00
Kubernetes Prow Robot
27e23967f4
Merge pull request #99880 from Dragoncell/pleg-log
Add exit code log when container died
2021-04-22 13:18:01 -07:00
Jiaming Xu
5f8dd349d1 Add exit code log when container died
update log exit code logic

adjust log exit code logic

fix invalid memory access in unit test

adjust log

update log message

address latest comment

change logging format

remove space in key of log

address latest comments

address comments
2021-04-20 00:19:16 +00:00
Paco Xu
54606db1b4
Update pkg/kubelet/pleg/generic.go
Co-authored-by: Elana Hashman <ehashman@users.noreply.github.com>
2021-03-26 13:19:51 +08:00
pacoxu
3fc1e0891b Update the kubelet log status to level 6 as it is so big
Signed-off-by: pacoxu <paco.xu@daocloud.io>
2021-03-26 10:09:20 +08:00
Benjamin Elder
56e092e382 hack/update-bazel.sh 2021-02-28 15:17:29 -08:00
Geonju Kim
221025ce74 Migrate pkg/kubelet/pleg to structured logging 2021-02-14 07:24:28 +09:00
Kubernetes Prow Robot
dce91dece3
Merge pull request #93283 from runzexia/cleanup-unused-container-cache
clean up unused var containerCache
2020-08-28 06:36:33 -07:00
xiaofei.sun
a724481f5c fix metrics kubelet_running_pod_count 2020-07-31 16:35:53 +08:00
RyderXia
2214117cd1 clean up unused var containerCache 2020-07-21 16:57:36 +08:00
RainbowMango
168c695e1a Update two metrics name to make promlint happy. 2020-06-23 15:16:18 +08:00
Kubernetes Prow Robot
628102d038
Merge pull request #85390 from xiaoanyunfei/bugfix/plegTestRelisting
fix pleg TestRelisting
2020-06-20 14:40:38 -07:00
Sergey Kanzhelev
ee53488f19 fix golint issues in pkg/kubelet/container 2020-06-19 15:48:08 +00:00
xiaofei.sun
ddf1c5d3e9 fix pleg TestRelisting 2020-06-18 21:46:55 +08: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
de34d2ce1e
Merge pull request #87193 from mattjmcnaughton/mattjmcnaughton/cleanup-rkt-code-in-pleg
Clean up rkt specific code in `pkg/kubelet/pleg`
2020-01-14 22:21:46 -08:00
mattjmcnaughton
ab7e0f58d5
Clean up rkt specific code in pkg/kubelet/pleg
Clean up code in PLEG which was only necessary for the `rkt` runtime.

Rkt is no longer a built-in runtime and docker(shim) uses the CRI, so
its safe to remove this code entirely.

This diff removes the last mentions of `rkt` in the kubelet.
2020-01-14 07:42:30 -05:00
danielqsj
1a9b121764 remove deprecated metrics of kubelet 2020-01-10 16:46:52 +08:00
Kubernetes Prow Robot
49bc696614
Merge pull request #86251 from bboreham/pleg-last-seen-metric
Kubelet: add a metric to observe time since PLEG last seen
2020-01-06 18:06:18 -08:00
Bryan Boreham
cc0b3e82eb Kubelet: add a metric to observe time since PLEG last seen
Expose the measurement that kubelet uses to judge that "PLEG is
unhealthy". If we can observe the measurement growing then we can
alert before the node goes unhealthy.

Note that the existing metrics PLEGRelistInterval and
PLEGRelistDuration are poor for this, because when relist() gets
stuck they are never updated.

Signed-off-by: Bryan Boreham <bryan@weave.works>
2020-01-03 10:01:27 +00:00
yiyang5055
0f410d625a change CounterVec to use Counter in the Kubelet's Pod Lifecycle Event Generator 2019-12-11 23:51:28 +08:00
RainbowMango
6099d49046 Deal with auto-generated files.
- Update bazel by hack/update-bazel.sh
2019-10-09 15:12:21 +08:00