Commit Graph

488 Commits

Author SHA1 Message Date
Siyuan Zhang
8fc3a33454 Refactor compatibility version code
Replace DefaultComponentGlobalsRegistry with new instance of componentGlobalsRegistry in test api server.

Signed-off-by: Siyuan Zhang <sizhang@google.com>

move kube effective version validation out of component base.

Signed-off-by: Siyuan Zhang <sizhang@google.com>

move DefaultComponentGlobalsRegistry out of component base.

Signed-off-by: Siyuan Zhang <sizhang@google.com>

move ComponentGlobalsRegistry out of featuregate pkg.

Signed-off-by: Siyuan Zhang <sizhang@google.com>

remove usage of DefaultComponentGlobalsRegistry in test files.

Signed-off-by: Siyuan Zhang <sizhang@google.com>

change non-test DefaultKubeEffectiveVersion to use DefaultBuildEffectiveVersion.

Signed-off-by: Siyuan Zhang <sizhang@google.com>

Restore useDefaultBuildBinaryVersion in effective version.

Signed-off-by: Siyuan Zhang <sizhang@google.com>

rename DefaultKubeEffectiveVersion to DefaultKubeEffectiveVersionForTest.

Signed-off-by: Siyuan Zhang <sizhang@google.com>

pass options.ComponentGlobalsRegistry into config for controller manager and scheduler.

Signed-off-by: Siyuan Zhang <sizhang@google.com>

Pass apiserver effective version to DefaultResourceEncodingConfig.

Signed-off-by: Siyuan Zhang <sizhang@google.com>

change statusz registry to take effective version from the components.

Signed-off-by: Siyuan Zhang <sizhang@google.com>

Address review comments

Signed-off-by: Siyuan Zhang <sizhang@google.com>

update vendor

Signed-off-by: Siyuan Zhang <sizhang@google.com>
2025-02-05 16:10:53 -08:00
Kubernetes Prow Robot
2bda5dd8c7 Merge pull request #129656 from vinayakankugoyal/kep2862beta
KEP-2862: Graduate to BETA.
2025-01-27 19:05:23 -08:00
Vinayak Goyal
3a780a1c1b KEP-2862: Graduate to BETA. 2025-01-24 21:36:00 +00:00
Tim Allclair
bda81f1b68 Kubelet server handler cleanup 2025-01-21 16:31:52 -08:00
Kubernetes Prow Robot
3ec9c7f4d2 Merge pull request #128811 from zhifei92/statusz
add statusz endpoint  for kubelet
2024-12-22 11:24:10 +01:00
zhifei92
75e5bd6a4f Fix unit test. 2024-12-17 14:25:37 +08:00
zhifei92
b9fc5678d9 Not using fine-grained auth. 2024-12-17 13:27:01 +08:00
zhangzhifei16
7caff55fd9 Add statusz to kubelet auth. 2024-12-11 14:34:13 +08:00
zhifei92
902dedbb52 fix: Move statusz to debugging handlers. 2024-12-10 10:40:14 +08:00
zhifei92
816cd40280 Unify ComponentKubelet and add unit tests. 2024-12-10 10:32:14 +08:00
zhifei92
a04df83f86 add statusz for kubelet 2024-12-10 10:32:14 +08:00
Patrick Ohly
8a908e0c0b remove import doc comments
The "// import <path>" comment has been superseded by Go modules.
We don't have to remove them, but doing so has some advantages:

- They are used inconsistently, which is confusing.
- We can then also remove the (currently broken) hack/update-vanity-imports.sh.
- Last but not least, it would be a first step towards avoiding the k8s.io domain.

This commit was generated with
   sed -i -e 's;^package \(.*\) // import.*;package \1;' $(git grep -l '^package.*// import' | grep -v 'vendor/')

Everything was included, except for
   package labels // import k8s.io/kubernetes/pkg/util/labels
because that package is marked as "read-only".
2024-12-02 16:59:34 +01:00
Jian Zeng
94cd0a0892 feat(kubelet): only returns logs that match the given stream
Signed-off-by: Jian Zeng <anonymousknight96@gmail.com>
2024-11-07 13:52:16 +08:00
zhangzhifei16
1381e41f28 feat: Integrate device plugin registration gRPC server health checks. 2024-11-05 19:59:56 +08:00
Richa Banker
6eeac6d32f Add tests 2024-10-30 14:01:32 -07:00
zhifei92
dac7332ed2 integrate kubelet with the systemd watchdog
feat:  add unit test

feat:  add FeatureGate for SystemdWatchdog

fix:  linter and failed tests

feat:  add SystemdWatchdog to versioned feature list yaml
2024-10-21 10:46:14 +08:00
Kubernetes Prow Robot
f5ae0413ca Merge pull request #126347 from vinayakankugoyal/kep2862impl
KEP-2862: Fine-grained Kubelet API Authorization
2024-10-18 03:53:04 +01:00
Vinayak Goyal
b1f290d444 KEP-2862: Fine-grained Kubelet API Authorization
Signed-off-by: Vinayak Goyal <vinaygo@google.com>
2024-10-17 20:53:27 +00:00
Kubernetes Prow Robot
a7fcc89ac0 Merge pull request #125936 from sivchari/use-ptr
use utils/ptr package instead of utils/pointer
2024-10-07 01:02:04 +01:00
sivchari
4eab3cca0a use utils/ptr package instead of utils/pointer
Signed-off-by: sivchari <shibuuuu5@gmail.com>
2024-10-03 11:33:12 +09:00
Kubernetes Prow Robot
909f9b912e Merge pull request #127692 from mmorel-35/testifylint/expected-actual@k8s.io/kubernetes
fix: enable expected-actual rule from testifylint in module `k8s.io/kubernetes`
2024-09-28 05:54:01 +01:00
Matthieu MOREL
f736cca0e5 fix: enable expected-actual rule from testifylint in module k8s.io/kubernetes
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2024-09-27 07:56:31 +02:00
Matthieu MOREL
b7248077a9 fix: enable formatter rule from testifylint in module k8s.io/kubernetes
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2024-09-26 08:19:54 +02:00
Matthieu MOREL
27b98be303 fix: enable nil-compare and error-nil rules from testifylint in module k8s.io/kubernetes
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2024-09-25 06:02:47 +02:00
Kubernetes Prow Robot
27fa59a8af Merge pull request #125656 from gyuho/recent-stats-check-error-for-error-level-logging
feat(kubelet/stats): match cadvisor error to lower not found stats log level
2024-07-18 19:24:01 -07:00
Mark Rossetti
0411a3d565 Add support for memory pressure evictiong on Windows
Signed-off-by: Mark Rossetti <marosset@microsoft.com>
2024-07-17 15:11:30 -07:00
Matthieu MOREL
f014b754fb fix: enable empty and len rules from testifylint on pkg package
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>

Co-authored-by: Patrick Ohly <patrick.ohly@intel.com>
2024-07-06 23:15:43 +00:00
Gyuho Lee
ac992f9a92 remove unncessary errors.Unwrap calls
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2024-07-03 21:31:57 +08:00
Gyuho Lee
1e3dc23e16 v4 logging
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2024-06-27 00:13:45 +08:00
Gyuho Lee
d29bdab951 feat(kubelet/stats): match cadvisor error to lower not found stats log level
This "RecentStats: unable to find data in memory cache" error is not actionable,
in terms of kubelt, if the entry is not found in the memory cache.

Thus, proposing it to lower the log level to info.

Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2024-06-24 12:25:03 +08:00
Stephen Kitt
3f36c83c68 Switch to stretchr/testify / mockery for mocks
testify is used throughout the codebase; this switches mocks from
gomock to testify with the help of mockery for code generation.

Handlers and mocks in test/utils/oidc are moved to a new package:
mockery operates package by package, and requires packages to build
correctly; test/utils/oidc/testserver.go relies on the mocks and fails
to build when they are removed. Moving the interface and mocks to a
different package allows mockery to process that package without
having to build testserver.go.

Signed-off-by: Stephen Kitt <skitt@redhat.com>
2024-06-20 19:42:53 +02:00
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
Marek Siarkowicz
3ee8178768 Cleanup defer from SetFeatureGateDuringTest function call 2024-04-24 20:25:29 +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
Stephen Kitt
6bf667af06 Switch from golang/mock to uber-go/mock
See https://github.com/golang/mock#gomock: golang/mock is no longer
maintained, and should be replaced by go.uber.org/mock.

This allows golang/mock to be dropped from the status and vendored
fields in unwanted-dependencies.json.

Signed-off-by: Stephen Kitt <skitt@redhat.com>
2024-03-07 09:12:16 +01:00
Kubernetes Prow Robot
cde4788a27 Merge pull request #123215 from adrianreber/2024-02-09-forensic-container-checkpointing-beta
Switch 'ContainerCheckpoint' from Alpha to Beta
2024-03-01 15:59:24 -08:00
Tim Hockin
e2b529fda7 Fix a test that doesn't build on Windows
Typecheck should catch this but didn't.  Fortunately I fixed that in an
upcoming commit.
2024-02-29 00:22:04 -08:00
Kubernetes Prow Robot
f139450e9b Merge pull request #122885 from claudiubelu/unittests-10
unittests: Fixes unit tests for Windows (part 10)
2024-02-28 05:38:40 -08: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
Claudiu Belu
b8df7e7684 unittests: Fixes unit tests for Windows (part 10)
Currently, there are some unit tests that are failing on
Windows due to various reasons:

- Different "File not found" error messages on Windows.
- Files need to be closed on Windows before removing them.
- The default RootHnsEndpointName (root-hnsendpoint-name) flag value is 'cbr0'
- On Windows, Unix Domain sockets are not checked in the same way in golang, which is why
  hostutils_windows.go checks for it differently. GetFileType will return an error in this
  case. We need to check for it, and see if it's actually a Unix Domain Socket.
2024-01-22 13:43:42 +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
Davanum Srinivas
d621e09a52 remove unused GetRawContainerInfo
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2023-12-15 05:56:22 -08:00
Davanum Srinivas
e2cf9692fc Remove unused code in kubelet - take 1
spotted `DockerContainer` in types.go and pulling on whether we
really needed it found that a bunch of code is not really
required.

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2023-12-14 13:31:38 -08: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
Kevin Hannon
26923b91e8 implementation of split disk kep 2023-11-01 14:46:33 -04:00
Sean Sullivan
168998e87b StreamTranslator and FallbackExecutor for WebSockets 2023-10-23 15:33:38 -07: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