Commit Graph

6909 Commits

Author SHA1 Message Date
Kubernetes Prow Robot
31a3b4eb53 Merge pull request #136099 from jsafrane/automated-cherry-pick-of-#135629-upstream-release-1.34
Automated cherry pick of #135629: selinux: Fix the controller to ignore finished pods
2026-01-11 02:15:59 +05:30
Filip Křepinský
e24e713ab7 mark QuotaMonitor as not running and invalidate monitors list
to prevent close of closed channel panic
2026-01-08 13:44:17 +01:00
Jan Safranek
0b27e410f0 Add unit test with CSIDriver.SELinuxMount=false
Add unit test with a volume plugin that does not support SELinux. That
simulates a CSi driver whose spec.SELinuxMount is empty or false.

This requires a little refactoring, each unit test now has a flag if it
runs with a volume plugin that supports SELinux.
2026-01-08 11:16:36 +01:00
Jan Safranek
e0600b8e39 Use only enqueuePod to add pods to the controller queue
enqueuePod already creates the right key for a pod, it's better to reuse it
than copy the code around.
2026-01-08 11:16:36 +01:00
Jan Safranek
3e55c95bb0 Fix policy of Pods with unknown SELinux label
Reset SELinuxChangePolicy of Pods that have no SELinux label set to
Recursive. Kubelet cannot mount with `-o context=<label>`, if the label is
not known.

This fixes the e2e test error revealed by the previous commit - it changed the
e2e test to check for events when no events are expected and it found a
warning about a Pod with no label, but MountOption policy.
2026-01-08 11:16:36 +01:00
Jan Safranek
4410a9edc7 Add new unit tests 2026-01-08 11:16:36 +01:00
Jan Safranek
1bf9b3d261 Rework unit tests to builder pattern 2026-01-08 11:16:36 +01:00
Jan Safranek
b25300bb21 selinux: Do not report conflits with finished pods
When a Pod reaches its final state (Succeeded or Failed), its volumes are
getting unmounted and therefore their SELinux mount option will not
conflict with any other pod.

Let the SELinux controller monitor "pod updated" events to see the pod is
finished
2026-01-08 11:16:36 +01:00
Jan Safranek
4265285c64 refactoring: use a common function to enqueue Pod
addPod and deletePod have the same implementation, merge them into
enqueuePod
2026-01-08 11:16:36 +01:00
Jordan Liggitt
aade7b8e8d Fix spurious workload rollout due to null creationTimestamp in controller revisions 2025-11-03 21:18:35 -05:00
Jordan Liggitt
7c5ec38d1b Remove unused and fragile revision hash comparisons
This was broken since 666a41c2ea when the label value became non-integer encoded
The chance of one controller revision hash label being int-parsable: 7/27 ^ 8 = 0.00002041 = ~0
The chance of both being int-parsable: 0.00002041^2 = ~0

Hash comparison locks in differences in content failing EqualRevision
even when the semantic content is normalized to be equal.
2025-11-03 21:18:34 -05:00
Jordan Liggitt
d5ffe89038 Add unit test detecting spurious statefulset rollout 2025-11-03 21:18:34 -05:00
Jordan Liggitt
6ebab3f180 Include relevant dimensions in pod controller indexing 2025-10-16 13:55:04 -04:00
Kubernetes Prow Robot
8c0988abb6 Merge pull request #133745 from jsafrane/automated-cherry-pick-of-#133425-release-1.34
Automated cherry pick of #133425: Fix SELinux label comparison
2025-09-04 08:31:17 -07:00
xigang
a75938d9e5 Fix DaemonSet misscheduled status not updating on node taint changes
Signed-off-by: xigang <wangxigang2014@gmail.com>
2025-08-28 18:07:40 +08:00
Jan Safranek
3ebbe57311 Add a note about Conflicts return value 2025-08-28 10:29:24 +02:00
Jan Safranek
98dca817c9 Fix SELinux label comparison
The comparison of SELinux labels in KCM tolerates missing fields - the
operating system is going to default them from its defaults, but in KCM we
don't know what the defaults are.

But the OS won't default the last component, "level", which includes also
categories. Make sure that labels with a level set conflicts with level "",
that's what will conflict on the OS too.
2025-08-28 10:29:24 +02:00
Sunyanan Choochotkaew
7f052afaef KEP 5075: implement scheduler
Signed-off-by: Sunyanan Choochotkaew <sunyanan.choochotkaew1@ibm.com>
2025-07-30 09:52:49 +09:00
Luiz Oliveira
7fbf63a23f HPA support for pod-level resource specifications (#132430)
* HPA support for pod-level resource specifications

* Add e2e tests for HPA support for pod-level resource specifications
2025-07-29 09:02:26 -07:00
Eddie
727a6e6db5 Reject pod when attachment limit is exceeded (#132933)
* Reject pod when attachment limit is exceeded

Signed-off-by: Eddie Torres <torredil@amazon.com>

* Record admission rejection

Signed-off-by: Eddie Torres <torredil@amazon.com>

* Fix pull-kubernetes-linter-hints

Signed-off-by: Eddie Torres <torredil@amazon.com>

* Fix AD Controller unit test failure

Signed-off-by: Eddie Torres <torredil@amazon.com>

* Consolidate error handling logic in WaitForAttachAndMount

Signed-off-by: Eddie Torres <torredil@amazon.com>

* Improve error context

Signed-off-by: Eddie Torres <torredil@amazon.com>

* Update admissionRejectionReasons to include VolumeAttachmentLimitExceededReason

Signed-off-by: Eddie Torres <torredil@amazon.com>

* Update status message

Signed-off-by: Eddie Torres <torredil@amazon.com>

* Add TestWaitForAttachAndMountVolumeAttachLimitExceededError unit test

Signed-off-by: Eddie Torres <torredil@amazon.com>

* Add e2e test

Signed-off-by: Eddie Torres <torredil@amazon.com>

* Fix pull-kubernetes-linter-hints

Signed-off-by: Eddie Torres <torredil@amazon.com>

---------

Signed-off-by: Eddie Torres <torredil@amazon.com>
2025-07-24 17:58:54 -07:00
Kubernetes Prow Robot
a5d8ab60ef Merge pull request #132632 from sdowell/gc-rv-race
fix: add RV check on GC delete calls
2025-07-24 17:58:47 -07:00
Kubernetes Prow Robot
7912e5fd67 Merge pull request #131549 from carlory/KEP-3751-GA
[Kep-3751] Promote VolumeAttributesClass to GA
2025-07-24 16:44:27 -07:00
carlory
94bf8fc8a9 Promoted API VolumeAttributesClass and VolumeAttributesClassList to storage.k8s.io/v1.
Promoted feature-gate `VolumeAttributesClass` to GA (on by default)

Signed-off-by: carlory <baofa.fan@daocloud.io>
2025-07-25 01:53:59 +08:00
Patrick Ohly
5c4f81743c DRA: use v1 API
As before when adding v1beta2, DRA drivers built using the
k8s.io/dynamic-resource-allocation helper packages remain compatible with all
Kubernetes release >= 1.32. The helper code picks whatever API version is
enabled from v1beta1/v1beta2/v1.

However, the control plane now depends on v1, so a cluster configuration where
only v1beta1 or v1beta2 are enabled without the v1 won't work.
2025-07-24 08:33:45 +02:00
Kubernetes Prow Robot
6ad14ad876 Merge pull request #132991 from danwinship/endpoints-e2e-updates
Endpoints e2e updates for KEP-4974
2025-07-23 19:56:26 -07:00
Filip Křepinský
2cb48f77f0 schedule pod availability checks at the correct time in ReplicaSets 2025-07-23 18:58:57 +02:00
Taahir Ahmed
4624cb9bb9 Pod Certificates: Basic implementation
* Define feature gate
* Define and serve PodCertificateRequest
* Implement Kubelet projected volume source
* kube-controller-manager GCs PodCertificateRequests
* Add agnhost subcommand that implements a toy signer for testing

Change-Id: Id7ed030d449806410a4fa28aab0f2ce4e01d3b10
2025-07-21 21:49:57 +00:00
Rita Zhang
d42a1d58d0 DRAAdminAccess: add metrics
Signed-off-by: Rita Zhang <rita.z.zhang@gmail.com>
2025-07-18 07:15:41 -07:00
Dan Winship
24065780ed Add e2eendpointslice.WaitForEndpointPorts, use in some tests.
Slightly-more-generic replacement for validateEndpointsPortsOrFail()
(but only validates EndpointSlices, not Endpoints).

Also, add two new unit tests to the Endpoints controller, to assert
the correct Endpoints-generating behavior in the cases formerly
covered by the "should serve endpoints on same port and different
protocols" and "should be updated after adding or deleting ports" e2e
tests (since they are now EndpointSlice-only). (There's not much point
in testing the Endpoints controller in "end to end" tests, since
nothing in a normal cluster ever looks at its output, so there's
really only one "end" anyway.)
2025-07-17 15:34:34 -04:00
Kubernetes Prow Robot
fe13474f61 Merge pull request #106225 from shawnhanx/certificates_cleaner
cleaner.go should use time.Until instead of t.Sub(time.Now())
2025-07-14 23:44:24 -07:00
Kubernetes Prow Robot
566d6acb70 Merge pull request #131759 from carlory/clean-volumehost
Remove unused GetHostIP method
2025-07-12 05:35:28 -07:00
Kubernetes Prow Robot
bedb915a4e Merge pull request #132781 from PatrickLaabs/132086-pkg-controller-1
chore: depr. pointer pkg replacement for pkg/controller (1/2)
2025-07-07 12:32:24 -07:00
Kubernetes Prow Robot
66cf6286a8 Merge pull request #130909 from Edwinhr716/minreadyseconds-fix
Fix StatefulSetMinReadySeconds healthy concept
2025-07-07 12:31:26 -07:00
PatrickLaabs
baf71997f5 chore: depr. pointer pkg replacement for pkg/controller 2025-07-07 13:22:36 +02:00
PatrickLaabs
8abcdf0885 chore: depr. pointer pkg replacement for pkg/controller 2025-07-07 13:13:39 +02:00
Tsubasa Nagasawa
0ad351281b Cleanup duplicate function to get port number from named port
Currently, the function to translate named port to port number is
located in two places (pod utils and endpointslice lib).
When fixing the bug in restartable init containers, one part of the code
was fixed, but the other part was not, leaving the bug unresolved.
To prevent such partial fixes in the future, we will make the function
in the endpointslice lib public and remove the other part of the code
from pod utils. Then consume the endpointslice lib in k/k.

Signed-off-by: Tsubasa Nagasawa <toversus2357@gmail.com>
2025-07-05 10:03:30 +09:00
Kubernetes Prow Robot
0617903e9d Merge pull request #131344 from pohly/dra-taint-unit-test-flake-minimal
DRA: work around fake.ClientSet informer deficiency in unit test
2025-07-03 02:51:25 -07:00
Sam Dowell
1c1f00a5f4 fix: add RV check on GC delete calls
It was possible that the object was changed between the live Get and
Delete calls while processing an attempt to delete, causing incorrect
deletion of objects by the garbage collector. A defensive
resourceVersion precondition is added to the delete call to ensure that
the object was properly classified for deletion.
2025-07-02 11:01:56 -07:00
Kubernetes Prow Robot
4186edc4d1 Merge pull request #132615 from mimowo/commonize-pod-indexing
Commonize filtering of Pods by Owner with all orphans in namespace
2025-07-02 02:03:32 -07:00
Kubernetes Prow Robot
a735818b7a Merge pull request #132533 from nojnhuh/dra-orphan-claim
DRA: fix deleting orphaned ResourceClaim on startup
2025-07-02 02:03:25 -07:00
Heba Elayoty
977c670733 Add unit tests for minReady new behaviour
Signed-off-by: Heba Elayoty <heelayot@microsoft.com>
2025-07-01 18:05:26 -07:00
Michal Wozniak
6d5e0bf2a2 review remarks 2025-07-01 16:59:19 +02:00
Michal Wozniak
ac86e67b7d Commonize filtering of Pods by Owner with all orphans in namespace 2025-06-30 08:07:21 +02:00
Huy Pham
b2f27c0649 fix: Truncate too long Deployment name in RS name (#132560)
* fix: Truncate too long Deployment name in RS name

* fix: lint & adjust unit tests

* fix: use const for "-" & unit tests

* Add test case for very long hash

* Explicitly define expected deployment name portion
2025-06-27 16:32:29 -07:00
Jon Huhn
f1845218e2 fixup! DRA: fix deleting orphaned ResourceClaim on startup 2025-06-26 23:21:18 -05:00
Kubernetes Prow Robot
efd2a0d1f5 Merge pull request #132351 from googs1025/fix/hpa_memory
bugfix(hpa): introduce buildQuantity helper for consistent resource quantity
2025-06-26 11:02:35 -07:00
Jon Huhn
ef117edf35 DRA: fix deleting orphaned ResourceClaim on startup 2025-06-25 11:11:43 -05:00
googs1025
b50d508176 bugfix(hpa): introduce buildQuantity helper for consistent resource quantity creation
Signed-off-by: googs1025 <googs1025@gmail.com>
2025-06-25 08:23:53 +08:00
Kubernetes Prow Robot
5b1af0c8c2 Merge pull request #127655 from guozheng-shen/remove-usage
remove 'endpointsleases' and 'configmapsleases' from usage
2025-06-24 09:54:28 -07:00
Kubernetes Prow Robot
49c20d6f44 Merge pull request #132173 from dejanzele/feat/promote-job-pod-replacement-policy-ga
KEP-3939: Job Pod Replacement Policy; promote to GA
2025-06-24 07:04:28 -07:00