260 Commits
Author SHA1 Message Date
kubernetes-prow[bot] 5d4de34f9e Merge pull request #143406 from mengqiy/objcompress1
Add a storage compression value transformer and its configuration
2026-11-06 02:52:24 +00:00
David Yu 6b009f670d Trim compression duration buckets and split unframed read outcomes
compression_duration_seconds now tops out near 82ms instead of 2.6s.
Unframed reads outside the size limits get the same outcome as writes.
2026-11-05 21:10:48 +00:00
David Yu fd0d4b000e Address review feedback on storage compression
WithCompression takes a per-resource Rule under one fixed 1472Ki limit,
and the reader rejects trailing bytes and padded lengths. The v1alpha1
types get declarative validation and API defaulting, with the top-level
list renamed compressionResources and encryption's validation untouched.
2026-11-04 10:01:04 +00:00
kubernetes-prow[bot] fd24d63c4f Merge pull request #143721 from dims/bump-prometheus-common-v0.73.1
Bump prometheus/common to v0.73.1
2026-11-03 14:41:06 +00:00
Davanum Srinivas 787dd27af4 Bump prometheus/common to v0.73.1
Pulls in github.com/pandatix/go-abnf (OpenMetrics decoder in expfmt),
pinned to v0.5.5 for the long-line decoding fix (prometheus/common#1028).
v0.73.0 is skipped: its go-abnf v0.5.1 requires the blocklisted
hashicorp/go-uuid.

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2026-11-02 16:06:23 -05:00
Roman Baron b26420d58b scheduler: fix opportunistic batching metric accounting
Signed-off-by: Roman Baron <romanb@nvidia.com>
2026-11-01 10:57:41 +02:00
Bi Ge e149add730 scheduler: fix PreQueueingHint narrowing bugs
Fix correctness bugs in the PreQueueingHint narrowing added in
879f922f6b.

Add an evaluateAllPods field to preQueueingHintPodKeys to distinguish
1) some plugins want all pods evaluated while others narrow, from
2) all pods must be evaluated for all plugins.

Before, a PreQueueingHintFn that returned AllPods or an error made
runPreQueueingHintPlugins return nil, which always meant (2). A plugin
without a PreQueueingHintFn was skipped, so another plugin's narrowing
could drop pods that only the skipped plugin would requeue.

Cases handled:

1. A plugin with no PreQueueingHintFn is treated as AllPods: set
evaluateAllPods, so its pods are evaluated for it while other plugins
narrow.

2. A PreQueueingHintFn error falls back to AllPods for that plugin only;
other plugins' narrowing is preserved.

3. A plugin returning AllPods sets evaluateAllPods without discarding
other plugins' narrowing.

4. A plugin can have several registrations matching an event, in one or
more profiles, and perPlugin is keyed by plugin name. If any of them
needs all pods, that plugin is not narrowed for the event.

Also skip PreQueueingHint entirely when CompositePodGroup is enabled,
instead of running the hints and discarding the result. Report
PreQueueingHintFn errors, and pod lookup failures other than NotFound,
with HandleErrorWithLogger. Add the prequeueing_hint_fn_error value to
the result label of scheduler_pre_queueing_hint_evaluations_total (now
constants), and update its help text and the generated metrics
documentation. Plugins without a PreQueueingHintFn are not recorded.

Update the PreQueueingHintFn and PreQueueingHintResult API docs: the
hint runs per matching registration, and narrowing is per plugin.

Add unit tests for each case, the result label values, multi-profile
narrowing, and group preCheck.

KEP: kubernetes/enhancements#6132
2026-10-30 14:06:42 +00:00
Patrick Ohly 7bec3d14e0 update logcheck to v0.11.0, fix new findings
The updated logcheck now warns about passing a pointer as value where String
could crash if nil. The new findings are false positives, but there have been
real issues before and adding klog.SafePtr is cheap mitigation for false
positives.

The HandleError* wrappers around contextual logging are now annotated such that
the new logcheck knows that they do contextual logging. This revealed some real
issues (expecting printf-style formatting or missing keys, passing a *function*
instead of the function result).
2026-10-29 11:09:47 +01:00
Stephen Kitt 706a0414b9 Bump to govulncheck 1.9.0
Signed-off-by: Stephen Kitt <skitt@redhat.com>
2026-10-28 18:29:23 +01:00
Stephen Kitt 8ffdbc7bfc Track govulncheck as a tool
This ensures that new upstream versions are made visible using
standard Go tools; it also avoids repeated "go install"s of the same
version of the tool.

Signed-off-by: Stephen Kitt <skitt@redhat.com>
2026-10-28 18:29:23 +01:00
Stephen Kitt d2967bc861 Track zeitgeist as a tool
This ensures that new upstream versions are made visible using
standard Go tools; it also avoids repeated "go install"s of the same
version of the tool.

Since the version of zeitgeist is tracked in hack/tools/go.mod, this
also removes the version tracking in zeitgeist's own
build/dependencies.yaml, and updates the introductory comment there.

Signed-off-by: Stephen Kitt <skitt@redhat.com>
2026-10-28 18:28:42 +01:00
Stephen Kitt a42c2e29b9 Track whydeadcode as a tool
This ensures that upstream changes aren't applied without review; it
also avoids repeated "go install"s of the same version of the tool.

Signed-off-by: Stephen Kitt <skitt@redhat.com>
2026-10-28 15:04:54 +01:00
kubernetes-prow[bot] bccf5c3611 Merge pull request #141959 from luxas/impl-conditional-authz-4
Conditional Authz [4/n]: Add conditional authz support to `kube-apiserver`
2026-10-27 19:41:19 +00:00
Stephen Kitt 8ef65551ac Bump golang/glog to v1.2.5 in hack/tools
govulncheck complains about publishing-verifier's use of glog:

The package pattern matched the following 2 root packages:
  k8s.io/kubernetes/hack/tools/publishing-verifier
  k8s.io/kubernetes/hack/tools/traceparse
Govulncheck scanned the following 6 modules and the go1.27.3 standard library:
  k8s.io/kubernetes/hack/tools
  github.com/golang/glog@v1.2.2
  golang.org/x/exp@v0.0.0-20260212183809-81e46e3db34a
  golang.org/x/mod@v0.41.0
  gopkg.in/yaml.v2@v2.4.0
  k8s.io/publishing-bot@v0.5.0

=== Symbol Results ===

Vulnerability #1: GO-2025-3372
    Vulnerability when creating log files in github.com/golang/glog
  More info: https://pkg.go.dev/vuln/GO-2025-3372
  Module: github.com/golang/glog
    Found in: github.com/golang/glog@v1.2.2
    Fixed in: github.com/golang/glog@v1.2.4
    Example traces found:
      #1: publishing-verifier/publishing-verifier.go:167:32: publishing.verifyPublishingBotRules calls config.LoadRules, which calls glog.Infof

=== Package Results ===

No other vulnerabilities found.

=== Module Results ===

No other vulnerabilities found.

Signed-off-by: Stephen Kitt <skitt@redhat.com>
2026-10-27 16:02:21 +01:00
David Yu 536732e76d Add a storage compression value transformer and its configuration
storage/value/compression (KEP-6264) compresses objects ahead of any
encryption at rest, in frames with a 9-byte header and a CRC32C. Only a
checksum mismatch is value.IsDataCorruption, so a malformed frame can't
make an intact object eligible for unsafe deletion. Reads always decode
frames. Writes follow a StorageCompressionConfiguration whose resource
checks are shared with EncryptionConfiguration. Values over 1.5 MiB minus
64 KiB are never compressed, so anything compressed can be rewritten
uncompressed. The flag and storage wiring come later.
2026-10-27 03:17:27 +00:00
Lucas Käldström 7b20be8ae6 Add a WithConditionsAwareAuthorization HTTP filter together with AuthorizationConditionsEnforcer admission plugin 2026-10-26 22:08:06 +02:00
kubernetes-prow[bot] e96327d86b Merge pull request #143284 from tallclair/kubelet-error-metrics
kubelet: add sync_result_errors_total and pod_worker_errors_total metrics
2026-10-26 19:17:02 +00:00
Tim Allclair a8ff2e396c kubelet: add sync_result_errors_total and pod_worker_errors_total metrics
Add two alpha Kubelet error counter metrics per KEP-5972:
- kubelet_sync_result_errors_total (label: action) recorded in
  kubeGenericRuntimeManager.SyncPod for each failed SyncResult action or
  top-level PodSyncResult.SyncError (action="SyncPod").
- kubelet_pod_worker_errors_total (label: operation_type) incremented in
  podWorkerLoop when a sync iteration fails with a non-Canceled error.
2026-10-23 22:29:06 +00:00
Ivan Valdes 09048f5ccf Bump etcd 3.7.3 SDK 2026-10-23 10:55:18 -07:00
Dominik Marciński 674b5161f0 scheduler: Parametrize disruption metric by victim type and unify standalone and workload pod victims ordering (#142955)
* scheduler: rank pods from disruption mode Single groups as individual preemption victims

* scheduler: label preemption_workload_disruptions by victim type

Record workload preemption disruptions per preemption unit type (pod,
podgroup, compositepodgroup) instead of a single count of group-related
units.

- PreemptionVictim gains Type(); PreemptionCandidate replaces
  NumPodGroupDisruptions() with NumDisruptionsByVictimType().
- The unit type is the topmost DisruptionMode=All group, or pod for
  pods evicted on their own (standalone or in DisruptionMode=Single
  groups). isGroupVictim is removed.
- The metric stays workload-preemptor only: legacy pod preemption keeps
  its own metrics until naked pods move to the workload scheduling cycle.
2026-10-23 10:39:53 +00:00
Dominik MarcińskiandAntoni Zawodny fe7019ffee scheduler: parameterize pod group scheduling attempts and latency metrics with entity type for compositepodgroup (#141823)
* scheduler: parameterize pod group scheduling attempt and latency metrics with type and profile

Parameterize pod group scheduling attempts, scheduling latency, and algorithm latency metrics with entity type ("podgroup" vs "compositepodgroup") and profile. Specifically:
- Export PodGroupScheduleAttempts and PodGroupSchedulingLatency with [result, profile, type] labels.
- Convert PodGroupSchedulingAlgorithmLatency to HistogramVec with [profile, type] labels.
- Update profile metrics helpers with entityType and add PodGroupAlgorithmLatency helper.
- Update scheduleOnePodGroup call sites to pass rootPodGroupInfo.Type() and profile name.
- Add unit tests in profile_metrics_test.go and schedule_one_podgroup_test.go.

* Address review comments

- Wait for the asynchronous binding cycle to finish before asserting
  attempt metrics.
- Add the child pod group result in the composite pod group case so the
  per-leaf loop actually runs.
- Drop the algorithm latency assertion: submitPodGroupAlgorithmResult
  does not record it, and TestPodGroupAlgorithmLatency covers it.
- Assert that only the root entity type is reported.

* scheduler: rename pod group scheduling metrics entity label from type to entity

* Update pkg/scheduler/metrics/profile_metrics_test.go

Co-authored-by: Antoni Zawodny <zawodny@google.com>

---------

Co-authored-by: Antoni Zawodny <zawodny@google.com>
2026-10-22 17:53:48 +00:00
Jian Zhang 9c8a9bafc0 kubelet: report device counts by resource and health state
The device manager already tracks how many devices it considers healthy
and unhealthy for each resource, and never reports it. The only
device-plugin metrics kubelet exposes are
device_plugin_registration_total and
device_plugin_alloc_duration_seconds, so from outside a node the single
observable symptom of devices going bad is allocatable shrinking --
which conflates three different causes: the plugin reported devices
unhealthy, the plugin deregistered, or the hardware is gone. An operator
cannot tell them apart from metrics alone.

Two cases motivate this concretely. A healthy device turning unhealthy
leaves node capacity unchanged, because capacity counts both sets and
only allocatable counts healthy devices, so the event is at best
inferable by diffing two other series. And a resource whose devices have
all gone unhealthy looks exactly like a resource whose plugin went away,
since both end up at zero allocatable.

Add kubelet_device_plugin_devices{resource_name,health_state}, an ALPHA
gauge sourced from the sets GetCapacity already walks. GetCapacity is
the one of the four mutation sites that already holds m.mutex and
already iterates healthyDevices and unhealthyDevices to compute capacity
and allocatable, and its deletedResources loop is where resources are
garbage collected, so the series are dropped there too. Without that
removal the last observed counts would be reported forever for a
resource that no longer exists. The refresh cadence becomes the node
status sync rather than every ListAndWatch message, which suits a gauge.

The metric deliberately carries no per-device label. Whole-device
plugins advertise one ID per card, where such a label would be fine, but
shared-resource plugins advertise synthetic quota units instead, so a
per-device label there yields many series that carry no information
because the IDs do not correspond to distinct hardware. Per-device
detail remains available through the podresources API.

Signed-off-by: Jian Zhang <jian.zhang@bitdeer.com>
2026-10-21 08:27:52 +08:00
Dominik Marciński ae4a6e5e0e scheduler: parameterize topology-aware placement metrics with entity type (#141929)
* scheduler: parameterize topology-aware placement metrics with entity type

* Address review comments

* scheduler: clarify placement metrics help text for composite pod groups

* scheduler: rename placement metrics entity label from type to entity
2026-10-20 08:25:09 +00:00
dom4ha 5d289561d9 scheduler: rename queue metrics entity label from type to entity
Align scheduler_queued_entities and scheduler_queue_incoming_entities_total
with the placement metrics, which use "entity" for the same values.
"type" is also ambiguous next to scheduler_cache_size{type}, where it
means the cached object kind.
2026-10-19 20:49:18 +00:00
kubernetes-prow[bot] 254369f5ca Merge pull request #143098 from skitt/golangci-lint-2.15.0
Bump golangci-lint to v2.15.0
2026-10-16 15:30:21 +00:00
Stephen Kitt 5e5c837b67 Bump golangci-lint to v2.15.0
This doesn't raise any new issues on existing code.

Signed-off-by: Stephen Kitt <skitt@redhat.com>
2026-10-16 14:48:36 +02:00
Dominik Marciński 616a6e2dea scheduler: support CompositePodGroup in workload preemption metrics (#141969)
* scheduler: support CompositePodGroup in workload preemption metrics

* Address review comments

- Use metrics.EntityTypeToLabel for preemptor metric labels instead of
  string(...) conversion of fwk.EntityKeyType.
- Reorder workload_preemption_attempts_total labels to (preemptor, result)
  for consistency with other preemption metrics.

* Apply suggestion from @tosi3k
2026-10-14 13:57:56 +00:00
kubernetes-prow[bot] b234a330f1 Merge pull request #142897 from seans3/websockets-metrics-beta-1.38
apiserver, kubelet: graduate the KEP-4006 WebSocket streaming metrics to BETA
2026-10-13 21:45:02 +00:00
kubernetes-prow[bot] cdb9495daf Merge pull request #141164 from LiomSV/size_estimate_to_beta
Promote apiserver_resource_size_estimate_bytes to BETA
2026-10-12 22:36:06 +00:00
Valera Stasenia e72d28b564 Promote apiserver_resource_size_estimate_bytes to BETA 2026-10-12 09:55:18 +00:00
kubernetes-prow[bot] 81bf475f72 Merge pull request #142689 from kakkoyun/kakkoyun/client_golang_1_25_0_rc0
Update prometheus/client_golang to 1.25.0
2026-10-10 02:09:25 +00:00
Sean Sullivan 44b2276e86 apiserver, kubelet: graduate the KEP-4006 WebSocket streaming metrics to BETA 2026-10-09 17:31:06 -07:00
Davanum Srinivas 519ac44da9 hack/tools: bump golang.org/x/tools to v0.51.0
go1.27.2 writes unified export data V5 (golang/go#81306); readers
before x/tools v0.50.0 reject it and mockery fails in verify-mocks.
2026-10-09 17:11:08 -04:00
Kemal Akkoyun 3867f510d3 Update prometheus/client_golang to 1.25.0
Rebased onto current master and re-vendored as requested.
The RC was validated in this PR earlier with no issues found.

Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
2026-10-09 14:38:28 +02:00
kubernetes-prow[bot] 5fd97c29b7 Merge pull request #142007 from LiomSV/size_estimate_refactor
Refactor apiserver_resource_size_estimate_bytes metric and apiserver_resource_objects to have a timestamp
2026-10-09 02:31:56 +00:00
Stephen Kitt 0180ae4efd Bump otel to v1.47.0
See
https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.47.0
and
https://github.com/open-telemetry/opentelemetry-go-contrib/releases/tag/v1.47.0
for details.

Signed-off-by: Stephen Kitt <skitt@redhat.com>
2026-10-07 16:33:41 +02:00
Marek Siarkowicz 697bcef9f9 Allow measuring conflict rate of requests to etcd
Separate get operations that originating from Update and Delete operation and report error reason including conflict.
2026-10-02 15:04:34 +02:00
Valera Stasenia 21c331c656 etcd3/metrics: refactor resource objects to reusable custom collector
Generalize resourceSizeEstimateCollector into a reusable
timestampedResourceGaugeCollector for timestamped per-resource gauge
metrics and use it for both apiserver_resource_size_estimate_bytes and
apiserver_resource_objects.

Preserve the last observed value and timestamp (or omit if none) on
fetch errors rather than emitting -1.
2026-10-02 08:55:05 +00:00
Stephen Kitt 892c8a4af5 Bump golangci-lint to v2.14.0, fix remaining %d issues
%d doesn't dereference pointers, so pointers are logged as such rather
than showing the value they point to. golangci-lint v2.14.0 now flags
this.

Most of these are obvious and safe because the pointer is dereferenced
before the log. flowcontrol/format/formatting.go is slightly more
involved, and formatting_test.go is added to illustrate the problem.

Signed-off-by: Stephen Kitt <skitt@redhat.com>
2026-09-28 14:34:03 +02:00
Davanum Srinivas 7aee58ae1a Bump etcd modules to v3.7.2, otelgrpc to v0.71.0, otlptracegrpc to v1.45.0
All three were held back by the grpc pin. otlptracegrpc v1.46.0 needs
grpc-gateway v2.30.0, which stays pinned. Five otel modules leave the
go-spew and yaml.v3 unwanted-reference lists.

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2026-09-25 14:01:46 -04:00
Davanum Srinivas 8590fe063b Bump golang.org/x modules and mdlayher/socket
golang.org/x/net v0.59.0, crypto v0.57.0, sys v0.48.0, term v0.46.0,
text v0.42.0, sync v0.23.0, tools v0.50.0, mod v0.41.0, time v0.16.0,
oauth2 v0.37.0, exp 85c1c2202aba, and github.com/mdlayher/socket v0.7.0.

x/mod v0.40.0 fixed CVE-2026-56865 and CVE-2026-56864 in sumdb; the
package is not vendored but module scanners flag the requirement. The
floors move together: x/net v0.59.0 requires the crypto, sys, term and
text versions above, x/crypto v0.57.0 and mdlayher/socket v0.7.0
require x/net >= v0.58.0, and x/tools v0.50.0 requires x/mod v0.41.0.
2026-09-24 23:56:00 -04:00
Valera Stasenia f8920933e0 etcd3/metrics: refactor resource size estimate to custom collector with timestamps
Refactor apiserver_resource_size_estimate_bytes from a standard GaugeVec
into a custom collector (resourceSizeEstimateCollector) to emit metrics
with explicit timestamps corresponding to when store stats were updated.

Invalidate and omit the metric on fetch errors or when object count is
positive but estimated average size is zero, rather than emitting -1.
2026-09-22 12:57:50 +00:00
Stephen Kitt a3ff4c36f9 Bump google.golang.org/protobuf/cmd/protoc-gen-go
Signed-off-by: Stephen Kitt <skitt@redhat.com>
2026-09-22 01:20:16 +02:00
Stephen Kitt 9576f619bb Bump golang.org/x/mod/modfile
Signed-off-by: Stephen Kitt <skitt@redhat.com>
2026-09-22 01:20:16 +02:00
Stephen Kitt ecda700ab9 Bump github.com/vektra/mockery/v3
Signed-off-by: Stephen Kitt <skitt@redhat.com>
2026-09-22 01:10:25 +02:00
kubernetes-prow[bot] b1add3ae9a Merge pull request #141536 from obarisk/feat/storage-metrics-beta
metrics: graduate volume_operation_total_errors to BETA
2026-09-16 21:53:22 +00:00
kubernetes-prow[bot] eceda4c366 Merge pull request #141800 from dom4ha/cpg-metrics
scheduler: support CompositePodGroup in queue metrics
2026-09-07 14:26:34 +00:00
Jordan Liggitt 54552ed68d Update to go1.27 2026-09-04 10:04:41 -04:00
Jordan Liggitt 10a869f3ab Bump github.com/golangci/golangci-lint/v2 v2.13.2 for go 1.27 support 2026-09-04 09:13:03 -04:00
Jordan LiggittandDavanum Srinivas 728c52bc00 Switch golangci-lint plugins to compiled-in modules
Co-authored-by: Davanum Srinivas <davanum@gmail.com>
2026-09-03 23:23:53 -04:00