Ajay Sundar Karuppasamy
07991f41f0
Fix: Correct timestamp for node swap metrics
...
The node swap metric was incorrectly using the memory timestamp instead of the swap timestamp. This change corrects the timestamp and adds a test case to verify the fix.
2025-10-01 19:21:30 +00:00
Kubernetes Prow Robot
93e18b57f3
Merge pull request #134352 from AwesomePatrol/move-metrics-to-get-list
...
Move metrics calculations to getList
2025-10-01 11:29:04 -07:00
Kubernetes Prow Robot
fdb04f9c3b
Merge pull request #134340 from pohly/dra-resourceslice-cleanup
...
DRA: ResourceSlice tracker cleanup
2025-10-01 11:28:57 -07:00
Kubernetes Prow Robot
034079b26e
Merge pull request #134355 from liggitt/fix-rv-call
...
Fix passing runtime.Object to HaveValidResourceVersion check
2025-10-01 10:12:17 -07:00
Patrick Ohly
c36c927d18
DRA ResourceSlice: nicer log output
...
UniqueString rendered as {} in JSON/YAML, which isn't useful... Providing a
MarshalJSON which dumps the string is better.
This enables full object dumps in the ResourceSlice tracker. While at it:
- Consistently log the object content at level 6.
- Use past tense in log messages (recommended style).
- Rename "patch" -> "rule".
2025-10-01 16:40:19 +02:00
Kubernetes Prow Robot
ef95e1fd7e
Merge pull request #134318 from xigang/disruption
...
disruption: remove unused pdb parameter from getExpectedScale method
2025-10-01 07:38:27 -07:00
Kubernetes Prow Robot
41660cec2e
Merge pull request #134139 from aojea/better_error_httpstream_handshae
...
improve httpstream handshake error logging
2025-10-01 07:38:20 -07:00
Jordan Liggitt
af9facf7ba
Fix passing runtime.Object to HaveValidResourceVersion check
2025-10-01 10:00:54 -04:00
Kubernetes Prow Robot
6bb0bd55a3
Merge pull request #134295 from omerap12/hpa-desiredReplicasCount-metric
...
Add desired_replicas gauge metric to HPA controller
2025-10-01 05:16:17 -07:00
Aleksander Mistewicz
0cb916d4dc
Move metrics calculations to getList
...
Signed-off-by: Aleksander Mistewicz <amistewicz@google.com >
2025-10-01 13:59:26 +02:00
Kubernetes Prow Robot
bded66365e
Merge pull request #134258 from mayank-agrwl/apiserver-lease-gc
...
Make APIServerLeaseGC controller context-aware
2025-10-01 03:34:17 -07:00
Antonio Ojea
fc19fcfb73
improve httpstream handshake error logging
...
Some tests are flaking in this function, having a better logged
error will help to understand the cause.
Also modify the Handshake function to always write an http error,
otherwise we have inconsistencies in the codebase that is using the
function and since we are already passing the http writer it makes sense
to not just return an error and delegate the response to the caller.
2025-10-01 09:17:00 +00:00
Kubernetes Prow Robot
1a54b78999
Merge pull request #134259 from mayank-agrwl/legacy-token-tracking-controller
...
Make legacytokentracking controller context aware
2025-10-01 02:04:18 -07:00
Kubernetes Prow Robot
c0af084da0
Merge pull request #134308 from chizhang21/cordon_state_enhance
...
fix(cordonhelper): Avoid mutating local node before API call
2025-09-30 22:56:16 -07:00
Kubernetes Prow Robot
81d7612a53
Merge pull request #134330 from michaelasp/rvCmp
...
Add resource version comparison function in client-go along with conformance
2025-09-30 20:58:16 -07:00
Michael Aspinwall
9757d8d8ef
Document 0 as a special case in RV comparison
2025-10-01 03:09:26 +00:00
Kubernetes Prow Robot
81059575f6
Merge pull request #134208 from n2h9/126379-replace-non-WithContext-functions-to-use-WithContext-functions-instead-of-duplicates
...
[126379] [client-go] chore: use WithContext functions inside old functions to remove code duplication
2025-09-30 19:32:16 -07:00
Michael Aspinwall
84f85712be
feat: Add matcher and conformance tests ensuring that RV is uint128
2025-10-01 00:01:50 +00:00
Kubernetes Prow Robot
6a687c5ddc
Merge pull request #133339 from aojea/vap_servicecidr
...
ServiceCIDR ValidationAdmissionPolicy for implementing previous behavior
2025-09-30 16:20:15 -07:00
Kubernetes Prow Robot
8f372d2ac0
Merge pull request #133972 from pohly/build-data-race-detection-image
...
build: automatically choose a suitable base image
2025-09-30 12:32:16 -07:00
Patrick Ohly
02a51e3712
DRA ResourceSlice tracker: explain test a bit better, fix -run
...
Instead of creating a new test case, the permutation is passed down. This
enables adding the event numbers to the log output, which is useful to
understand better which output belongs to which input:
=== RUN TestListPatchedResourceSlices/update-patch/2_3_0_1
tracker.go:396: I0929 14:28:40.032318] event #1 : ResourceSlice add slice="s1"
tracker.go:581: I0929 14:28:40.032404] event #1 : syncing ResourceSlice resourceslice="s1"
tracker.go:659: I0929 14:28:40.032446] event #1 : ResourceSlice synced resourceslice="s1" change="add"
tracker.go:396: I0929 14:28:40.032502] event #2 : ResourceSlice add slice="s2"
tracker.go:581: I0929 14:28:40.032536] event #2 : syncing ResourceSlice resourceslice="s2"
tracker.go:659: I0929 14:28:40.032568] event #2 : ResourceSlice synced resourceslice="s2" change="add"
tracker.go:463: I0929 14:28:40.032609] event #0/#0: DeviceTaintRule add patch="rule"
tracker.go:581: I0929 14:28:40.032639] event #0/#0: syncing ResourceSlice resourceslice="s1"
tracker.go:703: I0929 14:28:40.032675] event #0/#0: processing DeviceTaintRule resourceslice="s1" deviceTaintRule="rule"
tracker.go:807: I0929 14:28:40.032712] event #0/#0: applying matching DeviceTaintRule resourceslice="s1" deviceTaintRule="rule" device="driver1.example.com/pool-1/device-1"
tracker.go:868: I0929 14:28:40.032780] event #0/#0: Assigned new taint ID, no matching taint resourceslice="s1" deviceTaintRule="rule" device="driver1.example.com/pool-1/device-1" taintID=0 taint="example.com/taint=tainted:NoExecute"
tracker.go:654: I0929 14:28:40.033023] event #0/#0: ResourceSlice synced resourceslice="s1" change="update" diff=<
@@ -23,7 +23,32 @@
"BindingConditions": null,
"BindingFailureConditions": null,
"AllowMultipleAllocations": null,
- "Taints": null
+ "Taints": [
+ {
+ "Rule": {
+ "metadata": {
+ "name": "rule"
+ },
+ "spec": {
+ "deviceSelector": {
+ "pool": "pool-1"
+ },
+ "taint": {
+ "key": "example.com/taint",
+ "value": "tainted",
+ "effect": "NoExecute",
+ "timeAdded": "2006-01-02T15:04:05Z"
+ }
+ },
+ "status": {}
+ },
+ "ID": 1,
+ "key": "example.com/taint",
+ "value": "tainted",
+ "effect": "NoExecute",
+ "timeAdded": "2006-01-02T15:04:05Z"
+ }
+ ]
}
],
"Taints": null,
>
tracker.go:482: I0929 14:28:40.033224] event #0/#1: DeviceTaintRule update patch="rule" diff=<
@@ -4,7 +4,7 @@
},
"spec": {
"deviceSelector": {
- "pool": "pool-1"
+ "pool": "pool-2"
},
"taint": {
"key": "example.com/taint",
>
tracker.go:581: I0929 14:28:40.033285] event #0/#1: syncing ResourceSlice resourceslice="s1"
tracker.go:703: I0929 14:28:40.033319] event #0/#1: processing DeviceTaintRule resourceslice="s1" deviceTaintRule="rule"
tracker.go:654: I0929 14:28:40.033478] event #0/#1: ResourceSlice synced resourceslice="s1" change="update" diff=<
@@ -23,32 +23,7 @@
"BindingConditions": null,
"BindingFailureConditions": null,
"AllowMultipleAllocations": null,
- "Taints": [
- {
- "Rule": {
- "metadata": {
- "name": "rule"
- },
- "spec": {
- "deviceSelector": {
- "pool": "pool-1"
- },
- "taint": {
- "key": "example.com/taint",
- "value": "tainted",
- "effect": "NoExecute",
- "timeAdded": "2006-01-02T15:04:05Z"
- }
- },
- "status": {}
- },
- "ID": 1,
- "key": "example.com/taint",
- "value": "tainted",
- "effect": "NoExecute",
- "timeAdded": "2006-01-02T15:04:05Z"
- }
- ]
+ "Taints": null
}
],
"Taints": null,
>
tracker.go:581: I0929 14:28:40.033601] event #0/#1: syncing ResourceSlice resourceslice="s2"
tracker.go:703: I0929 14:28:40.033633] event #0/#1: processing DeviceTaintRule resourceslice="s2" deviceTaintRule="rule"
...
Disabling event checking only worked when actually running all sub-tests. When
selectively running only one permutation with -run, the boolean variable was
wrong:
$ go test -run='.*/^update-patch$' ./staging/src/k8s.io/dynamic-resource-allocation/resourceslice/tracker/
ok k8s.io/dynamic-resource-allocation/resourceslice/tracker
$ go test -run='.*/^update-patch$/3_2_0_1' ./staging/src/k8s.io/dynamic-resource-allocation/resourceslice/tracker/
--- FAIL: TestListPatchedResourceSlices (0.01s)
--- FAIL: TestListPatchedResourceSlices/update-patch (0.00s)
--- FAIL: TestListPatchedResourceSlices/update-patch/3_2_0_1 (0.00s)
tracker_test.go:762:
Error Trace: /nvme/gopath/src/k8s.io/kubernetes/staging/src/k8s.io/dynamic-resource-allocation/resourceslice/tracker/tracker_test.go:762
/nvme/gopath/src/k8s.io/kubernetes/staging/src/k8s.io/dynamic-resource-allocation/resourceslice/tracker/tracker_test.go:856
Error: Not equal:
expected: []tracker.handlerEvent{tracker.handlerEvent{event:"add", oldObj:(*api.ResourceSlice)(nil), newObj:(*api.ResourceSlice)(0xc000301d40)}, tracker.handlerEvent{event:"add", oldObj:(*api.ResourceSlice)(nil), newObj:(*api.ResourceSlice)(0xc000346000)}}
actual : []tracker.handlerEvent{tracker.handlerEvent{event:"add", oldObj:(*api.ResourceSlice)(nil), newObj:(*api.ResourceSlice)(0xc0001f9ba0)}, tracker.handlerEvent{event:"add", oldObj:(*api.ResourceSlice)(nil), newObj:(*api.ResourceSlice)(0xc000301d40)}, tracker.handlerEvent{event:"update", oldObj:(*api.ResourceSlice)(0xc000301d40), newObj:(*api.ResourceSlice)(0xc0003dba00)}, tracker.handlerEvent{event:"update", oldObj:(*api.ResourceSlice)(0xc0003dba00), newObj:(*api.ResourceSlice)(0xc000301d40)}, tracker.handlerEvent{event:"update", oldObj:(*api.ResourceSlice)(0xc0001f9ba0), newObj:(*api.ResourceSlice)(0xc0003dbba0)}}
Now permutations are detected automatically based on the indices.
While at it, documentation gets moved around a bit to make reading test cases
easier without going to the implementation.
2025-09-30 20:44:54 +02:00
cz21
c524a5fba2
fix(cordonhelper): Avoid mutating local node before API call
...
Signed-off-by: cz21 <cz21ok@gmail.com >
2025-10-01 01:53:07 +08:00
Michael Aspinwall
7c24e62d7c
Add additional types for resource version comparison testing
2025-09-30 17:16:07 +00:00
Kubernetes Prow Robot
cffecaac55
Merge pull request #134319 from neolit123/1.35-refactor-fetch-init-config-flags
...
kubeadm: rework the FetchInitConfigurationFromCluster node flags
2025-09-30 09:14:32 -07:00
Kubernetes Prow Robot
2b828fac59
Merge pull request #134297 from ialidzhikov/cleanup/kcm-ks-configmap-leader-election-rbac
...
Remove configmaps related rules from the kube-controller-manager and kube-scheduler leader election roles
2025-09-30 09:14:25 -07:00
Kubernetes Prow Robot
0f660b5eb4
Merge pull request #133765 from cfryanr/feature-readable-audit-event
...
restore public func `AuditEventFrom` which was deleted by #129472
2025-09-30 09:14:17 -07:00
Kubernetes Prow Robot
4a1558c545
Merge pull request #133967 from pohly/dra-allocator-selection
...
DRA: allocator selection
2025-09-30 08:24:18 -07:00
Patrick Ohly
68205ff40c
DRA scheduler_perf: run with specific allocator implementations
...
For some packages (in particular the code DRA), all allocator implementations
can handle the testcases. Some other packages are for less stable features and
work with fewer implementations. Now all unit tests are run with all suitable
implementations, to increase code coverage.
Benchmarks are fixed to the most mature implementation because they would be
costly to run in more than one. When promoting an allocation implementation we
can do before/after comparisons to detect potential performance regressions.
The downside of this approach is that we need to remember to extend the list
of supported implementations when promoting features, otherwise testing will miss
some new supported implementation.
2025-09-30 18:19:57 +02:00
Patrick Ohly
5832c915ac
scheduler_perf: apply feature gates in deterministic, alphabetical order
...
Without this, the effect of the following feature gate config would be random:
featureGates:
AllBeta: false
SomeBetaFeature: true
That's random because the order of iterating of the map is randomized by Go and
`AllBeta: false` would disable `SomeBetaFeature` if (and only if) applied last.
Now by sorting alphabetically, AllAlpha/Beta come first in practice. It's not a
complete solution, some future feature gate name might come before it.
2025-09-30 16:53:39 +02:00
Patrick Ohly
60eeaa6ebd
DRA scheduler: add unit test for allocator selection
...
This prevents the mistake from 1.34 where the default-on
DRAResourceClaimDeviceStatus feature caused the use of the experimental
allocator implementation. The test fails without a fix for that.
2025-09-30 16:53:38 +02:00
Patrick Ohly
7f57730ba4
DRA scheduler: fix selection of "incubating" allocator implementation
...
In 1.34, the default feature gate selection picked the "experimental" allocator
implementation when it should have used the "incubating" allocator. No harm
came from that because the experimental allocator has all the necessary if
checks to disable the extra code and no bugs were introduced when implementing
it, but it means that our safety net wasn't there when we expected it to be.
The reason is that the "DRAResourceClaimDeviceStatus" feature gate is on by
default and was only listed as supported by the experimental implementation.
This could be fixed by listing it as supported also by the other
implementation, but that would be a bit odd because there is nothing to support
for it (the reason why this was missed in 1.34!). Instead, the allocator
features are now only indirectly related to feature gates, with a single
boolean controlling the implementation of binding conditions.
2025-09-30 16:53:38 +02:00
Patrick Ohly
b5bcac998d
DRA scheduler: clean up feature gate handling
...
Copying from feature.Features to new fields in the plugin got a bit silly with
the long list of features that we have now. Embedding feature.Features is
simpler.
Two fields in feature.Features weren't named according to the feature gate, now
they are named consistently and the fields are sorted.
2025-09-30 16:53:38 +02:00
Kubernetes Prow Robot
e5c04392c0
Merge pull request #134276 from aaron-prindle/allocation-mode-enum
...
fix: add +enum tag to resource DeviceAllocationMode
2025-09-30 07:14:34 -07:00
Kubernetes Prow Robot
07a5020bfc
Merge pull request #134168 from aditigupta96/refactor-naming-controller
...
refactor(apiextensions-apiserver): Make NamingConditionController context-aware
2025-09-30 07:14:26 -07:00
Kubernetes Prow Robot
14fb5e6481
Merge pull request #133697 from tallclair/feature-deps
...
Codify feature gate dependencies
2025-09-30 07:14:18 -07:00
Kubernetes Prow Robot
7353b6a93d
Merge pull request #134312 from alaypatel07/gc-resourceclaim-extendedresource
...
fix resource claims deallocation for extended resource when pod is completed
2025-09-30 01:38:20 -07:00
Mayank Agrawal
b0460eedba
Make legacytokentracking controller context aware
2025-09-29 21:41:47 -07:00
Michael Aspinwall
37fcfcd29e
feat: Add conformance tests for all resources for comparable resource version
2025-09-29 23:32:07 +00:00
Kubernetes Prow Robot
0f8471a6f5
Merge pull request #134237 from aditigupta96/contextual-logging-nonstructural-schema-controller
...
refactor(apiextensions-apiserver): Make NonStructuralSchema controller context-aware
2025-09-29 16:00:17 -07:00
Kubernetes Prow Robot
e87a447ca2
Merge pull request #134327 from p0lyn0mial/watchlist-e2e-table-improve
...
test/e2e/apimachinery/watchlist: select only wellknown secrets for table test
2025-09-29 13:46:16 -07:00
Michael Aspinwall
2cef54c145
feat: Add helper function for client-go to compare resource version
2025-09-29 20:41:24 +00:00
Ryan Richard
f5e65af173
add getters for event User and ImpersonatedUser on AuditContext
...
The ability to get these values was deleted by #129472 which removed
the public function audit.AuditEventFrom. The new getters return copies
of the underlying objects to prevent external mutations of the objects
held by the audit events.
2025-09-29 12:41:59 -07:00
Kubernetes Prow Robot
7f180515d7
Merge pull request #134233 from aaron-prindle/dv-validate-csi-driver-option-support
...
refactor(DRA validation): Add granular controls to ValidateCSIDriverName for declarative validation migration
2025-09-29 12:20:20 -07:00
Alay Patel
8a03067211
fix resource claims deallocation for extended resource when pod is completed
...
Signed-off-by: Alay Patel <alayp@nvidia.com >
2025-09-29 15:15:40 -04:00
Kubernetes Prow Robot
1ffdc16b71
Merge pull request #134314 from xigang/node_controller_zone
...
node_lifecycle_controller: fix ComputeZoneState method comment
2025-09-29 11:30:24 -07:00
Kubernetes Prow Robot
da552ef1d7
Merge pull request #134240 from yongruilin/master_vg_strategy-call
...
Refactor: Centralize declarative validation logic
2025-09-29 11:30:17 -07:00
Lubomir I. Ivanov
b6afe986c6
kubeadm: rework the FetchInitConfigurationFromCluster node flags
...
The newControlPlane flag has been historically problematic, since
it implies that the function FetchInitConfigurationFromCluster
cannot handle the cases where a node is worker node but
we still want to fetch its NodeRegistrationOptions conditionally,
in cases such as "upgrade node" for workers.
To fix this issue, replace the flag newControlPlaneNode with
two new flags getNodeRegistration and getAPIEndpoint.
If getNodeRegistration is true, we fetch the NRO, and if
getAPIEndpoint is true, we fetch the API endpoint for
that node.
Additionally, rename skipComponentConfigs to getComponentConfigs
for consistency and flip its value accordingly everywhere.
2025-09-29 19:58:56 +02:00
Kubernetes Prow Robot
8ebc216c59
Merge pull request #134185 from DanBokete/deprecate-caseless-validation
...
Feat: Adds warnings when ResourceSlice driver names contain uppercase characters
2025-09-29 09:40:18 -07:00
Kubernetes Prow Robot
50cc9905b6
Merge pull request #132059 from jm-franc/configurable-tolerance-e2e-test
...
Add configurable tolerance e2e test.
2025-09-29 07:40:19 -07:00
Lukasz Szaszkiewicz
212a9c6a60
test/e2e/apimachinery/watchlist: select only wellknown secrets for table test
2025-09-29 13:36:38 +02:00