Commit Graph

4071 Commits

Author SHA1 Message Date
Kubernetes Prow Robot
fe9dc2ee11
Merge pull request #116573 from claudiubelu/fix-kubeadm-unittests
unit tests: Fixes init and rejoin unit tests for Windows
2023-03-14 08:36:52 -07:00
Kubernetes Prow Robot
4f76e4a0fd
Merge pull request #115603 from pacoxu/coredns-v1.10.1
update coredns to v1.10.1
2023-03-14 08:36:28 -07:00
Claudiu Belu
4f16887a11 unit tests: Fixes init and rejoin unit tests for Windows
The default CRI Socket on Windows is npipe://./pipe/containerd-containerd.
2023-03-14 09:45:16 +00:00
Kubernetes Prow Robot
bd1435dccd
Merge pull request #114016 from songxiao-wang87/runwxs-test3
word misspelling
2023-02-28 14:53:16 -08:00
Kubernetes Prow Robot
fb37f1331b
Merge pull request #113574 from chendave/cleanup_testcases
kubeadm: Improve testcases for `init` and `join` command
2023-02-28 00:43:16 -08:00
SataQiu
70b33409de kubeadm: modify '--config' flag from required to optional for 'kubeadm kubeconfig user' 2023-02-27 12:19:31 +08:00
Dave Chen
a825450707 kubeadm: improve test coverage by validating the data structure
data structure is what returned if everything okay, but this
structure is not validated at all both in `init` and `join` cmd.

Signed-off-by: Dave Chen <dave.chen@arm.com>
2023-02-27 10:41:25 +08:00
Paco Xu
b24725eed7 update coredns to v1.10.1
Signed-off-by: Paco Xu <paco.xu@daocloud.io>
2023-02-26 09:25:40 +08:00
Paco Xu
b1ee8c8b82 kubeadm: no need to check if target coredns version is not changed 2023-02-25 21:53:28 +08:00
Kubernetes Prow Robot
70c129fea5
Merge pull request #115420 from chendave/2806
kubeadm: skip ipv4 check if the cluster is using IPv6 address
2023-02-23 02:51:36 -08:00
Dave Chen
66f043f650 kubeadm: skip ipv4 check if the cluster is using IPv6 address
Signed-off-by: Dave Chen <dave.chen@arm.com>
2023-02-22 10:02:54 +08:00
Claudiu Belu
2e2ef9b0e7 unit tests: Fixes kubeadm postupgrade failing unit test on Windows
The unit test TestWriteKubeletConfigFiles fails on Windows because the
file not found error message is different on Windows.
2023-02-21 16:53:06 +00:00
Kubernetes Prow Robot
bd914b493c
Merge pull request #115676 from chendave/conversion_api
kubeadm: remove the manual conversion from versioned cluster cfg to internal cfg
2023-02-20 02:53:48 -08:00
Kubernetes Prow Robot
8e31885e36
Merge pull request #115575 from SataQiu/fix-20230207
kubeadm: fix a bug where the uploaded kubelet configuration in kube-system/kubelet-config ConfigMap does not respect user patch
2023-02-16 00:45:38 -08:00
SataQiu
d12b4d4c67 kubeadm: show a warning message when detecting that the sandbox image of the container runtime is inconsistent with that used by kubeadm 2023-02-10 14:59:40 +08:00
Dave Chen
82990268ec kubeadm: remove the manual conversion from versioned cluster cfg to internal cfg
The manual conversion was needed to adapt `ClusterConfiguration.DNS` from v1beta2
to v1beta3, now that v1beta2 is removed from the code base, the manual conversion
is unnecessary as well.

The help to reduce the maintenance efforts.

Signed-off-by: Dave Chen <dave.chen@arm.com>
2023-02-10 14:46:15 +08:00
SataQiu
69e50cabd2 kubeadm: fix a bug where the uploaded kubelet configuration in kube-system/kubelet-config ConfigMap does not respect user patch 2023-02-07 18:24:31 +08:00
Kubernetes Prow Robot
8e20effbb7
Merge pull request #114695 from chendave/fix_cross_move
kubeadm: backup kubelet config for "upgrade node" and "upgrade apply"
2023-02-07 02:18:58 -08:00
Kubernetes Prow Robot
6eb008620c
Merge pull request #115379 from artemvmin/serial-mkfs
Add an option to limit the number of concurrent mkfs calls
2023-02-06 18:26:58 -08:00
Kubernetes Prow Robot
561a35f358
Merge pull request #115038 from mercedes-benz/tobiasgiese/kubeadmfix-etcd-learner-join
kubeadm: fix etcd learner join
2023-02-06 02:09:01 -08:00
Artem Minyaylov
f573e14942 Update k8s.io/utils to latest version
Update all usages of FakeExec to pointer to avoid copying the mutex
2023-02-04 11:05:22 -08:00
Dave Chen
5127cbf949 kubeadm: backup kubelet config file for upgrade apply
Back up kubelet config file for `kubeadm upgrade apply`, some code
refactoring is done to de-dup some redundant code logic.

Signed-off-by: Dave Chen <dave.chen@arm.com>
2023-02-02 12:09:18 +08:00
Dave Chen
9e6e13e562 kubeadm: include the err got from PrintDryRunFile
The error was ingored which means if anything wrong from `PrintDryRunFiles`,
it was sliently ignored.

Signed-off-by: Dave Chen <dave.chen@arm.com>
2023-02-02 12:00:19 +08:00
Dave Chen
c55a98fde9 kubeadm: fix invalid cross-device link error
The root cause for that error is because `rename` doesn't work
across different mount points.

The kubelet config file and back up directory are mounted to
different file system in kinder environment.

```
df /var/lib/kubelet/config.yaml | tail -n1 | awk '{print $1}'
/dev/sda2

df /etc/kubernetes/tmp/kubeadm-kubelet-configxxx | tail -n1 | awk '{print $1}'
overlay
```

Call `cp` instead of `rename` to back up the kubelet file would fix
that issue.

Signed-off-by: Dave Chen <dave.chen@arm.com>
2023-02-02 11:43:18 +08:00
Dave Chen
016cc0c120 kubeadm:[cherry-pick]backup kubelet config for "upgrade node"
This addresses the TODO item so that the old kubelet config file could
be recovered if something goes wrong.

Signed-off-by: Dave Chen <dave.chen@arm.com>
Co-authored-by: Paco Xu <paco.xu@daocloud.io>
2023-02-02 11:43:18 +08:00
Kubernetes Prow Robot
5681b0da14
Merge pull request #115338 from danwinship/nodeutil.gethostname
Move GetHostname() from k/k/pkg/util/node to k/component-helpers/node/util
2023-01-30 09:07:20 -08:00
Dan Winship
f994ae2521 Move GetHostname() from k/k/pkg/util/node to k/component-helpers/node/util
In fact, this actually uses pkg/util/node's GetHostname() but takes
the unit tests from cmd/kubeadm/app/util's private fork of that
function since they were more extensive. (Of course the fact that
kubeadm had a private fork of this function is a strong argument for
moving it to component-helpers.)
2023-01-27 18:24:38 -05:00
Mohamed Zaian
90570b7595 etcd: Update to version 3.5.7 2023-01-27 17:24:00 +01:00
Tobias Giese
ea46c91868 kubeadm: promote member after the static pod manifest was written
Signed-off-by: Tobias Giese <tobias.giese@mercedes-benz.com>
Co-authored-by: Christian Schlotter <christi.schlotter@gmail.com>
2023-01-16 11:11:58 +01:00
Lubomir I. Ivanov
7938631e22
Revert "UpdateOrCreateToken get secrets err handling optimization" 2023-01-14 00:11:49 +02:00
Kubernetes Prow Robot
a66aad2d80
Merge pull request #115000 from helen-frank/feature/UpdateOrCreateTokenAddErrProcessing
UpdateOrCreateToken get secrets err handling optimization
2023-01-12 19:57:12 -08:00
Kubernetes Prow Robot
2b69bec35d
Merge pull request #114901 from SataQiu/fix-lint-error-20230108
Fix gocritic lint errors for cmd/kubeadm/*
2023-01-12 09:05:06 -08:00
helen
e6591d24ce when UpdateOrCreateTokens get secrets, if the error is not a NotFound, the error is thrown in time
Signed-off-by: helen <haitao.zhang@daocloud.io>
2023-01-12 20:50:02 +08:00
SataQiu
3df577ea28 kubeadm: remove unused variable DefaultAuditPolicyLogMaxAge 2023-01-12 12:30:30 +08:00
Dave Chen
765ef1783b kubeadm: stop using of CRI endpoints without URL scheme
run the testcase with `-v` flag will reveal the warning,
e.g.
`W1103 ... Usage of CRI endpoints without URL scheme is deprecated...`

Signed-off-by: Dave Chen <dave.chen@arm.com>
2023-01-12 10:59:34 +08:00
Dave Chen
a7b610c3bb kubeadm: use the right methods for logging if no args are passing
Signed-off-by: Dave Chen <dave.chen@arm.com>
2023-01-12 10:59:34 +08:00
Dave Chen
aae1f2a85f kubeadm: cri-socket is not allowed for mixed configuration
Set the `cri-socket` both in flags and config file will hit errors,
this should not be a valid case to validate in current testcases.

Signed-off-by: Dave Chen <dave.chen@arm.com>
2023-01-12 10:59:34 +08:00
Claudiu Belu
3af2c257e8 unit tests: Fixes kubeadm enforce requirements test
enforceRequirements will run preflight checks, including whether the user
is privileged is not. Because of this, the test will make different assertions
based on the user's UID. However, we don't have UIDs on Windows, so we're asserting
the wrong thing.

This fix addresses the issue.
2023-01-10 16:56:14 +00:00
SataQiu
e0f11d9c5b kubeadm: fix gocritic lint errors 2023-01-08 11:23:26 +08:00
SataQiu
5d99ad1182 kubeadm: update .import-restrictions 2023-01-07 23:46:02 +08:00
Kubernetes Prow Robot
4a98fa2536
Merge pull request #114540 from pacoxu/kubeadm-v1beta2
remove deprecated Kubeadm v1beta2 API
2023-01-05 21:29:58 -08:00
Kubernetes Prow Robot
2d534e4bea
Merge pull request #114842 from chendave/nil_pointer
kubeadm: fix the nil pointer dereference in testcase
2023-01-05 05:32:22 -08:00
Paco Xu
cca7a205ad remove kubeadm v1beta2 support 2023-01-05 21:30:26 +08:00
Dave Chen
23f75bf40e kubeadm: fix the nil pointer dereference in testcase
`genCSRConfig.kubeadmConfig` is possible to be nil if there any error
from the config loading, so access the field should only be done if
there is no error in the previous step.

Signed-off-by: Dave Chen <dave.chen@arm.com>
2023-01-05 16:21:15 +08:00
Dave Chen
49732716de kubeadm: unittest might run as non-root
Signed-off-by: Dave Chen <dave.chen@arm.com>
2023-01-05 12:13:19 +08:00
Paco Xu
b3056ea9bd remove the deprecated kubeadm v1beta2 API 2023-01-04 12:19:15 +08:00
Dave Chen
fd60b9c492 kubeadm: return the output from stdout and stderr
It was just saying the copy of file failed with `exit status 1`,
no much details for what's going wrong.

Combine the stderr and stdout and show those info will be easier
for us to fix the problem.

Signed-off-by: Dave Chen <dave.chen@arm.com>
2023-01-03 10:45:12 +08:00
Kubernetes Prow Robot
8a71485643
Merge pull request #114658 from neolit123/1.27-fix-dry-run-server-version
kubeadm: return stored FakedServerVersion when dry-running
2022-12-22 19:05:26 -08:00
Lubomir I. Ivanov
f8da9ab287 kubeadm: return stored FakedServerVersion when dry-running
If we are dry-running, do not attempt to fetch the /version
resource and just return the stored FakeServerVersion,
which is done when constructing the dry-run client in
upgrade/common.go#getClient().

The problem here is that during upgrade
dry-run client reactors are backed by a dynamic client
via NewClientBackedDryRunGetterFromKubeconfig() and
for GetActions there seems to be no analog to
Discovery().Serverversion() resource for a dynamic client(?).
2022-12-22 19:53:35 +02:00
Kubernetes Prow Robot
30e0e8edb9
Merge pull request #114597 from songxiao-wang87/runwxs-test10
Add test for cmd/kubeadm/app/images/images.go
2022-12-22 00:13:25 -08:00