Commit Graph

11214 Commits

Author SHA1 Message Date
Patrick Ohly
6f1ddfcd2e kubelet: support structured parameters for preparing resources
If the resource handle has data from a structured parameter model, then we need
to pass that to the DRA driver kubelet plugin. Because Kubernetes uses
gogo/protobuf, we cannot use "optional" for that new optional field and have to
resort to "repeated" with a single repetition if present.

This is a new, backwards-compatible field.

That extending the resource.k8s.io changes the checksum of a kubelet checkpoint
is unfortunate. Updating the test cases is a stop-gap measure, the actual
solution will have to be something else before beta.
2024-03-07 22:22:13 +01:00
Kubernetes Prow Robot
bd25605619 Merge pull request #123435 from tallclair/apparmor-ga
AppArmor fields API
2024-03-06 15:35:14 -08:00
Kubernetes Prow Robot
87f9b3891e Merge pull request #123385 from HirazawaUi/allow-special-characters
Allow almost all printable ASCII characters in environment variables
2024-03-05 17:31:06 -08:00
Kubernetes Prow Robot
5b4d97dc5a Merge pull request #122541 from aojea/headless_selector
Implement a field selector for ClusterIP on Services
2024-03-05 17:30:57 -08:00
Kubernetes Prow Robot
3686ceb5b8 Merge pull request #122745 from kannon92/swap-no-swap-default
[KEP-2400] add no swap as the default option for swap
2024-03-05 16:32:40 -08:00
Kubernetes Prow Robot
5f4a20e65d Merge pull request #120718 from gjkim42/add-restartable-init-containers-to-pod-resources-api
Make PodResources API include restartable init containers
2024-03-05 13:44:54 -08:00
Kevin Hannon
6a4e19a4ec add no swap as the default option for swap 2024-03-05 16:10:42 -05:00
Tim Allclair
24537a9131 Stop appending AppArmor status to node ready condition 2024-03-05 12:22:50 -08:00
Tim Allclair
bf3c8464ba Implement Kubelet AppArmor field handling 2024-03-05 12:22:50 -08:00
Antonio Ojea
5122fe0732 don't watch headless services on kubelet
The kubelet watches services only to generate the environment variables
inside a pod, but headless services are not needed for this.

Change-Id: I22ee2b3352f8fe71cddfafa6f09b768c0a0e26b4
2024-03-05 17:16:48 +00:00
HirazawaUi
fa3c101439 relax validation pod envfrom 2024-03-05 17:09:15 +08:00
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