Commit Graph

4504 Commits

Author SHA1 Message Date
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
Lubomir I. Ivanov
b9f7661ab8 kubeadm: add missing "kubeadm config print upgrade-defaults" 2024-06-17 10:07:32 +03:00
Lubomir I. Ivanov
6544d19796 kubeadm: update godoc and comments for v1beta4
- Include some more examples related to v1beta4 in the doc.go.
- Fix some typos in v1beta4 field comments.
- Add missing JSON tag for UpgradeConfiguration.Apply.SkipPhases.
2024-06-17 10:07:32 +03:00
Lubomir I. Ivanov
bca0f0836f kubeadm: fix a bug in v1beta3.JoinConfiguration.Discovery.Timeout
After the introduction of v1beta4 if the user inputs the old
v1beta3 discovery timeout the value is ignored. Fix that
by introducing a conversion to v1beta4.

Co-authored-by: penghez (GitHub handle)
2024-06-13 09:41:07 +03:00
Kubernetes Prow Robot
c77d954273 Merge pull request #125388 from neolit123/1.31-fix-kubeconfig-ecdsa
kubeadm: fix the generation of ECDSA keys in kubeconfig files
2024-06-11 09:18:35 -07:00
Lubomir I. Ivanov
40d185637c kubeadm: add UT for ClusterConfiguration.EncryptionAlgorithmType() 2024-06-11 12:39:24 +03:00
Kavin
dce2322933 Inherit certPhaseFlags for SA 2024-06-08 12:05:45 +05:30
Lubomir I. Ivanov
02ed1aee71 kubeadm: fix the generation of ECDSA keys in kubeconfig files
When the PublicKeysECDSA feature gate is used or the new
v1beta4.ClusterConfiguration.EncryptionAlgorithm field is used
with "ECDSA-P256" as value, make sure that this is reflected
in the "cert spec" used to generate private keys and they end
up as "EC keys".
2024-06-07 20:04:18 +03:00
Kubernetes Prow Robot
548d50da98 Merge pull request #125157 from carlory/kubeadm-2563
kubeadm: update warning message for the swap check
2024-06-03 04:20:55 -07:00
carlory
f5c69fde39 kubeadm: update warning message for the swap check
Co-authored-by: Lubomir I. Ivanov <neolit123@gmail.com>
2024-06-03 17:09:20 +08:00
Kubernetes Prow Robot
2d8a3ad572 Merge pull request #125265 from neolit123/1.31-use-actual-kubelet-address-port
kubeadm: use the actual configured kubelet healthz address:port
2024-06-02 23:14:32 -07:00
Lubomir I. Ivanov
52302e4ad5 kubeadm: use the actual configured kubelet healthz address:port
When doing a kubelet health check on init/join, do not
hardcode the "localhost" address. Instead, use the
KubeletConfiguration HealthzBindAddress and HealthzPort
fields.
2024-06-01 10:10:31 +03:00
Humble Chirammal
07ef65a834 make use of etcd v3.5.14 in the builds.
https://github.com/etcd-io/etcd/releases/tag/v3.5.14

This release has been built with GO 1.21.10

Signed-off-by: Humble Chirammal <humble.devassy@gmail.com>
2024-06-01 09:06:35 +05:30
Kubernetes Prow Robot
8565e37525 Merge pull request #125127 from my-git9/ut-compute
kubeadm: increase ut coverage for compute
2024-05-31 02:41:37 -07:00
xin.li
d24d82eda9 kubeadm: increase ut coverage for compute
Signed-off-by: xin.li <xin.li@daocloud.io>
2024-05-31 16:39:51 +08:00
Kubernetes Prow Robot
b503409e9c Merge pull request #124363 from claudiubelu/unittests-11
unittests: Fixes unit tests for Windows (part 11)
2024-05-30 08:17:24 -07:00
Kubernetes Prow Robot
2acdbae664 Merge pull request #125178 from my-git9/unusedfunction
kubeadm: remove some unused function
2024-05-30 06:47:02 -07:00
Sascha Grunert
51a36294a3 kubeadm: check only for RuntimeReady condition
We only check for the `RuntimeReady` condition instead of anything else
like the `NetworkReady` to allow kubeadm to provision the cluster.

Refers to https://github.com/kubernetes/kubernetes/pull/124685#issuecomment-2138655482
Follow-up on: https://github.com/kubernetes/kubernetes/pull/124685

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2024-05-30 08:33:22 +02:00
Kubernetes Prow Robot
83c2db067e Merge pull request #125179 from SataQiu/clean-20240528
kubeadm: only add the klog flags that are still supported for kubeadm, rather than disabling the unwanted flags
2024-05-29 20:14:55 -07:00
Kubernetes Prow Robot
da02fdb2ae Merge pull request #123339 from skitt/canonical-json-patch
Update kustomize, use canonical json-patch v4 import
2024-05-29 08:02:24 -07:00
Kubernetes Prow Robot
529896474f Merge pull request #124688 from neolit123/1.31-always-rotate-etcd-certs-on-upgrade
kubeadm: ensure that etcd certs are rotated on apiserver upgrade
2024-05-29 05:10:30 -07:00
Kubernetes Prow Robot
afebfdc5d4 Merge pull request #125158 from mttrb/kubeadm-grammar
Fix grammar in kubeadm output
2024-05-29 03:30:45 -07:00
Lubomir I. Ivanov
f4d5e1d65d kubeadm: ensure that etcd certs are rotated on apiserver upgrade
Currently if etcd.yaml does not have a diff on "kubeadm upgrade"
certificate renewal for it is also skipped.

Check if kube-apiserver.yaml needs an upgrade, if so and if
cert renewal is not disabled, renew etcd's certs and restart
its static pod.
2024-05-29 13:07:41 +03:00
Sascha Grunert
7d1bfd9872 Make kubeadm independent from crictl
With the new `cri-client` staging repository it's finally possible to
decouple `kubeadm` from `crictl`.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2024-05-29 08:58:01 +02:00
SataQiu
7f30b3494b kubeadm: only add the klog flags that are still supported for kubeadm, rather than disabling the unwanted flags 2024-05-29 12:38:21 +08:00
xin.li
7771a58b46 kubeadm: remove some unused function
Signed-off-by: xin.li <xin.li@daocloud.io>
2024-05-29 11:26:36 +08:00
Stephen Kitt
5300466a5c Use canonical json-patch v4 import
The canonical import for json-patch v4 is
gopkg.in/evanphx/json-patch.v4 (see
https://github.com/evanphx/json-patch/blob/master/README.md#get-it for
reference).

Using the v4-specific path should also reduce the risk of unwanted v5
upgrade attempts, because they won't be offered as automated upgrades
by dependency upgrade management tools, and they won't happen through
indirect dependencies (see
https://github.com/kubernetes/kubernetes/pull/120327 for context).

Signed-off-by: Stephen Kitt <skitt@redhat.com>
2024-05-28 10:48:22 +02:00
Matthew Robinson
8b1b32f226 Fix grammar in kubeadm output 2024-05-28 11:55:23 +08:00
Lubomir I. Ivanov
5e290ebc90 switch k/k to pause version 3.10 2024-05-24 10:02:51 +03:00
carlory
ba7b3bcbb6 Add carlory (myself) in kubeadm reviewers 2024-05-23 22:07:57 +08:00
Kubernetes Prow Robot
25b3912c0d Merge pull request #124997 from neolit123/1.31-deprecate-rootless-cp-fg
kubeadm: deprecate the RootlessControlPlane feature gate
2024-05-22 19:40:50 -07:00
Kubernetes Prow Robot
44c45484e0 Merge pull request #124465 from neolit123/1.31-add-etcd-livez-readyz
kubeadm: use etcd 3.5.11's /livez and /readyz endpoints for probes
2024-05-21 04:40:23 -07:00
Lubomir I. Ivanov
4a6d3187fa kubeadm: deprecate the RootlessControlPlane feature gate
The feature was left in alpha for a few releases, since
k8s started planning on a broader feature UserNamespacesSupport,
which is what kubeadm should integrate with.

UserNamespacesSupport graduated to beta in 1.30.
Once it graduates to GA kubeadm can start using it an remove
RootlessControlPlane.
2024-05-20 16:55:11 +03:00
Kubernetes Prow Robot
a31030543c Merge pull request #124920 from kimsehwan96/update-an-incorrect-comment-in-kubeadm-controlplane-join-phase
Update an incorrect comment in kubeadm controlplane join phase
2024-05-17 06:03:51 -07:00
Kubernetes Prow Robot
67012614c3 Merge pull request #124442 from neolit123/1.31-add-image-pull-policy-to-upgrade-config
kubeadm: support image pull mode and policy in UpgradeConfiguration
2024-05-16 20:12:52 -07:00
kimsehwan96
894a838a1a Update an incorrect comment in kubeadm controlplane join phase 2024-05-17 12:09:42 +09:00
Claudiu Belu
e90cfb83ed unittests: Fixes unit tests for Windows (part 11)
Currently, there are some unit tests that are failing on
Windows due to various reasons:

- Cannot remove a directory if there's a file open in that directory.
- Paths may have / or \ on Windows.
2024-05-16 12:36:49 +00:00
Kubernetes Prow Robot
22f3ce5e5e Merge pull request #124820 from SataQiu/feat-kubeadm-20240511
kubeadm: add support for patching a corednsdeployment target
2024-05-16 02:38:22 -07:00
Lubomir I. Ivanov
df87a503c2 kubeadm: use UpgradeNodeConfiguration.IgnorePreflightErrors
When using UpgradeNodeConfiguration.IgnorePreflightErrors the field
is currently ignored in favor of the "defualted" field created
by configutil.FetchInitConfigurationFromCluster.

Fix this bug.
2024-05-16 11:34:39 +03:00
Lubomir I. Ivanov
0faa2bfbc1 kubeadm: support image pull mode and policy in UpgradeConfiguration
Add Upgrade{Apply|Node}Configuration.{ImagePullPolicy|ImagePullSerial}.
The same feature already exists in NodeRegistrationOptions for
{Init|Join}Configuration.
2024-05-16 11:34:39 +03:00
carlory
7582a768b7 kubeadm: remove outdate todo 2024-05-13 12:08:57 +08:00
SataQiu
1329935739 kubeadm: add support for patching a corednsdeployment target 2024-05-11 18:21:20 +08:00