Commit Graph

11202 Commits

Author SHA1 Message Date
Kubernetes Prow Robot
dc3f5ec6cc Merge pull request #112957 from mxpv/log-dir
Allow changing pod log directory
2024-03-04 21:07:06 -08:00
Kubernetes Prow Robot
229ebabc0a Merge pull request #123336 from HyunSu1768/hyunsu1768/use-switch-cases
Refactoring to encourage use of switch case
2024-03-04 20:07:06 -08:00
Kubernetes Prow Robot
4ed7f6b4c4 Merge pull request #123583 from saschagrunert/image-id-container-status
Add `image_id` to CRI `ContainerStatus` message
2024-03-04 11:23:41 -08:00
Kubernetes Prow Robot
89cbd94e68 Merge pull request #123593 from giuseppe/userns-use-kubelet-user-mappings
KEP-127: kubelet: honor kubelet user mappings
2024-03-04 10:24:52 -08:00
Jan Safranek
c4163a9cb8 Add label with access mode to SELinux metrics
In the KEP 1710 we promised to have all SELinux metrics with access mode
label, so cluster admin is able to distinguish when RWOP volumes are
failing to mount (-> SELinuxMountReadWriteOncePod feature gate must be
disabled) or volumes with any other access modes are failing (->
SELinuxMount feature gate must be disabled).

Adding the label to kubelet is quite straightforward, there were some
changes needed in the e2e test. Now grabMetrics() collects values of all
SELinux related metrics with all labels. It only skips unrelated volume
plugins. And waitForMetricIncrease gets metric with all labels on input, so
it can check that say RWOP metric increased and RWX one did not.
2024-03-04 13:16:56 +01:00
Kubernetes Prow Robot
4164e7c3a7 Merge pull request #123629 from thockin/master
Get rid of unused API type NodeResources
2024-03-02 12:33:18 -08:00
Rodrigo Campos
6174f199df kublet/userns: Add test switching feature gate off/on
Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
2024-03-02 12:15:44 +01:00
Rodrigo Campos
4bb508dd30 kubelet/userns: Add unit test
Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
2024-03-02 12:15:44 +01:00
Rodrigo Campos
0b69c2bc81 kubelet/userns: Use kubelet maxPods
We don't have the alpha limitation anymore, let's just use the kubelet
maxPods instead of our hardcoded 1024 max.

Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
2024-03-02 12:15:44 +01:00
Rodrigo Campos
39c6815676 kubelet/userns: Remove alpha maxPods limitation
Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
2024-03-02 12:15:44 +01:00
Rodrigo Campos
4180284dc9 pkg/kubelet/userns: Remove outdated test
When we were alocating the whole UID space, the first range was reserved
to the host. Now we don't allocate the whole UID space, but just the
range configured, so the first range doesn't point to [0;65535] anymore,
so no need to test it is always set.

Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
2024-03-02 12:15:43 +01:00
Giuseppe Scrivano
87a057d417 KEP-127: kubelet: honor kubelet user mappings
allow to specify what IDs must be used by the kubelet to create user
namespaces.

If no additional UIDs/GIDs are not allocated to the "kubelet" user,
then the kubelet assumes it can use any ID on the system.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-03-02 12:15:39 +01:00
Kubernetes Prow Robot
673d3c9e70 Merge pull request #122693 from yanggangtony/fix_kubelet_server_journal_linux
Fix kubelet_server_journal --until parms.
2024-03-01 16:59:38 -08: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
467d5d745c Get rid of unused API type NodeResources 2024-03-01 15:13:50 -08:00
Kubernetes Prow Robot
24267f6aa7 Merge pull request #122438 from kannon92/splitfs-tests
[KEP - 4191]: Use Cadvisor labels rather than hard coding them into kubelet
2024-03-01 10:04:57 -08:00
Kubernetes Prow Robot
df366107d1 Merge pull request #123529 from thockin/go-workspaces
Go workspaces for k/k and k/staging/*
2024-03-01 08:43:03 -08:00
Patrick Ohly
1d653e6185 test: use cancelation from ktesting
The return type of ktesting.NewTestContext is now a TContext. Code
which combined it WithCancel often didn't compile anymore (cannot overwrite
ktesting.TContext with context.Context). This is a good thing because all of
that code can be simplified to let ktesting handle the cancelation.
2024-03-01 07:51:22 +01:00
Kevin Hannon
d58ff6c056 allow for cadvisor to detect split filesystem and add some e2e tests 2024-03-01 01:15:53 -05:00
Tim Hockin
6dbc754ed6 Retool typecheck to be simpler
Instead of walking paths ourselves, just let Go's packages library do
it.  This is a slight CLI change - it wants "./foo" rather than "foo".

This also flagged a few things which seem to be legit failures.
2024-02-29 22:07:00 -08:00
Tim Hockin
b725fd20c2 Fix update/verify-mocks.sh
There appears to be a bug in `go generate` for workspaces which will be
fixed in the 1.22.1 release.
2024-02-29 22:06:00 -08:00
Kubernetes Prow Robot
56a1b075cd Merge pull request #122870 from wzshiming/kep-2681
Promote KEP-2681 to GA in 1.30
2024-02-29 15:11:33 -08:00
Kubernetes Prow Robot
4c71261872 Merge pull request #123095 from reinka/test/eviction-manager-pid-pressure
add unit test for eviction manager pid pressure
2024-02-29 11:55:28 -08:00
Sascha Grunert
e38531e9a2 Add image_id to CRI ContainerStatus message
There is a conversion function `ConvertPodStatusToRunningPod`, which
can override the `Container.ImageID` into a digested reference from the
`ContainerStatus` CRI RPC, which gets mapped from the `image_ref`:

411c29c39f/pkg/kubelet/container/helpers.go (L259-L292)

To avoid that failure case, we now introduce the same `image_id` into
the container status and let runtimes separate the fields.

We also add a note that the mapping from the digested reference of the
CRI to the Kubernetes Pod API `ImageID` field is intentional and should
not change.

Follow-up on: https://github.com/kubernetes/kubernetes/pull/123508

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2024-02-29 12:41:55 +01:00
Kubernetes Prow Robot
70383f3701 Merge pull request #119561 from payall4u/fix-kubelet-panic-when-allocate-device
Fix kubelet panic when allocate resource for pod.
2024-02-29 03:06:54 -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
Shiming Zhang
d303cec118 Update test 2024-02-29 11:48:18 +08:00
Kubernetes Prow Robot
68a47053d1 Merge pull request #123508 from saschagrunert/image-id-container
Add `image_id` to CRI `Container` message
2024-02-28 11:01:35 -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
Sascha Grunert
e663285ccf Add image_id to CRI Container message
This new field allows fixing the kubelet image garbage collection in
container runtimes. The `image_ref` has been historically used by
container runtimes to reference images by digest.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2024-02-28 10:05:07 +01:00
Kubernetes Prow Robot
cb989b84c8 Merge pull request #123424 from haircommander/image-gc-beta
Promote ImageMaximumGCAge to beta
2024-02-27 16:47:36 -08:00
Kubernetes Prow Robot
b63e991b57 Merge pull request #123216 from giuseppe/runtime-handler-cri
KEP-127: require userns support from the CRI runtime before using it
2024-02-27 14:15:03 -08:00
Peter Hunt
cb39dfc9de Promote ImageMaximumGCAge to beta
and set to be on by default, adapting e2e tests for it

Signed-off-by: Peter Hunt <pehunt@redhat.com>
2024-02-27 15:11:45 -05:00
Kubernetes Prow Robot
12217672a3 Merge pull request #123358 from pacoxu/fix-cri-stats-panic
fix panic in CRI stats of windows
2024-02-27 05:14:58 -08:00
Rodrigo Campos
0e2b447269 kubelet/userns: Test new functionality with feature gate enabled
Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
2024-02-27 12:01:00 +01:00
Rodrigo Campos
658b45cd03 kublet/userns: Test new functionality with feature gate disabled
We just added some more functionality, let's make sure it works fine
with the feature gate disabled.

Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
2024-02-27 12:01:00 +01:00
Rodrigo Campos
1fb1218f57 kublet/userns: Switch TestGetOrCreateUserNamespaceMappingsDisabled to table format
Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
2024-02-27 12:01:00 +01:00
Giuseppe Scrivano
b2a92406ef KEP-127: check for runtime handler userns support
block the creation of a pod that requires a user namespace, unless the
runtime handler has support for it.

If the pod requested for a user namespace, and the handler does not
support it then return an error regardless of the feature gate.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-02-27 12:01:00 +01:00
Giuseppe Scrivano
024146f705 KEP-127: the kubelet stores runtime helpers
as they are received from the ResponseStatus request to the runtime.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-02-27 11:07:35 +01:00
Kubernetes Prow Robot
c53ac4cee4 Merge pull request #123157 from jsafrane/selinux-rwx
Add SELinuxMount feature gate
2024-02-26 12:06:39 -08:00
Kubernetes Prow Robot
98bd90fbe2 Merge pull request #114672 from pohly/log-text-split-streams
log: split streams also for text output
2024-02-26 01:44:58 -08:00
reinka
0f083966a7 set actual podToMake values 2024-02-25 19:28:22 +01:00
Harsha Narayana
e2506906d6 kubelet: fix flaky unit test with TestRotateLogs due to improper handling of goroutine in the tests 2024-02-23 16:28:35 +05:30
Kubernetes Prow Robot
58bbf69913 Merge pull request #123442 from jsafrane/reconstruction-ga
KEP 3756: Mark NewVolumeManagerReconstruction as GA
2024-02-22 08:14:55 -08:00
Kubernetes Prow Robot
cbfebf02e8 Merge pull request #121720 from aojea/first_pod_network_startup
kubelet: add internal metric for the first pod with network latency
2024-02-22 07:13:25 -08:00
Jan Safranek
2e92036576 Rename "new" reconstruction just to reconstruction
There is no "old" reconstruction, so remove "_new" from the file names and
function names.
2024-02-22 13:20:38 +01:00
Jan Safranek
2a2542289f Remove usage of NewVolumeManagerReconstruction feature gate
This removes lot of code related to "old" VolumeManage reconstruction.
2024-02-22 10:21:13 +01:00
Kubernetes Prow Robot
948c5d9b4f Merge pull request #122780 from pacoxu/fix-mirror-pod-log
kubelet: make log more clearer for not create a mirror pod
2024-02-21 13:08:19 -08:00
Maksym Pavlenko
8375163008 Add test to validate non empty pod log dir
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2024-02-21 12:56:13 -08:00
Kubernetes Prow Robot
d311ce0435 Merge pull request #123343 from haircommander/image-gc-e2e-2
KEP-4210: add e2e tests and add small fix for ImageGCMaxAge
2024-02-20 10:48:15 -08:00