Commit Graph

4577 Commits

Author SHA1 Message Date
Yuya Yabe
db66416c45 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-12 19:40:25 +00:00
Lubomir I. Ivanov
914fd40712 kubeadm: add default paths to 'upgrade diff'
After the flags to control manifest paths were removed,
the variables in diff.go remained empty and the validation
fails with "empty manifest path".

Always populate the paths with the kubeadm defaults under
/etc/kubernetes/manifest and remove the empty path validation.
2024-09-12 11:59:53 +03:00
Kubernetes Prow Robot
d62b797c16 Merge pull request #127123 from neolit123/1.32-remove-deprecated-upgrade-flags
kubeadm: remove deprecated upgrade flags for 1.32
2024-09-11 19:03:20 +01:00
SataQiu
036e072e41 kubeadm: skip addons phase on worker node 2024-09-11 14:28:09 +08:00
Kubernetes Prow Robot
a8fb2cefbb Merge pull request #126610 from liyuerich/postupgrade
kubeadm: add UT for postupgrade
2024-09-10 15:16:13 +01:00
liyuerich
e4d8154f14 add UT for postupgrade
Signed-off-by: liyuerich <yue.li@daocloud.io>
2024-09-10 19:47:21 +08:00
Kubernetes Prow Robot
d913914511 Merge pull request #127096 from neolit123/1.32-fix-unknown-phase-error
kubeadm: better error handling for unknown phases and commands
2024-09-10 11:00:48 +01:00
SataQiu
8420b096c9 kubeadm: refactor upgrade to reduce duplication code 2024-09-10 14:43:36 +08:00
SataQiu
8db2dd3c8b kubeadm: add addon and post-upgrade phase for 'kubeadm upgrade node' 2024-09-09 19:04:23 +08:00
Kubernetes Prow Robot
d088d4c387 Merge pull request #126032 from SataQiu/imp-apply-phase-20240711
kubeadm: implement 'kubeadm upgrade apply phase'
2024-09-06 11:00:08 +01:00
Lubomir I. Ivanov
b497d28d43 kubeadm: better error handling for unknown phases and commands
If an unknown command or a phase is called consistently
return the same error.

If a command that has subcommands is called
return an error.

To achieve the above add a new util function
RequireSubcommand() that sets NoArgs and RunE for
regular commands or a "phase" command.

Remove MacroCommandLongDescription and just return an
error that a subcommand is required from the phase runner.

Fix minor comments capitalization.

Perform other minor fixes in util/error.go.
2024-09-05 19:41:43 +03:00
Lubomir I. Ivanov
730fd13726 kubeadm: remove deprecated upgrade flags for 1.32
The flags for control-plane component manifest under 'upgrade diff'
and the --feture-gates flag were deprecated and NOOP in 1.31
and can be removed in 1.32.
2024-09-05 17:13:06 +03:00
SataQiu
da234c9b23 kubeadm: improve some grammar issues 2024-09-05 22:12:05 +08:00
SataQiu
ea61d04db1 kubeadm: improve some grammar issues and add post-upgrade phase 2024-09-05 22:04:36 +08:00
SataQiu
a2f8d31c65 kubeadm: improve some grammar issues and add some unit test cases 2024-09-05 22:04:36 +08:00
SataQiu
595482d264 kubeadm: implement 'kubeadm upgrade apply phase'
Signed-off-by: SataQiu <shidaqiu2018@gmail.com>
2024-09-05 22:04:32 +08:00
Sascha Grunert
5f9a6d3e57 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-05 15:14:49 +02:00
Kubernetes Prow Robot
09115bd093 Merge pull request #127115 from chenk008/fix_upload-config_example
Correct kubeadm init phase upload-config kubeadm example
2024-09-04 11:39:08 +01:00
chenk008
ea2b03fff3 Fix: kubeadm init phase upload-config kubeadm example 2024-09-04 17:27:59 +08:00
Kubernetes Prow Robot
85384fe273 Merge pull request #126945 from liangyuanpeng/kubeadm_split_healthz_scheduler
kubeadm: scheduler using livez and readyz instead of healthz.
2024-09-03 14:05:15 +01:00
Lan Liang
db8f3a4b7c kubeadm: scheduler using livez and readyz instead of healthz.
Signed-off-by: Lan Liang <gcslyp@gmail.com>
2024-09-03 06:44:07 +00:00
Nathan Baulch
ad7cb45bb2 Fix kubeadm typos 2024-09-03 13:07:55 +10:00
Kubernetes Prow Robot
de6db3ffb0 Merge pull request #126758 from my-git9/dryrun-ut
kubeadm: increase ut coverage for util/dryrun
2024-08-30 06:33:30 +01:00
xin.li
6f7f49c3df kubeadm: increase ut coverage for util/dryrun
Signed-off-by: xin.li <xin.li@daocloud.io>
2024-08-30 10:53:04 +08:00
Kubernetes Prow Robot
e9c9a27c97 Merge pull request #126914 from carlory/fix-kubeadm-3045
kubeadm remove the deprecated flag '--experimental-output'
2024-08-27 19:17:03 +01:00
carlory
84f6301204 kubeadm: removed the deprecated flag '--experimental-output', please use the flag '--output' instead that serves the same purpose. Affected commands are - "kubeadm config images list", "kubeadm token list", "kubeadm upgade plan", "kubeadm certs check-expiration". 2024-08-26 16:48:30 +08:00
Paco Xu
df00f2fd96 remove deprecated experimental-cert-rotation, use enable-client-cert-rotation instead 2024-08-26 16:39:59 +08:00
Kubernetes Prow Robot
385fd21d92 Merge pull request #126743 from neolit123/1.32-add-get-proxy-env-vars-test
kubeadm: sort the merged env vars and improve related tests
2024-08-26 05:40:50 +01:00
Kubernetes Prow Robot
2f3e7f515f Merge pull request #126740 from neolit123/1.32-allow-config-and-print-manifest
kubeadm: allow mix of --print-manifest and --config flags
2024-08-26 05:40:41 +01:00
Lubomir I. Ivanov
a9f681d40a kubeadm: sort the results of MergeKubeadmEnvVars
MergeKubeadmEnvVars use a map which results in non
deterministic output in the end slice EnvVar objects.
Before returning the slice, sort it by the Name field.

Update the unit test to capture the sorting aspect.
2024-08-20 09:11:53 +03:00
Lubomir I. Ivanov
ffbc494a4a kubeadm: add unit test for GetProxyEnvVars 2024-08-20 09:11:53 +03:00
xin.li
6b9e106c2f kubeadm: remove unused function in util/pkiutil
Signed-off-by: xin.li <xin.li@daocloud.io>
2024-08-17 22:57:33 +08:00
Lubomir I. Ivanov
d441d9140d kubeadm: allow mix of --print-manifest and --config flags
The flag --print-manifest is only present for the subphases of
'kubeadm init phase addon'. It needs to be allowed to be mixed
with the flag --config so that the user can pass their custom
config that will affect the output of the printed manifests.
2024-08-16 17:01:39 +03:00
SataQiu
d8b3ada1c1 kubeadm: update supported etcd version list for 1.32
Signed-off-by: SataQiu <shidaqiu2018@gmail.com>
2024-08-15 18:23:59 +08:00
Kubernetes Prow Robot
fc64d2abb0 Merge pull request #126374 from pacoxu/ga-etcd-learner-mode
[1.32]kubeadm: promote etcd learner mode to GA
2024-08-14 01:59:22 -07:00
Kubernetes Prow Robot
c8259fb116 Merge pull request #126628 from pacoxu/v1beta4-typo
fix a typo in kubeadm v1beta4 doc
2024-08-13 22:11:55 -07:00
Kubernetes Prow Robot
e1b1d4ac7b Merge pull request #126596 from saschagrunert/checks
kubeadm: don't warn if `crictl` binary does not exist
2024-08-13 22:11:48 -07:00
Kubernetes Prow Robot
82cfcbf86d Merge pull request #126579 from my-git9/ut-version
kubeadm: increase ut coverage for util/version
2024-08-13 22:11:41 -07:00
Kubernetes Prow Robot
62cd87e839 Merge pull request #126538 from SataQiu/validate-20240805
kubeadm: add a validation warning when the certificateValidityPeriod is more than the caCertificateValidityPeriod
2024-08-13 22:11:03 -07:00
Paco Xu
85c3c67094 fix a typo in kubeadm v1beta4 doc 2024-08-12 15:12:20 +08:00
xin.li
42e8446d7e kubeadm: increase ut coverage for util/version
Signed-off-by: xin.li <xin.li@daocloud.io>
2024-08-09 09:23:10 +08:00
Sascha Grunert
d850fb6756 kubeadm: don't warn if crictl binary does not exist
kubeadm does not rely on `crictl` any more, so we can now drop the
warning in 1.32 as outlined in:

https://github.com/kubernetes/kubeadm/issues/3064

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2024-08-08 15:28:31 +02:00
SataQiu
506d5c8966 kubeadm: add a validation warning when the certificateValidityPeriod is more than the caCertificateValidityPeriod 2024-08-05 16:15:24 +08:00
Benjamin Elder
8b69990643 kubeadm: bump coredns to 1.11.3 2024-07-29 13:43:04 -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
bec4c0408c kubeadm: promote etcd learner mode to GA 2024-07-26 14:02:46 +08: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