Commit Graph

15906 Commits

Author SHA1 Message Date
Maciej Szulik
2bf3d8b733 KEP-3335: drop StatefulSetStartOrdinal feature gate
Signed-off-by: Maciej Szulik <soltysh@gmail.com>
2025-06-05 14:02:44 +02:00
Kubernetes Prow Robot
0731167a99 Merge pull request #131996 from ritazh/dra-adminaccess-updatelabelkey
DRAAdminAccess: update label key
2025-06-04 12:16:45 -07:00
Kubernetes Prow Robot
9c69b620e6 Merge pull request #131852 from bertinatto/bump-ordered-namespace-deletion-timeouts
test/e2e/apimachinery/namespace.go: make OrderedNamespaceDeletion test serial
2025-06-04 10:44:38 -07:00
Fabio Bertinatto
466fb81528 test/e2e/apimachinery/namespace.go: make OrderedNamespaceDeletion test serial
With OrderedNamespaceDeletion enabled by default, the namespace
controller now deletes resources before deleting the namespace itself.
At the same time, some existing tests create many resources. When
those tests finish around the same time, the namespace controller can
become overloaded. As a result, it may take longer to start deleting
resources created by this test.

Initially, this patch increased the test timeout to account for that
delay. However, the test still flaked in 1 out of 10 jobs, which
suggests increasing the timeouts isn't enough.
Once the test was made serial, no flakes were observed.
2025-06-03 15:58:41 -03:00
Kubernetes Prow Robot
d23407b0e2 Merge pull request #132035 from haircommander/userns-test-fix
e2e: fix userns test
2025-06-03 06:18:42 -07:00
Kubernetes Prow Robot
901d1249b5 Merge pull request #131801 from natasha41575/move-handle-pod-additions
move pod admission and resize logic into the allocation manager
2025-06-02 13:42:38 -07:00
Kubernetes Prow Robot
849a82b727 Merge pull request #132036 from adrianmoisey/kep-4427
KEP-4427: Promote Relaxed DNS search string validation to GA
2025-06-01 14:02:43 -07:00
Adrian Moisey
0a7d9f9bfd KEP-4427: Promote Relaxed DNS search string validation to GA 2025-05-31 07:45:16 +02:00
Kubernetes Prow Robot
4832b57e48 Merge pull request #131968 from pohly/dra-kubelet-prepare-validation
DRA kubelet: validation pass before changing claim info cache
2025-05-30 12:40:19 -07:00
Peter Hunt
ee33c1a9fc e2e: fix userns test
after creating two pods, we need to ensure we wait on each to be ready before we collect their logs

Signed-off-by: Peter Hunt <pehunt@redhat.com>
2025-05-30 13:32:52 -04:00
Patrick Ohly
a5aabf9f7e DRA kubelet: validation pass before changing claim info cache
If preparing for a pod failed because the driver was not registered, it failed
after already having added the pod and claim to the claim info cache. The
effect was that deletion of the pod was blocked until the driver got
installed. Other errors had a similar effect. Now as many errors as possible
are checked in a read-only loop before proceeding to changing the claim info
cache.

The error message that was surfaced for the problem was not very readable:
   Failed to prepare dynamic resources: failed to get gRPC client for driver dra-1411.k8s.io: plugin name dra-1411.k8s.io not found in the list of registered DRA plugins

To address this, error messages and wrapping get updated according to these
guidelines:

    // Most errors returned by the manager show up in the context of a pod.
    // They try to adher to the following convention:
    // - Don't include the pod.
    // - Use terms that are familiar to users.
    // - Don't include the namespace, it can be inferred from the context.
    // - Avoid repeated "failed to ...: failed to ..." when wrapping errors.
    // - Avoid wrapping when it does not provide relevant additional information to keep the user-visible error short.
2025-05-30 09:52:22 +02:00
Kubernetes Prow Robot
90a108cb86 Merge pull request #129918 from sunnylovestiramisu/stresstest
Add Stress Tests for VolumeAttributesClass
2025-05-28 20:22:16 -07:00
Rita Zhang
5058e385b0 DRAAdminAccess: update label key
Signed-off-by: Rita Zhang <rita.z.zhang@gmail.com>
2025-05-27 21:19:25 -07:00
Kam Saiyed
ab6fdf46d8 Move the autoscaling e2e tests to be ran in parallel (#131091)
* Move the autoscaling e2e tests to be ran in parallel to have coverage for concurrent hpa processing

* Move the autoscaling e2e tests to be ran in parallel to have coverage for concurrent hpa processing

* Update autoscaling_utils.go
2025-05-27 13:36:16 -07:00
Patrick Ohly
346fe182be DRA E2E: fail test when ResourceSlice publishing fails
This can happen when a test is run in a cluster where a required feature gate
is turned off. Letting the test continue then fails less clearly. For example,
a test for partitionable devices runs with ResourceSlices which don't have
the additional fields for partitionable devices.
2025-05-26 15:30:39 +02:00
Kubernetes Prow Robot
fe5b9896ae Merge pull request #131818 from soltysh/kuberc_beta
Promote kuberc to beta
2025-05-26 05:52:25 -07:00
Kubernetes Prow Robot
122219790f Merge pull request #131803 from pohly/dra-resource-slice-flake
DRA E2E: reduce risk of flake in ResourceSlice stress test
2025-05-23 02:08:36 -07:00
Arda Güçlü
b0370c483a Promote kuberc to beta
Signed-off-by: Maciej Szulik <soltysh@gmail.com>
2025-05-23 10:56:59 +02:00
Dawei Wei
b35c5c0a30 e2e: Fix shadowed error in reboot test and clean up containers after reboot test (#131699)
* Fix test flakiness caused by shadowed error in reboot test and stale pods affecting eviction test

- Fixed a bug in `ExecCommandInContainerWithFullOutput` usage in `hybrid_network.go` where the `err` variable was shadowed, causing test failures to be silently ignored.
- Added cleanup logic in `eviction.go` to explicitly delete pods created by the reboot node test (e.g., `img-puller`, `reboot-host-test-windows`) before starting the eviction test.
- This improves reliability of the eviction test when the reboot test runs beforehand and leaves behind memory-consuming pods.

* Add cleanup containers in reboot node test

* Workaround for Calico HNS issue by avoiding eviction of undeletable pods

Add a workaround for a known Calico issue (https://github.com/projectcalico/calico/issues/6974) where pods on Windows nodes may become undeletable after a reboot. This causes the eviction manager to attempt evicting these pods but fail due to HNS namespace deletion errors.

The workaround avoids scheduling critical test pods on rebooted nodes to prevent interference.

TODO: Remove this workaround once the Calico issue is resolved.

* Fix the lint issue.

* Address comments
2025-05-22 12:40:35 -07:00
Kubernetes Prow Robot
fa6d252d84 Merge pull request #131746 from haircommander/e2e-label
e2e: add corresponding featuregate label to node features
2025-05-21 13:02:35 -07:00
sunnylovestiramisu
17946fe799 Add Stress Tests for VolumeAttributesClass 2025-05-21 18:02:52 +00:00
carlory
f6fafba424 fix flacky test: ResourceQuota should verify ResourceQuota with terminating scopes through scope selectors
Signed-off-by: carlory <baofa.fan@daocloud.io>
2025-05-20 21:57:44 +08:00
Kubernetes Prow Robot
d75a5811ef Merge pull request #131843 from pohly/resourcequota-scope-flake
ResourceQuota: partial fix "should verify ResourceQuota with terminating scopes through scope selectors" flake
2025-05-19 12:45:21 -07:00
Natasha Sarkar
676978641e address feedback 2025-05-19 19:38:42 +00:00
Natasha Sarkar
88e1909e51 move pod admission and resize logic into the allocation manager 2025-05-19 19:38:42 +00:00
Patrick Ohly
3878f7e748 E2E ResourceQuota: ensure consistent ResourceQuote during scope selector test
When expectation is that something does *not* happen, the test has to check for
a certain time. Checking just once is not sufficient because it might not have
happened immediately.
2025-05-19 18:23:49 +02:00
Kubernetes Prow Robot
f2502b31b8 Merge pull request #131830 from dims/future-proof-csi-test-mocks
future-proof csi test mocks
2025-05-19 08:53:22 -07:00
Patrick Ohly
4a353d07e4 E2E ResourceQuota: fix pod creation flake
As can be seen in the output of a test failure in the CI, the test waits for
"quota-not-terminating" to be updated, but then fails because creating the pod
exceeds the "quota-terminating" quota which has not been updated yet. As both
ResourceQuotas apply, it needs to wait for both of them to be updated.

    STEP: Deleting the pod - k8s.io/kubernetes/test/e2e/apimachinery/resource_quota.go:1597 @ 05/18/25 07:50:46.531
    STEP: Ensuring resource quota status released the pod usage - k8s.io/kubernetes/test/e2e/apimachinery/resource_quota.go:1601 @ 05/18/25 07:50:46.547
    I0518 07:50:46.551520 75078 resource_quota.go:2508] Got expected ResourceQuota:
    ...
              name: quota-not-terminating
              namespace: scope-selectors-1836
              resourceVersion: "15914"
              uid: db72668e-2fe0-4543-ada2-a3ff0ac77dd5
            spec:
              hard:
                limits.cpu: "2"
                limits.memory: 1Gi
                pods: "1"
                requests.cpu: "1"
                requests.memory: 500Mi
              scopeSelector:
                matchExpressions:
                - operator: Exists
                  scopeName: NotTerminating
            status:
              hard:
                limits.cpu: "2"
                limits.memory: 1Gi
                pods: "1"
                requests.cpu: "1"
                requests.memory: 500Mi
              used:
                limits.cpu: "0"
                limits.memory: "0"
                pods: "0"
                requests.cpu: "0"
                requests.memory: "0"
    STEP: Creating a terminating pod - k8s.io/kubernetes/test/e2e/apimachinery/resource_quota.go:1610 @ 05/18/25 07:50:46.551
    I0518 07:50:46.560944 75078 resource_quota.go:1612] Unexpected error:
        <*errors.StatusError | 0xc002dba500>:
        pods "terminating-pod" is forbidden: exceeded quota: quota-terminating, requested: pods=1, used: pods=1, limited: pods=1
        {
            ErrStatus:
                code: 403
                details:
                  kind: pods
                  name: terminating-pod
                message: 'pods "terminating-pod" is forbidden: exceeded quota: quota-terminating,
                  requested: pods=1, used: pods=1, limited: pods=1'
                metadata: {}
                reason: Forbidden
                status: Failure,
        }
    [FAILED] pods "terminating-pod" is forbidden: exceeded quota: quota-terminating, requested: pods=1, used: pods=1, limited: pods=1
2025-05-19 15:36:57 +02:00
Patrick Ohly
4b10ba9eef E2E ResourceQuota: dump last ResourceQuota
This is meant to help debug this flake:

   [It] [sig-api-machinery] ResourceQuota should verify ResourceQuota with terminating scopes through scope selectors.

   [FAILED] pods "test-pod" is forbidden: exceeded quota: quota-terminating, requested: pods=1, used: pods=1, limited: pods=1
   In [It] at: k8s.io/kubernetes/test/e2e/apimachinery/resource_quota.go:1572 @ 05/14/25 08:49:07.456

Dumping the ResourceQuota object each time the test progresses will
help with understanding the test and the actual behavior.
2025-05-19 15:36:57 +02:00
Kubernetes Prow Robot
ce450746a4 Merge pull request #131760 from bart0sh/PR178-dra-test-re-registration
DRA: test plugin re-registration after failed GetInfo call
2025-05-17 22:15:13 -07:00
Davanum Srinivas
8f49fb5ce7 future-proof csi test mocks
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2025-05-17 20:42:08 -04:00
Ed Bartosh
aef61622ae e2e: dra: implement ResetGRPCCalls 2025-05-16 21:53:35 +03:00
Ed Bartosh
e8be3e575b e2e: dra: simulate GetInfo failure 2025-05-16 21:53:30 +03:00
Kubernetes Prow Robot
808ffdab58 Merge pull request #131804 from pohly/e2e-resource-quota-failure
ResourceQuota E2E: more informative failure message
2025-05-16 06:59:14 -07:00
Kubernetes Prow Robot
17161cb45d Merge pull request #131617 from bart0sh/PR180-claimInfo-check-claimUID
DRA: kubelet: check for duplicate claim names
2025-05-16 04:53:14 -07:00
Patrick Ohly
88b2360540 ResourceQuota E2E: more informative failure message
When the usage information in the ResourceQuota status doesn't get updated as
expected, the previous log output and failure message didn't explain why:

    ...
    I0515 23:29:57.361485 75251 resource_quota.go:2497] resource count/resourceclaims.resource.k8s.io, expected 0, actual 1
    I0515 23:29:59.363848 75251 resource_quota.go:2497] resource count/resourceclaims.resource.k8s.io, expected 0, actual 1
    I0515 23:30:01.357948 75251 resource_quota.go:2497] resource count/resourceclaims.resource.k8s.io, expected 0, actual 1
    I0515 23:30:03.345999 75251 resource_quota.go:544] Unexpected error:
        <*fmt.wrapError | 0xc0048578a0>:
        client rate limiter Wait returned an error: rate: Wait(n=1) would exceed context deadline
        {
            msg: "client rate limiter Wait returned an error: rate: Wait(n=1) would exceed context deadline",
            err: <*errors.errorString | 0xc004b028a0>{
                s: "rate: Wait(n=1) would exceed context deadline",
            },
        }
    [FAILED] client rate limiter Wait returned an error: rate: Wait(n=1) would exceed context deadline
    In [It] at: k8s.io/kubernetes/test/e2e/apimachinery/resource_quota.go:544 @ 05/13/25 08:59:21.152

The actual failure is also unpredictable, preventing proper clustering in the triage
tool. Depending on where the context is checked, it can also fail with:

    [FAILED] context deadline exceeded
    In [It] at: k8s.io/kubernetes/test/e2e/apimachinery/resource_quota.go:544 @ 05/14/25 00:08:34.258

After converting to a GomegaMatcher with gomega.Eventually, it fails like
this (manually truncated a bit and triggered by changing the expected value):

    [FAILED] Timed out after 300.001s.
    Expected:
        <*v1.ResourceQuota | 0xc0035c3e00>:
            metadata:
              creationTimestamp: "2025-05-09T20:00:28Z"
              managedFields:
              - apiVersion: v1
                fieldsType: FieldsV1
                fieldsV1:
                  f:spec:
                ...
                manager: e2e.test
                operation: Update
                time: "2025-05-09T20:00:28Z"
              - apiVersion: v1
                fieldsType: FieldsV1
                fieldsV1:
                  f:status:
                    f:hard:
                      .: {}
                      f:configmaps: {}
                      f:count/replicasets.apps: {}
                      f:count/resourceclaims.resource.k8s.io: {}
                      f:cpu: {}
                      f:ephemeral-storage: {}
                      f:gold.deviceclass.resource.k8s.io/devices: {}
                      f:gold.storageclass.storage.k8s.io/persistentvolumeclaims: {}
                      f:gold.storageclass.storage.k8s.io/requests.storage: {}
                      f:memory: {}
                      f:persistentvolumeclaims: {}
                      f:pods: {}
                      f:replicationcontrollers: {}
                      f:requests.example.com/dongle: {}
                      f:requests.storage: {}
                      f:resourcequotas: {}
                      f:secrets: {}
                      f:services: {}
                      f:services.loadbalancers: {}
                      f:services.nodeports: {}
                    f:used:
                      .: {}
                      f:configmaps: {}
                      f:count/replicasets.apps: {}
                      f:count/resourceclaims.resource.k8s.io: {}
                      f:cpu: {}
                      f:ephemeral-storage: {}
                      f:gold.deviceclass.resource.k8s.io/devices: {}
                      f:gold.storageclass.storage.k8s.io/persistentvolumeclaims: {}
                      f:gold.storageclass.storage.k8s.io/requests.storage: {}
                      f:memory: {}
                      f:persistentvolumeclaims: {}
                      f:pods: {}
                      f:replicationcontrollers: {}
                      f:requests.example.com/dongle: {}
                      f:requests.storage: {}
                      f:resourcequotas: {}
                      f:secrets: {}
                      f:services: {}
                      f:services.loadbalancers: {}
                      f:services.nodeports: {}
                manager: kube-controller-manager
                operation: Update
                subresource: status
                time: "2025-05-09T20:00:28Z"
                ...
            status:
              hard:
                configmaps: "10"
                count/replicasets.apps: "5"
                count/resourceclaims.resource.k8s.io: "1"
                cpu: "1"
                ephemeral-storage: 50Gi
                gold.deviceclass.resource.k8s.io/devices: "1"
                gold.storageclass.storage.k8s.io/persistentvolumeclaims: "10"
                gold.storageclass.storage.k8s.io/requests.storage: 10Gi
                memory: 500Mi
                persistentvolumeclaims: "10"
                pods: "5"
                replicationcontrollers: "10"
                requests.example.com/dongle: "3"
                requests.storage: 10Gi
                resourcequotas: "1"
                secrets: "10"
                services: "10"
                services.loadbalancers: "1"
                services.nodeports: "1"
              used:
                configmaps: "1"
                count/replicasets.apps: "0"
                count/resourceclaims.resource.k8s.io: "0"
                cpu: "0"
                ephemeral-storage: "0"
                gold.deviceclass.resource.k8s.io/devices: "0"
                gold.storageclass.storage.k8s.io/persistentvolumeclaims: "0"
                gold.storageclass.storage.k8s.io/requests.storage: "0"
                memory: "0"
                persistentvolumeclaims: "0"
                pods: "0"
                replicationcontrollers: "0"
                requests.example.com/dongle: "0"
                requests.storage: "0"
                resourcequotas: "1"
                secrets: "0"
                services: "0"
                services.loadbalancers: "0"
                services.nodeports: "0"
    to have the following .status.used entries:
        count/resourceclaims.resource.k8s.io: "1"
        gold.deviceclass.resource.k8s.io/devices: "0"
        resourcequotas: "0"
    In [It] at: k8s.io/kubernetes/test/e2e/apimachinery/resource_quota.go:523 @ 05/09/25 20:05:28.325

This is more useful because the failure is predictable and includes the managed
fields. Those are important in this case because both kube-apiserver
and kube-controller-manager update the status. One of them is not doing its
job.
2025-05-16 08:15:35 +02:00
Patrick Ohly
ba77d27560 DRA E2E: reduce risk of flake in ResourceSlice stress test
In at least one case, the controller only got as far as creating 93 out of 100
slices in the allotted one minute:

    [FAILED] Timed out after 60.001s.
    Value for field 'Items' failed to satisfy matcher.
    Expected
        <[]v1beta2.ResourceSlice | len:93, cap:146>:
           ...
    to have length 100
    In [It] at: k8s.io/kubernetes/test/e2e/dra/dra.go:1520 @ 05/09/25 17:49:42.592
2025-05-16 07:52:55 +02:00
Kubernetes Prow Robot
c6b6a6263e Merge pull request #131789 from rata/userns-tests-compliance
tests: userns: Add framework.WithFeatureGate()
2025-05-15 15:13:20 -07:00
Ed Bartosh
ec7e732cbc e2e: dra: move gomega matchers to dedicated package
Moved gomega matcher definitions from test-driver/app
to a new test-driver/gomega package.
2025-05-15 20:55:17 +03:00
Kubernetes Prow Robot
91d48d1d73 Merge pull request #131780 from aojea/pod_lifecycle_flakes
fix e2e network test flake because of network programming latency
2025-05-15 09:57:27 -07:00
Patrick Ohly
bba9c49e10 e2e: DRA: test 2 claims with the same name
Co-Authored-By: Ed Bartosh <eduard.bartosh@intel.com>
2025-05-15 19:31:16 +03:00
Kubernetes Prow Robot
80b0f696a6 Merge pull request #131757 from ardaguclu/kuberc-e2e
Add e2e tests for kuberc
2025-05-15 06:41:21 -07:00
Rodrigo Campos
b13cf0a65a tests: userns: Add framework.WithFeatureGate()
This was requested by Ben here:
	https://groups.google.com/a/kubernetes.io/g/dev/c/uVga86nJDuI/m/gVujvOCnDwAJ

I've also asked a question to clarify that he answers, this should be
what we need to do here.

Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
2025-05-15 12:55:10 +02:00
Antonio Ojea
9549c11155 fix e2e network test flake because of network programming latency
ensure the dataplane is programmed

Change-Id: I576526702ea4c43f69b9abbccc2002fedae2c93a
2025-05-15 08:48:35 +00:00
Kubernetes Prow Robot
d96cbb17fc Merge pull request #131762 from aojea/e2e_net_flake
e2e pod readiness gate network flake
2025-05-14 15:07:21 -07:00
Kubernetes Prow Robot
49945dbfab Merge pull request #131742 from ingvagabund/update-sig-scheduling-async-preemption-test
[sig-scheduling] SchedulerPreemption [Serial] validates various priority Pods preempt expectedly with the async preemption: replace finalizers with preStop hook and TerminationGracePeriodSeconds
2025-05-14 06:47:26 -07:00
Arda Güçlü
1ed6cf2196 Add e2e tests for kuberc 2025-05-14 13:06:03 +03:00
Antonio Ojea
0ad8e65d90 e2e pod readiness gate network flake
Change-Id: I9625682c8dc0ca3c5423ed2ba2fe57eb51611003
2025-05-14 08:55:42 +00:00
Kubernetes Prow Robot
fcf22b3ebe Merge pull request #131732 from danwinship/endpoint-bad-conformance
Fix two conformance tests to use EndpointSlices rather than Endpoints
2025-05-14 00:50:50 -07:00
Peter Hunt
c5e4cab9b1 e2e: add corresponding featuregate label to node features
there are many cases of an e2e feature being the main filtering mechanism for a test.
However, this makes it tricky for suite authors to filter tests based on available features.
This mechanism is still useful for e.g. making sure a runtime on a suite is of the correct level,
but in general we should both label tests with the Feature set they require (whether runtime is correct) as well
as the feature gates they test.

Signed-off-by: Peter Hunt <pehunt@redhat.com>
2025-05-13 13:14:47 -04:00