Commit Graph

12716 Commits

Author SHA1 Message Date
Lubomir I. Ivanov
4e36355c5d kubeadm: always retry Patch() Node API calls
The PatchNodeOnce function has historically exited early
in scanarious when we Get a Node object, but the next Patch
API call on the same Node object fails. This can happen
in setups that are under a lot of resource pressure
or different network timeout scenarious.

Instead of exiting early and allow listing certain errors,
always retry on any Patch error. This aligns with the
general idea that kubeadm retries *all* API calls.
2026-01-07 14:27:10 +01:00
Lubomir I. Ivanov
249d35bf43 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-12-19 17:43:22 +01:00
Andrey Borovets
f55ba2cdd1 [Manual bugfix]: unhide the etcd-join phase for v1.33
Signed-off-by: Andrey Borovets <andrey.borovets@flant.com>
2025-11-27 13:23:27 +03:00
Kubernetes Prow Robot
42a6f5f495 Merge pull request #134724 from neolit123/automated-cherry-pick-of-#134715-origin-release-1.33
Automated cherry pick of #134715: kubeadm: add missing cluster-info context validation
2025-11-07 19:30:58 -08:00
Ciprian Hacman
421be9ee90 Fix tests 2025-11-01 06:05:27 +02:00
joshjms
9820ef8637 etcd: bump etcd to v3.5.24 for k8s v1.31, v1.32, v1.33
Signed-off-by: joshjms <joshjms1607@gmail.com>
2025-10-31 22:42:13 +02:00
Lubomir I. Ivanov
7f6f426599 kubeadm: add missing cluster-info context validation
When retrieving the cluster-info CM, ensure the cluster pointed
out by the current context in the kubeconfig is validated.

Add unit test for the above.

Make the function GetClusterFromKubeConfig() to return various
errors. Handle the errors on call sites. Add unit tests
for the update.

The above changes prevent panics when the users has manually
edited and malformed the kubeconfig in the cluster-info CM.
2025-10-20 13:34:26 +02:00
Jordan Liggitt
6a47dd845d Remove invalid SAN certificate construction 2025-10-14 09:37:26 -04:00
Benjamin Elder
9fddfce038 kubeadm preflight checks: fix host URL construction 2025-10-14 09:37:25 -04:00
Lubomir I. Ivanov
909df3740d 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-10-01 22:04:56 +02:00
Lubomir I. Ivanov
223dd0ab82 kubeadm: use JoinHostPort in WaitControlPlaneClient
Using naive string concat with ":" does not work for IPv6.
Apply the fix to WaitForKubelet as well.
2025-09-25 21:29:39 +02:00
Lubomir I. Ivanov
9f99111f42 kubeadm: ensure waiting for apiserver uses a local client
When waiting for the kube-apiserver to report 'ok'
in the 'init' and 'join' phase 'wait-control-plane', a client
constructed from the 'admin.conf' is used. In the case of the
kube-apiserver, the discovery client is used so that
anonymous-auth works. But if 'admin.conf' is used as is,
it would point to the CPE and not the LAE.

Implement a new method WaitControlPlaneClient() for both
init.go and join.go that patches the 'Server' field in the
loaded v1.Config to point to the LAE, before constructing
a client set and using it in the kube-apiserver waiter.
2025-09-25 15:57:36 +02:00
tom1299
b246955af5 Fix missing control plane health check timeout 2025-08-28 22:57:01 +08:00
bconry
cb130042b1 Add check to see if promote worked within the retry loop 2025-06-13 10:04:18 +03:00
David Eads
660df229bf Stop exposing list-via-watch from the server
With StreamingCollectionEncodingToJSON and
StreamingCollectionEncodingToProtobuf, the WatchList must re-justify its
necessity.  To prevent an ecosystem from building around a feature that
may not be promoted, we will stop serving list-via-watch until
performance numbers can justify its inclusion.

This also stops the kube-controller-manager from using the
list-via-watch by default.  The fallback is a regular list, so during
the skew during an upgrade the "right" thing will happen and the new
StreamingCollectionEncoding will be used.
2025-04-18 09:21:23 -04:00
joshjms
24edc6e90f Update etcd to 3.5.21
Signed-off-by: joshjms <joshjms1607@gmail.com>
2025-04-02 02:16:38 +08:00
Kubernetes Prow Robot
070f0ad3bd Merge pull request #129970 from mortent/AddResourceV1beta2API
Add resource v1beta2 API
2025-03-26 09:10:47 -07:00
Morten Torkildsen
39507d911f Add resource v1beta2 API 2025-03-26 14:41:09 +00:00
Lubomir I. Ivanov
2037f39e20 kubeadm: use 'writer' everywhere in util/apiclient/wait.go 2025-03-24 21:45:11 +02:00
Lubomir I. Ivanov
310723b21c kubeadm: fix WaitForAllControlPlaneComponents with anonymous auth
When the kube-apiserver has --anonymous-auth=false,
the regular http.Client.Get() that WaitForAllControlPlaneComponents
does will not work.

Always use the discovery client when checking the health status
of the kube-apiserver.

Do a minor rework of struct fields and unit tests.

Replace nil client in cmd/phases/join/waitcontrolplane.go.
2025-03-24 20:58:59 +02:00
Kubernetes Prow Robot
d383020cc8 Merge pull request #130831 from ajaysundark/disable-swap-resize
disable in-place pod vertical scaling for swap enabled pods
2025-03-20 19:38:37 -07:00
Kubernetes Prow Robot
b0d6079ddc Merge pull request #130947 from pohly/dra-device-taints-flake
DRA device taints: fix some race conditions
2025-03-20 14:16:55 -07:00
Ajay Sundar Karuppasamy
a09cb22e4d disable in-place vertical pod scaling for non-restartable swappable containers 2025-03-20 20:43:18 +00:00
Patrick Ohly
ac6e47cb14 DRA taint eviction: improve error handling
There was one error path that led to a "controller has shut down" log
message. Other errors caused different log entries or are so unlikely (event
handler registration failure!) that they weren't checked at all.

It's clearer to let Run return an error in all cases and then log the
"controller has shut down" error at the call site. This also enables tests to
mark themselves as failed, should that ever happen.
2025-03-20 17:59:06 +01:00
Francesco Romani
3c7ed00e22 node: kep-2625: cpu manager policy options GA
Move the support for CPUManager Policy Options to GA

Signed-off-by: Francesco Romani <fromani@redhat.com>
2025-03-20 08:31:32 +01:00
Kubernetes Prow Robot
68ba091fca Merge pull request #130844 from danwinship/improved-traffic-distribution
KEP-3015 PreferSameZone/PreferSameNode traffic distribution
2025-03-19 13:00:48 -07:00
Kubernetes Prow Robot
ab3cec0701 Merge pull request #130447 from pohly/dra-device-taints
device taints and tolerations (KEP 5055)
2025-03-19 13:00:32 -07:00
yongruilin
dab8758a59 chore: avoid resetting config of emulation verison and featuregates when adding flags
This change introduces improvements to the component compatibility registry:
- Modify the kube-scheduler test server to create a separate ComponentGlobalsRegistry
- Update the compatibility registry to handle multiple flag configurations
- Enhance test cases to support emulation version mapping between components
2025-03-19 16:31:13 +00:00
Dan Winship
c85083589c Clarify hostname vs node name in kube-proxy
Various parts of kube-proxy passed around a "hostname", but it is
actually the name of the *node* kube-proxy is running on, which is not
100% guaranteed to be exactly the same as the hostname. Rename it
everywhere to make it clearer that (a) it is definitely safe to use
that name to refer to the Node, (b) it is not necessarily safe to use
that name with DNS, etc.
2025-03-19 08:46:15 -04:00
Patrick Ohly
a027b439e5 DRA: add device taint eviction controller
The controller is derived from the node taint eviction controller.
In contrast to that controller it tracks the UID of pods to prevent
deleting the wrong pod when it got replaced.
2025-03-19 09:18:38 +01:00
Yuma Ogami
d66330609c Remove the not-even alpha feature setting
Remove the setting for the feature gate that are not even alpha
because Compatibility Versions (KEP-4330) don't allow it.
2025-03-17 00:49:58 +00:00
Yuma Ogami
43382b1b39 Switch control from VolumeCapacityPriority to StorageCapacityScoring
The tests and comments have also been updated because while
VolumeCapacityPriority preferred a node with the least allocatable,
StorageCapacityScoring preferred a node with the maximum allocatable.
2025-03-17 00:49:58 +00:00
Kubernetes Prow Robot
8b08487283 Merge pull request #130354 from siyuanfoundation/forward-api
KEP-4330: add forward compatibility for compatibility mode
2025-03-13 18:55:57 -07:00
zhangzhifei16
2db729cfa4 Add flatz to kubelet auth.
Fix: Move flagz to InstallDebuggingHandlers.

Move flagz  to the lower switch statemen

Fix linter

Drop the function parameter for the read-only server.
2025-03-13 10:11:59 +08:00
Kubernetes Prow Robot
9693eea5c3 Merge pull request #128824 from yongruilin/flagz-controller-manager
feat: Add flagz endpoint for kube-controller-manager
2025-03-12 13:35:47 -07:00
Stanislav Láznička
c36b1c901f KCM: CTB publisher: tolerate NotFound during discovery 2025-03-11 18:07:33 +01:00
Stanislav Láznička
5b3b68a3a1 KCM: CTBPublisher: use generics to handle both alpha/beta APIs 2025-03-11 18:07:29 +01:00
Stanislav Láznička
e0f536bf1f use the ClusterTrustBundles beta API 2025-03-11 18:07:24 +01:00
Kubernetes Prow Robot
e9a3d99f37 Merge pull request #129826 from danwinship/iptables-constructors
fix up iptables construction, kubelet iptables startup messages
2025-03-11 01:17:45 -07:00
Siyuan Zhang
3d2d8db835 Add option to explicitly enable future gv or gvr in runtime-config.
Signed-off-by: Siyuan Zhang <sizhang@google.com>
2025-03-10 12:13:45 -07:00
Siyuan Zhang
819cb8fe22 Add emulation forward compatibility into api enablement and RemoveDeletedKinds.
Signed-off-by: Siyuan Zhang <sizhang@google.com>
2025-03-10 11:56:40 -07:00
Tim Hockin
e54719bb66 Use randfill, do API renames 2025-03-08 15:18:00 -08:00
Dan Winship
8c98dee1ed Add utiliptables.NewDualStack
Basically all callers want dual-stack-if-possible, so simplify that.

Also, tweak the startup-time checking in kubelet to treat "no iptables
support" as interesting but not an error.
2025-03-08 10:14:17 -05:00
Dan Winship
9c98d29795 Remove exec arg from utiliptables.New
It was there so you could mock the results via a FakeExec, but these
days any unit tests outside of pkg/util/iptables that want to mock
iptables results use a FakeIPTables instead of a real
utiliptables.Interface with a FakeExec.
2025-03-08 10:11:15 -05:00
Kubernetes Prow Robot
1d88598555 Merge pull request #130561 from danwinship/more-misc-proxy-cleanup
more misc proxy cleanup
2025-03-07 17:09:44 -08:00
Dan Winship
b5e9a8262e Remove exec arg from utilipset.New
Historically it took an exec argument so you could pass a FakeExec to
mock its behavior in unit tests, but it has a fake implementation now
that is much more useful for unit tests than trying to use the real
implementation with a fake exec. (The unit tests still use fake execs,
but they don't need to use a public constructor.) So remove the exec
args from the public constructors.
2025-03-07 10:43:52 -05:00
Dan Winship
36f5820ad1 Remove some unused proxy args/fields
Remove the utilexec.Interface args from the iptables/ipvs constructors
(which have been unused since the conntrack cleanup code was ported to
netlink).

Remove the EventRecorder fields from the iptables/ipvs Proxiers, which
have been unused since we removed the port-opener code in 2022.

Remove the strictARP field from the ipvs Proxier, which has apparently
always been unused (strictARP is only looked at at construct time).
2025-03-07 10:43:45 -05:00
Kubernetes Prow Robot
9d45ea8b9d Merge pull request #128586 from mortent/DRAPrioritizedList
Prioritized Alternatives in Device Requests
2025-03-06 21:01:44 -08:00
yongruilin
97db9a7843 feat: Add flagz endpoint for kube-controller-manager 2025-03-05 22:35:03 +00:00
Kubernetes Prow Robot
eacb9beec1 Merge pull request #130345 from HirazawaUi/kubeadm-yaml-json
kubeadm: Replace the yaml in the log/comments with a generic term.
2025-03-03 16:59:48 -08:00