Commit Graph

199 Commits

Author SHA1 Message Date
Kubernetes Prow Robot
a8d51f4f05 Use a generic Set instead of a specified Set in kubelet
Signed-off-by: bzsuni <bingzhe.sun@daocloud.io>
2024-06-04 14:25:43 +08:00
Sascha Grunert
2aa9e76be1
Move pkg/kubelet/cri/remote to cri-client
Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2024-05-14 10:58:18 +02:00
Kubernetes Prow Robot
3fda574e5e
Merge pull request #121770 from frzifus/tracing_kubelet_read-only
pass tracerprovider to kublet-readonly server
2024-04-17 23:59:33 -07:00
Adrian Reber
da8ffcd1dc
Switch 'ContainerCheckpoint' from Alpha to Beta
* Forensic Container Checkpointing as described in KEP 2008 moves from
   Alpha to Beta. This is corresponding code change.

 * Adapt e2e test to handle
   '(rpc error: code = Unimplemented desc = unknown method CheckpointContainer'
   and
   '(rpc error: code = Unimplemented desc = method CheckpointContainer not implemented)'
   and
   '(rpc error: code = Unknown desc = checkpoint/restore support not available)'
   One error message is if the CRI implementation does
   not implement the CRI RPC (too old) and the second is
   if the CRI implementation does explicitly not support the feature.
   The third error message can be seen if the container engine
   explicitly disabled the checkpoint/restore support,

 * As described in the corresponding KEP 2008 explicitly test for
   disabled functionality.

 * Extended test to look for the checkpoint kubelet metric.

 * Extended test to look for the CRI error metric.

 *  Add separate sub-resource permission to control permissions on
    the checkpoint kubelet API endpoint

Signed-off-by: Adrian Reber <areber@redhat.com>
2024-02-19 18:09:38 +00:00
yanggang
98054dd9d3
Clean unused code in kubelet server.
Signed-off-by: yanggang <gang.yang@daocloud.io>
2024-01-17 01:01:39 +00:00
Benedikt Bongartz
c823a21a7a
apply public endpoint filter only for kubelet-readonly
Signed-off-by: Benedikt Bongartz <bongartz@klimlive.de>
2024-01-11 00:43:41 +01:00
Benedikt Bongartz
099eba784b
pass tracerprovider to kublet-readonly server
Signed-off-by: Benedikt Bongartz <bongartz@klimlive.de>
2023-11-07 06:15:45 +01:00
Katarzyna Lach
122ff5a212 Move grpc rate limitter from podresource folder
Rate limitter.go file is a generic file implementing
grpc Limiter interface. This file can be reuse by other gRPC
API not only by podresource.

Change-Id: I905a46b5b605fbb175eb9ad6c15019ffdc7f2563
2023-10-09 07:22:23 +00:00
Han Kang
e6435e98ed promote component SLIs to GA; remove feature gates for component slis 2023-09-11 09:15:32 -07:00
Sascha Grunert
a6554b9d5d
Make kubelet label types public
We use the label definitions in CRI-O, means we now make them public to
stop vendoring/copying this part of Kubernetes.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2023-07-10 10:58:44 +02:00
Sascha Grunert
db9fcfeed2
Move cri/streaming to k8s.io/kubelet staging repository
Container runtimes like CRI-O and containerd reuse the code by copying
it from Kubernetes. To have a single source of truth for the streaming
server we now move the already isolated implementation to the
k8s.io/kubelet staging repository. This way runtimes can re-use the code
without copying the parts.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2023-06-05 08:08:18 +02:00
Francesco Romani
6b4ffdb9f7 node: re-implement Localendpoint on windows
this will allows us to move forward with the podresources
endpoint GA graduation.

xref: https://github.com/kubernetes/kubernetes/issues/78628

Signed-off-by: Francesco Romani <fromani@redhat.com>
2023-03-14 22:39:56 +01:00
Francesco Romani
195fc2f516 kubelet: podresources: rename variable
on unix, the podresources endpoint is a unix domain socket;
on windows, the podresources endpoint is a named pipe;
rename the variables to convey this fact. No changes in behavior.

Signed-off-by: Francesco Romani <fromani@redhat.com>
2023-03-14 22:39:54 +01:00
Kubernetes Prow Robot
28fa3cbbf1
Merge pull request #115847 from moshe010/pod-resource-api-dra-upstream
Extend the PodResources API to include resources allocated by DRA
2023-03-14 14:12:26 -07:00
Francesco Romani
5e03998991 kubelet: podresources: pack parameters in a struct
To enable rate limiting, needed for GA graduation,
we need to pass more parameters to the already crowded
`ListenAndServePodresources` function.

To tidy up a bit, pack the parameters in a helper struct,
with no intended changes in behavior.

Signed-off-by: Francesco Romani <fromani@redhat.com>
2023-03-14 19:33:01 +02:00
Aravindh Puthiyaparambil
d12696c20f
kubelet: Expose simple journald and Get-WinEvent shims on the logs endpoint
Provide an administrator a streaming view of journal logs on Linux
systems using journalctl, and event logs on Windows systems using the
Get-WinEvent PowerShell cmdlet without them having to implement a client
side reader.

Only available to cluster admins.

The implementation for journald on Linux was originally done by Clayton
Coleman.

Introduce a heuristics approach to query logs

The logs query for node objects will follow a heuristics approach
when asked to query for logs from a service. If asked to get the
logs from a service foobar, it will first check if foobar logs to the
native OS service log provider. If unable to get logs from these, it
will attempt to get logs from /var/foobar, /var/log/foobar.log or
/var/log/foobar/foobar.log in that order.
The logs sub-command can also directly serve a file if the query looks
like a file.

Co-authored-by: Clayton Coleman <ccoleman@redhat.com>
Co-authored-by: Christian Glombek <cglombek@redhat.com>
2023-03-14 08:54:36 -07:00
Francesco Romani
b837a0c1ff kubelet: podresources: DOS prevention with builtin ratelimit
Implement DOS prevention wiring a global rate limit for podresources
API. The goal here is not to introduce a general ratelimiting solution
for the kubelet (we need more research and discussion to get there),
but rather to prevent misuse of the API.

Known limitations:
- the rate limits value (QPS, BurstTokens) are hardcoded to
  "high enough" values.
  Enabling user-configuration would require more discussion
  and sweeping changes to the other kubelet endpoints, so it
  is postponed for now.
- the rate limiting is global. Malicious clients can starve other
  clients consuming the QPS quota.

Add e2e test to exercise the flow, because the wiring itself
is mostly boilerplate and API adaptation.
2023-03-11 08:00:54 +01:00
Francesco Romani
09517c27c4 kubelet: podresources: pack parameters in a struct
To enable rate limiting, needed for GA graduation,
we need to pass more parameters to the already crowded
`ListenAndServePodresources` function.

To tidy up a bit, pack the parameters in a helper struct,
with no intended changes in behavior.

Signed-off-by: Francesco Romani <fromani@redhat.com>
2023-03-10 10:28:52 +01:00
lixiaobing1
fb327ddd15 improve performance 2022-11-29 16:02:47 +08:00
Peter Hunt
95489a26d6 kubelet: add cri metrics to server
Signed-off-by: Peter Hunt <pehunt@redhat.com>
2022-11-08 14:47:08 -05:00
Peter Hunt
6298ce68e2 kubelet: wire ListPodSandboxMetrics
Signed-off-by: Peter Hunt <pehunt@redhat.com>
2022-11-08 14:47:08 -05:00
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
Richa Banker
047f6a736b add metrics/slis to kubelet health checks 2022-10-18 14:06:20 -07:00
Sally O'Malley
0d558c51b5
add otelrestful restful.FilterFunction
Signed-off-by: Sally O'Malley <somalley@redhat.com>
2022-08-01 12:55:19 -04:00
Sally O'Malley
7585aae1b4
kubelet-tracing:update
Signed-off-by: Sally O'Malley <somalley@redhat.com>
2022-08-01 12:55:16 -04:00
Sally O'Malley
47e7d8034f
kubelet tracing
Signed-off-by: Sally O'Malley <somalley@redhat.com>
Co-authored-by: David Ashpole <dashpole@google.com>
2022-08-01 12:55:02 -04:00
Paco Xu
e073b0fd65 Disable AcceleratorUsage Metrics: ga 2022-07-30 12:31:43 +08:00
Kubernetes Prow Robot
cf2800b812
Merge pull request #111402 from verb/111030-ec-ga
Promote EphemeralContainers feature to GA
2022-07-29 19:29:20 -07:00
Kubernetes Prow Robot
126c07604d
Merge pull request #104484 from jackfrancis/prober-duration-metrics
add container probe duration metrics
2022-07-29 13:17:11 -07:00
Lee Verberne
d238e67ba6 Remove EphemeralContainers feature-gate checks 2022-07-26 02:55:30 +02:00
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
Davanum Srinivas
ab690750df
Switch to v3 of github.com/emicklei/go-restful
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2022-06-09 14:11:41 -04:00
Jorik Jonker
27b8f13763 kubelet: expose OOM metrics
cAdvisor has code to expose OOM metrics since 0.40.0, but this was not
included in Kubelet so far. This commit enables it.

Signed-off-by: Jorik Jonker <jorik.jonker@eu.equinix.com>
2022-02-08 12:24:25 +01:00
Jack
7655702313 add container probe duration metrics 2022-01-20 16:50:02 -08:00
Shivam Sandbhor
6652c54d83 Remove invalid comment in legacyregistry
Signed-off-by: Shivam Sandbhor <shivam.sandbhor@gmail.com>
2021-11-18 15:05:00 +05:30
Hanna Lee
07a883d8e6 Remove //lint:ignore pragmas that aren't being used anymore 2021-11-17 08:56:54 +01:00
Hanna Lee
0f3836dcc5 Ignore deprecation warnings with //nolint:staticcheck 2021-11-17 08:55:57 +01:00
David Porter
b6269ce5de kubelet: update cAdvisor usage for v0.43
* Change cAdvisor manager constructor
* Change call to adding AcceleratorUsageMetrics

Signed-off-by: David Porter <david@porter.me>
2021-11-09 17:09:12 -08:00
Antonio Ojea
0cd75e8fec run hack/update-netparse-cve.sh 2021-08-20 10:42:09 +02:00
Jordan Liggitt
db48793269 Set idle and readheader timeouts 2021-07-27 11:58:45 -04: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
Aditi Sharma
5af10e9828 Migrate to structured logging
migrate pkg/kubelet/server to structured logging.

Signed-off-by: Aditi Sharma <adi.sky17@gmail.com>
2021-03-05 17:55:48 +05:30
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
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
chenyw1990
db5de9169f pkg/kubelet/server: migrate to structured logs 2021-02-09 15:34:52 +08:00
Erik Wilson
a4037d2684
Fix cadvisor machine metrics
Signed-off-by: Ling Samuel <lingsamuelgrace@gmail.com>
2020-12-04 10:08:05 +08:00
Alexey Perevalov
a8b8995ef2 Implement TopologyInfo and cpu_ids in podresources
It covers deviceplugin & cpumanager.

It has drawback, since cpuset and all other structs including cadvisor's keep
cpu as int, but for protobuf based interface is better to have fixed
int.
This patch also introduces additional interface CPUsProvider, while
DeviceProvider might have been extended too.

Checkpoint not covered by unit test.

Signed-off-by: Swati Sehgal <swsehgal@redhat.com>
Signed-off-by: Alexey Perevalov <alexey.perevalov@huawei.com>
2020-11-11 13:50:49 +03:00