Commit Graph

4546 Commits

Author SHA1 Message Date
SataQiu
475334f995 kubeadm: fix panic when no UpgradeConfiguration was found in the config file 2025-02-20 15:21:35 +02:00
Lubomir I. Ivanov
4f9453c11d kubeadm: use the v1beta4 EtcdAPICall timeout for etcd calls
v1beta4 added the Timeouts struct and a EtcdAPICall timeout
field, but it was never used in the etcd client calls.

This is a bug, so it should be fixed, we also reduced
the timeout from 200 seconds exponentional backoff to 2 minute
linear default timeout.
2025-01-28 17:52:29 +02:00
Kubernetes Prow Robot
af62fde413 Merge pull request #129607 from neolit123/automated-cherry-pick-of-#129594-origin-release-1.31
Automated cherry pick of #129594: kubeadm: remove misplaced error during image pull
2025-01-28 04:21:25 -08:00
Kubernetes Prow Robot
d7fc7e30cb Merge pull request #129519 from kishen-v/automated-cherry-pick-of-#127422-upstream-release-1.31
Automated cherry pick of #127422: Fix Go vet errors for master golang
2025-01-22 11:10:37 -08:00
Lubomir I. Ivanov
aabc56c6ed kubeadm: remove misplaced error during image pull
During preflight when an image is pulled, if the sandbox image
check returns an error, the same error later blocks the actual
image pull.
2025-01-14 09:25:28 +02:00
Abhishek Kr Srivastav
9d10ddb060 Fix Go vet errors for master golang
Co-authored-by: Rajalakshmi-Girish <rajalakshmi.girish1@ibm.com>
Co-authored-by: Abhishek Kr Srivastav <Abhishek.kr.srivastav@ibm.com>
2025-01-08 15:11:34 +05:30
SataQiu
ec1a3974ba kubeadm: fix a bug where the node.skipPhases in UpgradeNodeConfiguration is not respected by 'kubeadm upgrade node' 2025-01-02 15:01:34 +02:00
SataQiu
5ff073516e kubeadm: fix a bug where the RemoveMember function did not return the correct member list when the member to be removed did not exist 2024-10-09 21:36:40 +08:00
SataQiu
0166d23783 kubeadm: check the member list status before adding or removing an etcd member 2024-09-25 19:23:15 +08:00
SataQiu
f22fd52e91 kubeadm: check whether the peer URL for the added etcd member already exists when the MemberAddAsLearner/MemberAdd fails 2024-09-25 19:23:15 +08:00
Kubernetes Prow Robot
c75e833026 Merge pull request #127347 from yuyabee/automated-cherry-pick-of-#127333-upstream-release-1.31
Automated cherry pick of #127333: Add activeDeadlineSeconds to kubeadm upgrade-health-check job
2024-09-24 02:01:59 +01:00
Sascha Grunert
e7090a9b9b Remove socat and ebtables from kubeadm preflight checks
Follow-up on https://github.com/kubernetes/release/pull/3722

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2024-09-17 11:47:23 +02:00
Yuya Yabe
ebc460e8cc Add activeDeadlineSeconds to kubeadm upgrade-health-check job
With https://github.com/kubernetes/kubernetes/pull/122079,
kubeadm now relies on `ttlSecondsAfterFinished` to clean
up `upgrade-health-check` once its pod reaches a terminal state.
However, there is a case where the pod won't reach a terminal state and
the job will not register a terminal state, hence no garbage collection.

For example, if the pause image is not present, `ErrImagePull` will make
the pod keep retrying to pull the image and the pod will never reach a
terminal state on its own. And the job will continue to wait for the pod
to reach a terminal state which will not happen.

So we need to set `activeDeadlineSeconds` to prevent the job from
waiting forever for the pod to reach a terminal state.

Without this, users invoking `kubeadm upgrade plan` need to cleanup the
job outside of kubeadm even if they ignore the preflight result because
the job still runs when the result is configured to be ignored via
`--ignore-prelight-errors=CreateJob` flag.

Since the timeout for the polling in the `CreateJob` step in kubeadm
is 15 seconds, we should set the `activeDeadlineSeconds` to the same
timeout.
2024-09-13 14:26:09 +00:00
Benjamin Elder
3301161c36 kubeadm: bump coredns to 1.11.3 2024-08-19 14:31:56 -07:00
Kubernetes Prow Robot
3a8a60eba2 Merge pull request #126240 from bzsuni/bz/etcd/update/v3.5.15
Update etcd to v3.5.15
2024-07-26 04:58:05 -07:00
Paco Xu
bdb51f28df fix a typo in kubeadm v1beta4 doc 2024-07-25 22:01:04 +08:00
bzsuni
4ad2cd9299 Update etcd from v3.5.14 to v3.5.15
Signed-off-by: bzsuni <bingzhe.sun@daocloud.io>
2024-07-25 10:48:34 +08:00
Kubernetes Prow Robot
815efa2baa Merge pull request #126250 from my-git9/pkiutil-consot
kubeadm: remove unused constants in util/pkiutil
2024-07-21 03:02:57 -07:00
Lubomir I. Ivanov
b90b280c5a kubeadm: fix join bug where kubeletconfig was not patched in memory
During kubeadm join in 1.30 kubeadm started respecting
the kubeletconfiguration healthz address/port. Previously
it hardcoded the health check to localhost:defaultport.

A corner case was not handled where the user applies --patches
on join to modify the local kubeletconfiguration. This results
in kubeletconfiguration patch target patches not being applied to
the KubeletConfiguration in memory and the health check
running on the address:port which are present in the kubelet-config
configmap.

Fix that by explicitly calling a new function to patch the
KubeletConfiguration in memory. This is scoped to only handle
the healthz checks *after* the kubelet config.yaml was already
patched and written to disk.
2024-07-20 19:31:19 +03:00
xin.li
c1dca0ad7c kubeadm: remove unused constants in util/pkiutil
Signed-off-by: xin.li <xin.li@daocloud.io>
2024-07-20 23:30:25 +08:00
Kubernetes Prow Robot
0fa4b9e14c Merge pull request #126109 from my-git9/staticpod
kubeadm: remove unused function in util/staticpod
2024-07-15 23:45:10 -07:00
Christian Schlotter
405fd111c2 kubeadm: use separate phase for changing the kubelet's kubeconfig on upgrade for ControlPlaneKubeletLocalMode 2024-07-15 11:19:21 +02:00
xin.li
fbf8cf41a7 kubeadm: remove unused function in util/staticpod
Signed-off-by: xin.li <xin.li@daocloud.io>
2024-07-14 16:57:25 +08:00
Kubernetes Prow Robot
33ccc51cb7 Merge pull request #125780 from chrischdi/pr-kubeadm-control-plane-kubelet-local-init
kubeadm: consider feature gate ControlPlaneKubeletLocalMode on init and upgrade
2024-07-12 12:50:16 -07:00
SataQiu
69a2bebc70 kubeadm: fix a bug that ImageExists check returns true when the image isn't in the local storage 2024-07-11 22:42:40 +08:00
SataQiu
d9001c7b00 kubeadm: the '--feature-gates' flag is deprecated and no-op for 'kubeadm upgrade apply/plan' 2024-06-30 11:22:24 +08:00
Alex Stundzia
58ff17bbfa When using external CA, look for common trust anchor within CA bundle. 2024-06-28 18:04:31 -05:00
Christian Schlotter
8871513c1b review fixes 2024-06-28 17:15:51 +02:00
Kubernetes Prow Robot
5e331569e4 Merge pull request #125779 from SataQiu/fix-upgrade-diff-20240628
kubeadm: fix a bug where the path of the manifest can not be specified when 'upgrade diff' specified a config file
2024-06-28 07:04:00 -07:00
Christian Schlotter
e51b55b451 kubeadm: feature gate ControlPlaneKubeletLocalMode on upgrade 2024-06-28 13:31:26 +02:00
Kubernetes Prow Robot
e832b70230 Merge pull request #125545 from claudiubelu/unittests-12
unittests: Fixes unit tests for Windows (part 12)
2024-06-28 03:57:56 -07:00
Christian Schlotter
241c1c7737 kubeadm: feature gate ControlPlaneKubeletLocalMode on init 2024-06-28 12:57:51 +02:00
SataQiu
7c2384d374 kubeadm: mark '--api-server-manifest', '--controller-manager-manifest' and '--scheduler-manifest' as deprecated flags 2024-06-28 18:53:05 +08:00
SataQiu
975f1c978d kubeadm: fix a bug where the path of the manifest can not be specified when 'upgrade diff' specified a config file 2024-06-28 18:01:19 +08:00
Claudiu Belu
b5e3b81de6 unittests: Fixes unit tests for Windows (part 12)
Currently, there are some unit tests that are failing on Windows due
to various reasons:

- IPVS proxy mode is not supported on Windows.
- pkg/kubelet/cri/remote was moved to cri-client.
2024-06-28 08:05:38 +00:00
SataQiu
7120b3902c kubeadm: improve the error/warning messages of 'validateSupportedVersion' to include the checked resource kind 2024-06-27 18:47:09 +08:00
SataQiu
6190152abd kubeadm: update the long description about 'kubeadm config' command 2024-06-27 15:54:42 +08:00
Christian Schlotter
038a94804e kubeadm: implement ControlPlaneKubeletLocalMode 2024-06-24 17:03:33 +02:00
Kubernetes Prow Robot
10ae1dbb52 Merge pull request #125636 from my-git9/certsunused
kubeadm: Remove unused function in phases/certs
2024-06-24 02:00:56 -07:00
Kubernetes Prow Robot
498f88803e Merge pull request #125121 from chendave/emeritus
Move myself(chendave) to the list of emeritus
2024-06-24 00:16:56 -07:00
xin.li
71d3f9e249 Remove unused function in phases/certs
Signed-off-by: xin.li <xin.li@daocloud.io>
2024-06-22 18:47:28 +08:00
Marko Mudrinić
33466a6606 kubeadm: Add '--yes' flag to the list of allowed flags
Signed-off-by: Marko Mudrinić <mudrinic.mare@gmail.com>
2024-06-18 13:04:17 +02:00
Lubomir I. Ivanov
09078d4810 kubeadM: allow conversion of TimeoutForControlPlane
v1beta3.ClusterConfiguration.APIServer.TimeoutForControlPlane
must be migrated to {Init|Join}Configuration.Timeouts.
.ControlPlaneComponentHealthCheck.

To achieve this sort of cross-Kind migration do the following:
- Use a temporary, thread-safe variable in timeoututils.go
- Make the order of GVKs in documentMapToInitConfiguration
deterministic.
2024-06-17 10:07:33 +03:00
Lubomir I. Ivanov
4af99cd676 kubeadm: deprecate v1beta3
Mark v1beta3 as deprecated by showing a warning when used
and write a note about it in the doc.go file.
2024-06-17 10:07:33 +03:00
Lubomir I. Ivanov
bc92a0dfe9 kubeadm: continue supporting extraArgs flags for v1beta4
Flags for kubeadm init such as --apiserver-extra-args prior
to v1beta4 used a map[string]string for pflag.Value storage. This no
longer works since v1beta4 extra args are a slice of Arg.

Add a new flag type argSlice and implement a solution for
parsing these flags.

At the same time deprecate these flags and show a warning
that users should use config.
2024-06-17 10:07:32 +03:00
Lubomir I. Ivanov
cc539cd600 kubeadm: more validation for Upgrade|ResetConfiguration
- Add unit tests for ValidateUpgrade|ResetConfiguration
- Add two more validation points in ValidateUpgradeConfiguration
2024-06-17 10:07:32 +03:00
Lubomir I. Ivanov
8a5f849c66 kubeadm: keep v1beta3 only in required code paths
Use v1beta4 everywhere and only use v1beta3
in a few required locations:
- kubeadm-config map handling
- unit and integration tests
2024-06-17 10:07:32 +03:00
Lubomir I. Ivanov
d0c656dc19 kubeadm: don't default ExtraEnvs to an empty slice
Instead of defaulting ExtraEnvs for CP components to an empty
slice when converting from/to v1beta3 keep it nil.

This allows for expecting a nil value in the internal
config, similarly to ExtraArgs.
2024-06-17 10:07:32 +03:00
Lubomir I. Ivanov
66c7fc5ab4 kubeadm: update migration logic from v1beta3 to 4
Treat v1beta4 as non experimental API when migrating.
Update unit tests.
2024-06-17 10:07:32 +03:00
Lubomir I. Ivanov
fb1fcd2d3b kubeadm: move v1beta4 to high priority in API scheme 2024-06-17 10:07:32 +03:00