Commit Graph

134908 Commits

Author SHA1 Message Date
Davanum Srinivas
2dd576e6cb fix mounter issue
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2025-12-01 03:24:00 -05:00
Kubernetes Prow Robot
9998041e0f Merge pull request #135278 from aman4433/KUBE-134468
Fix goroutine leak in CRDFinalizer
2025-11-30 21:04:23 -08:00
Peter Nguyen
d06b805d81 Update instrumentation/documentation.md 2025-11-30 11:51:52 -08:00
Peter Nguyen
4525702095 Update documentation-list.yaml 2025-11-30 11:48:08 -08:00
Peter Nguyen
08c3b2807e Run ./hack/update-generated-stable-metrics.sh to update stable-metrics-list.yaml 2025-11-30 11:43:17 -08:00
Peter Nguyen
0095c0890c Graduate workqueue metrics from alpha to beta 2025-11-30 11:28:22 -08:00
Davanum Srinivas
594ed6392b Add explicit type to feature gate const declarations
Two feature gate constants were missing the explicit `featuregate.Feature`
type annotation, making them inconsistent with the rest of the file:
- ChangeContainerStatusOnKubeletRestart
- StatefulSetSemanticRevisionComparison

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2025-11-29 21:22:23 -05:00
Kirsten Laskoski
7022a62660 kubectl: remove context.TODO from daemonSetFilter
Replace the context.TODO with getContext to prefer the Helper's context
when it is set. This is consistent with the rest of the package now.

Since contextual logging or timeouts may be included as part of the
Helper's context, using context.TODO will silently ignore these
features, producing unexpected behaviors.

Signed-off-by: Kirsten Laskoski <klaskosk@redhat.com>
2025-11-29 17:05:12 -05:00
Davanum Srinivas
1569ebc5a6 Bump github.com/opencontainers/cgroups to v0.0.6
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2025-11-28 16:22:46 -05:00
Carlos Panato
3661554f87 Bump images and versions to go 1.25.4 and distroless iptables
Signed-off-by: Carlos Panato <ctadeu@gmail.com>
2025-11-28 10:21:55 +01:00
Kubernetes Prow Robot
61c629cc57 Merge pull request #135426 from kfess/update-relaxedservicenamevalidation
Fix: Check `defaultBackend` in `allowRelaxedServiceNameValidation`
2025-11-28 00:00:22 -08:00
Ania Borowiec
0cf3d0e20a Update comment to reflect the current state of the code 2025-11-27 22:10:02 +00:00
Adrian Moisey
dae1dbc1ff KEP-5311 - Revert RelaxedServiceNameValidation promote to beta 2025-11-27 20:52:35 +09:00
Arda Güçlü
dd1d49d17c Filter out the nodes created by other tests 2025-11-27 09:26:56 +03:00
duanwei33
8b381028ed Fix volume expansion e2e tests to use actual allocated size 2025-11-27 12:57:04 +08:00
Kubernetes Prow Robot
4bed36e03e Merge pull request #135445 from mortent/FixExtendedResourcesIntegrationTest
DRA: Fix flaky integration test
2025-11-26 12:46:21 -08:00
Kubernetes Prow Robot
1043513f30 Merge pull request #135461 from liggitt/deflake-pod-certificates
Run a unique signer name for each pod certificate tests to avoid cross-test flaking
2025-11-26 11:50:24 -08:00
Jordan Liggitt
6bf802807b Make unique signerName per pod certificate test 2025-11-26 12:19:56 -05:00
Kubernetes Prow Robot
4c04786f74 Merge pull request #135131 from Dev1622/sig-storage/mock-expand-flake-fix
e2e/storage: deflake CSI Mock volume expansion quota validation
2025-11-26 09:10:36 -08:00
Dev1622
d80e73c0a9 cleanup: removed uncached client plumbing, keeping the sequencing fix for quota validation 2025-11-26 19:56:42 +05:30
Mohammad Varmazyar
4c2fff1934 Address comments, log level, test assersion consistency and remove unnecessary locks in TestFlushUnschedulablePodsLeftoverSetsFlag 2025-11-26 14:08:05 +01:00
carlory
be6028b926 cleanup csiNodeIDMaxLength
Signed-off-by: carlory <baofa.fan@daocloud.io>
2025-11-26 17:56:56 +08:00
Mohammad Varmazyar
4f455c9c0d Refactor plugin clearing to use ClearRejectorPlugins method 2025-11-26 09:54:32 +01:00
Kai Wohlfahrt
2ba1b66b57 Fix kubelet certificate reload when connecting by IP
Currently, we set TLSConfig.Config.GetCertificate, but then also pass
certificate and key paths to http.Server.ListenAndServeTLS.

ListenAndServeTLS uses these paths to populate the TLS config Certificate
property. Then, when accepting connections, a non-nil Certificate is preferred
over GetCertificate if the ServerName is not set in ClientHelloInfo. Finally,
the Go TLS client doesn't set ServerName when connecting by IP. As a result,
when connecting to the kubelet by IP (e.g. to fetch pod logs), stale
certificates are served.

This patch passes empty certFile and keyFile arguments, to force the TLS
server to use the GetCertificate function.

This is done by clearing key/cert file config when setting GetCertificate as
suggested in PR review. This way, all downstream users of kubeDeps.TLSConfig
will do the right thing automatically.
2025-11-25 20:44:19 +01:00
Morten Torkildsen
c33c0464db DRA: Fix flaky integration test 2025-11-25 18:13:00 +00:00
Kubernetes Prow Robot
dd4d9fad24 Merge pull request #135359 from liggitt/vap-ns-latency
Fallback to live ns lookup on admission if lister cannot find namespace
2025-11-25 09:48:38 -08:00
kita456
950dfd612b test: add test for Ingress Update 2025-11-26 00:31:55 +09:00
xigang
01a69b68ea Fix incorrect Group for namespace kind in resourcequota admission
Signed-off-by: xigang <wangxigang2014@gmail.com>
2025-11-25 23:19:18 +08:00
Patrick Ohly
e47b186e6b client-go features: ignore contextual logging
The client-go feature gates implementation logs information about feature
states at V(1). Changing that would imply changing the Enabled method, which is
very intrusive because there are many callers which are not expected to log and
thus don't have access to a contextual logger.

The code is not active in Kubernetes components, those use the clientAdapter to
make client-go use the normal feature gate implementation, which doesn't log
anything. Therefore the code doesn't get changed and only annotated so that
logcheck won't complain.
2025-11-25 15:26:15 +01:00
Patrick Ohly
4f241c04af client-go auth: contextual logging
No API changes are needed. In one case, a context is passed in via the
http.Request. In others there is simply no need to change the calls.
2025-11-25 15:26:15 +01:00
Patrick Ohly
0690af4710 client-go remotecommand: structured, contextual logging
The API for the package already had a context, so all that was missing was to
extract and use the logger from that.
2025-11-25 15:26:15 +01:00
Patrick Ohly
1ec1248a65 client-go clientcmd: exclude from structured, contextual logging
The only log output is for error messages which should normally not occur. It's
also likely that users expect to see exactly those messages, so it's better to
not touch them.
2025-11-25 15:26:15 +01:00
Patrick Ohly
dfdf07bb53 client-go portforward + apiserver proxy: structured, contextual logging
When debugging, it helps to keep output from different connections
separate. This can be done with contextual logging and using different loggers
for each connection.

Cancellation is handled separately for requests. Therefore the new APIs only
add support for passing a logger instance.
2025-11-25 15:26:14 +01:00
Patrick Ohly
025b844bca restmapper + discovery: add context-aware APIs
The main purpose is to replace context.TODO with a context provided by the
caller. A secondary purpose is to enable contextual logging.

Modifying the existing interfaces and APIs would have a big impact on the
ecosystem. This is a no-go. Instead, the following approach was taken:

- All interfaces get duplicated in a *WithContext variant where the methods
  also have a *WithContext suffix and the ctx parameter. All methods are
  treated this way except for obvious local get methods (like RESTClient)
  because it cannot be ruled out entirely that some implementation may
  need a context.

- Implementations of these interfaces implement both method variants
  which is possible because the method names are different.
  The old methods are implemented as thin wrappers around the updated
  code which is now the body of the new methods or shared helpers.
  In some cases there is additional overhead (type checks, potentially
  additional allocations) when using the old methods.

- To*WithContext helpers bridge from the old to the new interfaces. They
  try a type cast first. Because the in-tree implementations implement
  both, they can be used directly. For other implementations wrappers
  are used.

- All old APIs and interfaces are marked as deprecated. There is no
  intent to ever remove them, but consumers should be made aware
  that there are now better alternatives. Implementations also
  get marked this way even if nothing ever calls them directly
  because it shows which code, at least theoretically, could get
  removed.

- Existing unit tests do not get updated to the new APIs. This gives
  us unit test coverage of the old and new API because the old
  APIs call the new ones.

- In-tree consumers will be updated in follow-up PRs. This is likely
  to be a longer process. Because of the deprecation comment,
  `hack/golangci-lint.sh -n` can be used to find code which needs
  to be updated.
2025-11-25 15:26:14 +01:00
Patrick Ohly
b21dcbcaa1 client-go watch: implement interface with pointer
I wasn't entirely sure whether this should return a value or a pointer to
satisfy the interface. Both works, so I benchmarked it elsewhere (REST
mapper). Mem allocs are the same (one alloc/call), but returning a value is 10%
slower when calling one method.

What I then benchmarked is whether pointer vs value receiver in the wrapper
makes a difference. Converting from value receiver (what I had before) to
pointer receiver reduced call overhead by 6%. That's because with a value
receiver, Go has to auto-generate a variant with pointer receiver and calls the
value receiver through that.

That can be seen in a debugger (call stack) and when setting breakpoints:

    (dlv) b restMapperWrapper.KindForWithContext
    Command failed: Location "restMapperWrapper.KindForWithContext" ambiguous: k8s.io/apimachinery/pkg/api/meta.restMapperWrapper.KindForWithContext, k8s.io/apimachinery/pkg/api/meta.(*restMapperWrapper).KindForWithContext…

Conventional wisdom is to define types with value receiver because those can be
called also on unmutable instances, making them more flexible.

But for types which will only ever be used via a pointer, I think pointer
receiver is better for the reasons above (small performance difference, easier
to debug).
2025-11-25 15:26:14 +01:00
Mohammad Varmazyar
d64e09c697 Clear plugins at handleSchedulingFailure and preserve both at Pop 2025-11-24 20:32:41 +01:00
kita456
ac90e6a809 Fix: Check defaultBackend in allowRelaxedServiceNameValidation
The allowRelaxedServiceNameValidation() function currently only checks
service names in spec.rules, but it should also check the service name
in spec.defaultBackend.

When an Ingress has a defaultBackend with a service name that is valid
per RFC 1123 but invalid per RFC 1035 (e.g., starting with a digit like
"1-default-service"), the function incorrectly returns false. This
prevents users from updating such Ingresses even though they were
validly created in the past.

This commit adds validation for spec.defaultBackend.service.name to
maintain backward compatibility for existing Ingresses.
2025-11-24 21:23:41 +09:00
Lubomir I. Ivanov
4c24a498fa kubeadm: do not sort extraArgs alpha-numerically
If the user has provided extraArgs with an order that has
significance (e.g. --service-account-issuer for kube-apiserver),
kubeadm will correctly override any base args, but will end up
sorting the entire resulting list, which is not desired.

Instead, only sort the base arguments and preserve the order
of overrides provided by the user.
2025-11-24 12:59:57 +01:00
carlory
34700d6605 add Workload permissions to view, edit and admin clusterroles
Signed-off-by: carlory <baofa.fan@daocloud.io>
2025-11-24 17:03:00 +08:00
Mohammad Varmazyar
ec05bcf186 test: simplify TestFlushUnschedulablePodsLeftoverSetsFlag
scheduler: add logging for pods scheduled after flush and preserve UnschedulablePlugins
2025-11-24 09:55:52 +01:00
Mohammad Varmazyar
e5e8ef993c Add unit test for WasFlushedFromUnschedulable flag 2025-11-24 09:38:41 +01:00
Mohammad Varmazyar
a12eb9a3c3 Update pkg/scheduler/metrics/metrics.go
Co-authored-by: Maciej Skoczeń <87243939+macsko@users.noreply.github.com>
2025-11-24 09:38:41 +01:00
Mohammad Varmazyar
6a1a71ddc5 Removing the reduntant WasFlushedFromUnschedulable 2025-11-24 09:38:41 +01:00
Mohammad Varmazyar
bc632c72d0 scheduler: add metric for pods scheduled after flush
Add counter metric to track pods that schedule immediately after
being flushed from unschedulablePods due to timeout. Uses a boolean
flag that is cleared when pods return to queue or move via events.
2025-11-24 09:38:41 +01:00
Mohammad Varmazyar
b2a399cf30 scheduler: add metric for pods scheduled after flush
This metric tracks pods that successfully schedule after being
flushed from unschedulablePods due to timeout. High values may
indicate missing queue hint optimizations or event handling issues.
2025-11-24 09:38:40 +01:00
Ricardo Maraschini
98276e88ea cbor: bump limits
with the current established limits we can see the following error:

```
failed to list <object>: unable to determine group/version/kind: cbor:
exceeded max number of elements 1024 for CBOR array.
```
2025-11-21 14:56:05 +01:00
Joe Betz
5129fa152b hack/pin-dependency.sh sigs.k8s.io/structured-merge-diff/v6 v6.3.1 2025-11-21 08:53:57 -05:00
Ania Borowiec
250a6d5fe9 Add ania-borowiec to SIG Scheduling reviewers 2025-11-21 09:52:06 +00:00
PatrickLaabs
7402fc23db Denying deprecated pointer package in golangci-linters config 2025-11-21 09:51:20 +01:00
Kevin Hannon
ba7637c194 Add integration test for MutablePodResourcesForSuspendedJobs with PodReplacementPolicy=Failed
This test verifies that when a job with PodReplacementPolicy=Failed is
suspended and pods are terminating, resource updates can be made to the
job but new pods are only created after terminating pods are removed.
The new pods should have the updated resources.
2025-11-20 22:43:53 -05:00