Commit Graph

127299 Commits

Author SHA1 Message Date
Darren Shepherd
9a3e03cac1 Make kubelet.sock path changable 2025-07-16 11:49:30 -03:00
Darren Shepherd
b214d52628 only use the resolved name if port was zero 2025-07-16 11:49:30 -03:00
Darren Shepherd
deeccfbafb If you can't set hashsize on nf_conntrack don't fail 2025-07-16 11:49:30 -03:00
Darren Shepherd
1ce39a6a5c Drop credential providers 2025-07-16 11:49:30 -03:00
Darren Shepherd
9b8076b3f5 Drop storage plugins 2025-07-16 11:49:30 -03:00
Darren Shepherd
404962f3d2 Drop client-go cloud auth 2025-07-16 11:49:30 -03:00
Kubernetes Release Robot
158eee9fac Release commit for Kubernetes v1.32.7 2025-07-15 18:00:32 +00:00
Kubernetes Prow Robot
79edb7e03d
Merge pull request #132281 from neolit123/automated-cherry-pick-of-#130782-origin-release-1.32
Automated cherry pick of #130782: Kubeadm issue #3152 ControlPlane node setup failing with "etcdserver: can only promote a learner member"
2025-07-11 17:45:34 -07:00
Kubernetes Prow Robot
39ec379044
Merge pull request #131578 from ndbaker1/automated-cherry-pick-of-#131251-origin-release-1.32
Automated cherry pick of #131251: fix(kubelet): acquire imageRecordsLock when removing image
2025-07-11 17:45:28 -07:00
Kubernetes Prow Robot
bcb9d4ce05
Merge pull request #132727 from mimowo/automated-cherry-pick-of-#132614-upstream-release-1.32
Automated cherry pick of #132614: Fix validation for Job with suspend=true,completions=0 to set Complete condition
2025-07-11 16:21:27 -07:00
Kubernetes Prow Robot
f5f9e1b3cc
Merge pull request #132861 from mimowo/automated-cherry-pick-of-#132502-upstream-release-1.32
Automated cherry pick of #132502: Fix flake caused by invalid detection of active policies in VAP integration tests
2025-07-11 14:13:29 -07:00
Ben Luddy
bb2ad5a644 Use per-policy marker names for VAP integration tests.
Writes to policy resources don't instantaneously take effect in admission. ValidatingAdmissionPolicy
integration tests determine that the policies under test have taken effect by adding a sentinel
policy rule and polling until that rule is applied to a request.

If the marker resource names are the same for each test case in a series of test cases, then
observing a policy's effect on a marker request only indicates that _any_ test policy is in effect,
but it's not necessarily the policy the current test case is waiting for. For example:

1. Test 1 creates a policy and binding.

2. The policy and binding are observed by the admission plugin and take effect.

3. Test 1 observes that a policy is in effect via marker requests.

4. Test 1 exercises the behavior under test and successfully deletes the policy and binding it
created.

5. Test 2 creates a policy and binding.

6. Test 2 observes that a policy is in effect via marker requests, but the policy in effect is still
the one created by Test 1.

7. Test 2 exercises the behavior under test, which fails because it was evaluated against Test 1's
policy.

Generating a per-policy name for the marker resource in each test resolves the timing issue. In the
example, step (6) will not proceed until the admission plugin has observed the policy and binding
created in (5).
2025-07-10 10:12:56 +02:00
Kubernetes Prow Robot
5b6a01c2c6
Merge pull request #132159 from linxiulei/automated-cherry-pick-of-#132109-release-1.32
Automated cherry pick of #132109: Clean backoff record earlier
2025-07-09 10:17:26 -07:00
Michal Wozniak
339ead4307 Review remarks 2025-07-04 11:28:24 +02:00
Michal Wozniak
4c58a9d19d Fix validation for Job with suspend=true,completions=0 to set Complete condition 2025-07-04 11:28:24 +02:00
Kubernetes Release Robot
c14c5722a2 Update CHANGELOG/CHANGELOG-1.32.md for v1.32.6 2025-06-17 21:22:48 +00:00
Kubernetes Release Robot
036f7ed3f1 Release commit for Kubernetes v1.32.6 2025-06-17 21:01:12 +00:00
Kubernetes Prow Robot
66b2951498
Merge pull request #132225 from cpanato/update-go-1-32
[release-1.32] [go]Bump images, dependencies and versions to go 1.23.10 and distroless iptables
2025-06-13 03:46:57 -07:00
bconry
355302eecf Add check to see if promote worked within the retry loop 2025-06-13 10:05:15 +03:00
Carlos Panato
7246ec90c1
Bump images, dependencies and versions to go 1.23.10 and distroless iptables
Signed-off-by: Carlos Panato <ctadeu@gmail.com>
2025-06-11 08:32:50 +02:00
Eric Lin
62eb11dd5f Clean backoff record earlier
Once received job deletion event, it cleans the backoff records for that
job before enqueueing this job so that we can avoid a race condition
that the syncJob() may incorrect use stale backoff records for a newly created
job with same key.

Co-authored-by: Michal Wozniak <michalwozniak@google.com>
2025-06-06 20:51:06 +00:00
Kubernetes Prow Robot
2aa6d7d467
Merge pull request #131782 from rata/automated-cherry-pick-of-#131623-upstream-release-1.32
Automated cherry pick of #131623: kubelet: userns: Improve errors returned to the user
2025-06-05 21:28:37 -07:00
Kubernetes Prow Robot
5b3e813641
Merge pull request #132099 from gnufied/automated-cherry-pick-of-#131408-upstream-release-1.32
Automated cherry pick of #131408: Remove warning about resizing failed for unknown reason
2025-06-05 17:40:39 -07:00
Kubernetes Prow Robot
09750267c3
Merge pull request #132010 from gnufied/automated-cherry-pick-of-#131987-upstream-release-1.32
Automated cherry pick of #131987: Automated cherry pick of #131868: Remove superflous expansion calls if controller finished expansion
2025-06-05 14:24:38 -07:00
Kubernetes Prow Robot
6471cec0de
Merge pull request #131784 from rata/automated-cherry-pick-of-#130243-upstream-release-1.32
Automated cherry pick of #130243: Revert userns kernel check
2025-06-05 08:50:45 -07:00
Kubernetes Prow Robot
790dc3b4fa
Merge pull request #131652 from princepereira/automated-cherry-pick-of-#131506-upstream-release-1.32
Automated cherry pick of #131506: Update hnslib version in Windows KubeProxy.
2025-06-05 08:50:38 -07:00
Kubernetes Prow Robot
b41aa67124
Merge pull request #131786 from rata/automated-cherry-pick-of-#130800-upstream-release-1.32
Automated cherry pick of #130800: Fix unit tests on windows
2025-06-04 15:24:42 -07:00
Kubernetes Prow Robot
448eedf8ef
Merge pull request #131875 from pohly/automated-cherry-pick-of-#131844-origin-release-1.32
Automated cherry pick of #131844: DRA node: reject static pods which reference ResourceClaims
2025-06-04 11:28:42 -07:00
Hemant Kumar
de8292ad6f Remove warning about resizing failed for unknown reason 2025-06-04 11:36:02 -04:00
Hemant Kumar
ec4c71b705 Add tests that validate the return value of resize operation 2025-05-28 22:22:54 -04:00
Kubernetes Prow Robot
89d95c9713
Merge pull request #131936 from cpanato/update-go-1.32
[release-1.32] [go] Bump images, dependencies and versions to go 1.23.9 and distroless iptables
2025-05-26 01:45:16 -07:00
Carlos Panato
40849d37ea
Bump images, dependencies and versions to go 1.23.9 and distroless iptables
Signed-off-by: Carlos Panato <ctadeu@gmail.com>
2025-05-23 09:17:51 -04:00
Patrick Ohly
9a67ee4a70 DRA node: reject static pods which reference ResourceClaims
If someone gains the ability to create static pods, they might try to use that
ability to run code which gets access to the resources associated with some
existing claim which was previously allocated for some other pod. Such an
attempt already fails because the claim status tracks which pods are allowed to
use the claim, the static pod is not in that list, the node is not authorized
to add it, and the kubelet checks that list before starting the pod in
195803cde5/pkg/kubelet/cm/dra/manager.go (L218-L222).

Even if the pod were started, DRA drivers typically manage node-local resources
which can already be accessed via such an attack without involving DRA. DRA
drivers which manage non-node-local resources have to consider access by a
compromised node as part of their threat model.

Nonetheless, it is better to not accept static pods which reference
ResourceClaims or ResourceClaimTemplates in the first place because there
is no valid use case for it.

This is done at different levels for defense in depth:
- configuration validation in the kubelet
- admission checking of node restrictions
- API validation

Co-authored-by: Jordan Liggitt <liggitt@google.com>

Code changes by Jordan, with one small change (resourceClaims -> resourceclaims).
Unit tests by Patrick.
2025-05-21 08:40:28 +02:00
Rodrigo Campos
07011c05b7 pkg/kubelet/userns: Remove skip on windows
We don't build these tests for Windows, let's remove this skip.

We should have never added that skip, we should have skipped the entire
suite on Windows.

Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
2025-05-15 12:30:21 +02:00
Rodrigo Campos
1d923fbc78 pkg/kubelet/userns: Wrap error to get mappings
I needed to wrap the error for debugging, let's just keep this as it is
useful.

Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
2025-05-15 12:30:21 +02:00
Rodrigo Campos
3755f8e2f2 pkg/kubelet/userns: Provide stub implementation for windows
Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
2025-05-15 12:30:21 +02:00
Rodrigo Campos
b5d6f06fe6 pkg/kubelet: Fix userns tests on Windows
Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
2025-05-15 12:30:21 +02:00
Rodrigo Campos
5e7201df69 Revert "Enforce the Minimum Kernel Version 6.3 for UserNamespacesSupport feature"
This reverts commit 8597b343fa.

I wrote in the Kubernetes documentation:

	In practice this means you need at least Linux 6.3, as tmpfs started
	supporting idmap mounts in that version. This is usually needed as
	several Kubernetes features use tmpfs (the service account token that is
	mounted by default uses a tmpfs, Secrets use a tmpfs, etc.)

The check is wrong for several reasons:
	* Pods can use userns before 6.3, they will just need to be
	  careful to not use a tmpfs (like a serviceaccount). MOST users
	  will probably need 6.3, but it is possible to use earlier kernel
	  versions. 5.19 probably works fine and with improvements in
          the runtime 5.12 can probably be supported too.
	* Several distros backport changes and the recommended way is
	  usually to try the syscall instead of testing kernel versions.
	  I expect support for simple fs like tmpfs will be backported
	  in several distros, but with this check it can generate confusion.
	* Today a clear error is shown when the pod is created, so it's
	  unlikely a user will not understand why it fails.
	* Returning an error if utilkernel fails to understand what
	  kernel version is running is also too strict (as we are
	  logging a warning even if it is not the expected version)
	* We are switching to enabled by default, which will log a
	  warning on every user that runs on an older than 6.3 kernel,
	  adding noise to the logs.

For there reasons, let's just remove the hardcoded kernel version check.

Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
2025-05-15 12:26:08 +02:00
Rodrigo Campos
a35311c358 Revert "Switch hard error to a WARNING for kernel version check"
This reverts commit fd06dcd604.

The revert is not to make it a hard error again, this revert is needed
to revert cleanly the commit that added this as an error in the first
place.

Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
2025-05-15 12:26:08 +02:00
Rodrigo Campos
54889f0532 userns: Wrap more errors
Most errors where already wrapped, but these were missing.

Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
2025-05-15 12:21:30 +02:00
Rodrigo Campos
9326fc3097 userns: Improve error returned if userns is not supported
This makes it clear the error comes due to a user namespace
configuration. Otherwise the error returned looks too generic and is not
clear.

Before this PR, the error was:

	  Warning  FailedCreatePodSandBox  1s    kubelet            Failed to create pod sandbox: the handler "" is not known

Now it is:

	  Warning  FailedCreatePodSandBox  1s    kubelet            Failed to create pod sandbox: runtime does not support user namespaces

Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
2025-05-15 12:21:30 +02:00
Rodrigo Campos
fd5862185f userns: Use len to handle empty non-nil slices
When using an old runtime like containerd 1.7, this message is not
implemented and what we get here is an empty non-nil slice. Let's check
the len of the slice instead.

While we are there, let's just return false and no error. In the
following commits we will wrap the error and we didn't find any more
info to add here.

Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
2025-05-15 12:21:30 +02:00
Kubernetes Release Robot
95c119b504 Update CHANGELOG/CHANGELOG-1.32.md for v1.32.5 2025-05-15 09:27:49 +00:00
Kubernetes Release Robot
9894294ef1 Release commit for Kubernetes v1.32.5 2025-05-15 09:05:02 +00:00
Kubernetes Prow Robot
3f75cae603
Merge pull request #131524 from carlory/automated-cherry-pick-of-#131495-release-1.32
Automated cherry pick of #131495: Handle unsupported node expansion for RWX volumes
2025-05-13 23:05:23 -07:00
Kubernetes Prow Robot
55a2f43a98
Merge pull request #131438 from gnufied/automated-cherry-pick-of-#131418-upstream-release-1.32
Automated cherry pick of #131418: Check for newer fields when deciding expansion recovery feature status
2025-05-13 23:05:16 -07:00
Kubernetes Prow Robot
01aff800b6
Merge pull request #131528 from ameukam/update-go-1-23-8
[release-1.32][go] Bump images, dependencies and versions to go 1.23.8 and distroless iptables
2025-05-13 05:03:16 -07:00
Prince Pereira
9a57de0ec6 Update hnslib version in Windows KubeProxy. 2025-05-07 09:48:49 -07:00
Kubernetes Prow Robot
a624d76abd
Merge pull request #131428 from princepereira/automated-cherry-pick-of-#131138-upstream-release-1.32
Automated cherry pick of #131138: Fix for HNS local endpoint was being deleted instead of the remote endpoint.
2025-05-06 17:59:13 -07:00
Nick Baker
22e84c9abf fix(kubelet): acquire imageRecordsLock when removing image 2025-05-01 21:55:23 -07:00