Commit Graph

335 Commits

Author SHA1 Message Date
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
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
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
Kubernetes Prow Robot
c1c0e4fe0b
Merge pull request #114489 from aimuz/replace2tag
kubeadm: replace Runtime.GOOS with go:build tag
2022-12-15 07:27:47 -08:00
aimuz
4860b67b48
kubeadm: replace Runtime.GOOS with go:build tag
Signed-off-by: aimuz <mr.imuz@gmail.com>
2022-12-15 17:57:45 +08:00
Dave Chen
8c7609fbe2 kubeadm: bump to use golang generic
Signed-off-by: Dave Chen <dave.chen@arm.com>
2022-12-14 10:31:18 +08:00
jiepeng
211e0a6496 simplified regexp 2022-09-07 15:51:36 +08:00
Abirdcfly
00b9ead02c cleanup: remove duplicate import
Signed-off-by: Abirdcfly <fp544037857@gmail.com>
2022-07-14 11:25:19 +08:00
Kubernetes Prow Robot
df0af6f7b8
Merge pull request #110736 from Octopusjust/k8s-pr3
Incomplete coverage of test scenarios
2022-06-23 04:33:44 -07:00
ZhangYu
9f4562c7b6 Incomplete coverage of test scenarios 2022-06-23 11:41:23 +08:00
navist2020
2a7e85bfdb Return preflightError if an error occurs when running the preflight 2022-04-20 11:39:35 +08:00
SataQiu
6c57e2fced kubeadm: fix the bug that windows node failed to join IPv6 cluster due to preflight failures
Signed-off-by: SataQiu <shidaqiu2018@gmail.com>
2022-03-17 22:07:08 +08:00
ahrtr
972dc46a1f replace deprecated io/ioutil with os and io for cmd 2022-02-01 13:59:41 +08:00
Kubernetes Prow Robot
8a25964153
Merge pull request #107317 from neolit123/1.24-change-kubeadm-cr-auto-detection
kubeadm: adapt CRI detection and defaults after the dockershim removal
2022-01-17 11:00:50 -08:00
Lubomir I. Ivanov
ea2c948799 kubeadm: change the default CRI socket to containerd
Change the default container runtime CRI socket endpoint to the
one of containerd. Previously it was the one for Docker

- Rename constants.DefaultDockerCRISocket to DefaultCRISocket
- Make the constants files include the endpoints for all supported
container runtimes for Unix/Windows.
- Update unit tests related to docker runtime testing.
- In kubelet/flags.go hardcode the legacy docker socket as a check
to allow kubeadm 1.24 to run against kubelet 1.23 if the user
explicitly sets the criSocket field to "npipe:////./pipe/dockershim"
on Windows or "unix:///var/run/dockershim.sock" on Linux.
2022-01-12 17:15:45 +02:00
SataQiu
218b4dea9f kubeadm: print warnings to stderr 2022-01-11 23:08:59 +08:00
Lubomir I. Ivanov
936e12c930 kubeadm: do not special case Docker as a container runtime
crictl already works with the current state of dockershim.
Using the docker CLI is not required and the DockerRuntime
can be removed from kubeadm. This means that crictl
can connect at the dockershim (or cri-dockerd) socket and
be used to list containers, pull images, remove containers, and
all actions that the kubelet can otherwise perform with the socket.

Ensure that crictl is now required for all supported container runtimes
in checks.go. In the help text in waitcontrolplane.go show only
the crictl example.

Remove the check for the docker service from checks.go.
Remove the DockerValidor check from checks.go.
These two checks were special casing Docker as CR and compensating
for the lack of the same checks in dockershim. With the
extraction of dockershim to cri-dockerd, ideally cri-dockerd
should perform the required checks whether it can support
a given Docker config / version running on a host.
2022-01-05 21:27:24 +02:00
Hanna Lee
c862d7c0e9 Fix last remaining SA5011 error by removing unnecessary r != nil check 2021-11-17 08:56:01 +01:00
Kubernetes Prow Robot
91f820eee4
Merge pull request #104854 from pacoxu/kubeadm-swap-check
kubeadm: move swap on check error to warning since NodeSwap is beta
2021-09-17 04:57:13 -07:00
SataQiu
d57e442c62 kubeadm: do not check if the /etc/kubernetes/manifests folder is empty on joining worker nodes during preflight
Signed-off-by: SataQiu <shidaqiu2018@gmail.com>
2021-09-14 20:26:04 +08:00
Paco Xu
d57bad5fa9 Update cmd/kubeadm/app/preflight/checks.go
Co-authored-by: Lubomir I. Ivanov <neolit123@gmail.com>
2021-09-14 09:33:12 +08:00
Paco Xu
7007b417e5 kubeadm: move swap on check error to warning since NodeSwap is beta in 1.23 2021-09-14 09:33:12 +08:00
Stephen Augustus
481cf6fbe7
generated: Run hack/update-gofmt.sh
Signed-off-by: Stephen Augustus <foo@auggie.dev>
2021-08-24 15:47:49 -04:00
Antonio Ojea
0cd75e8fec run hack/update-netparse-cve.sh 2021-08-20 10:42:09 +02:00
XinYang
72fd01095d
re-order imports for kubeadm
Signed-off-by: XinYang <xinydev@gmail.com>
2021-08-17 22:40:46 +08:00
Lubomir I. Ivanov
096c3e8f2d kubeadm: further improve the dynamic version population
Panicing if not running in a test and if the component-base/version
variables are empty is not ideal. At some point sections
of kubeadm could be exposed as a library and if these sections
import the constants package, they would panic on the library
users unless they set the version information in component-base
with ldflags.

Instead:
- If the component-base version is empty, return a placeholder version
that should indicate to users that build kubeadm that something is not
right (e.g. they did not use 'make'). During library usage or unit
tests this version should not be relevant.
- Update unit tests to use hardcoded versions instead of the versions
from the constants package. Using the constants package for testing
is good but during unit tests these versions are already placeholders
since unit tests do not populate the actual component-base versions
(e.g. 1.23).
2021-08-12 19:54:06 +03:00
Kubernetes Prow Robot
e96652ea74
Merge pull request #104015 from neolit123/1.23-use-dynamic-versions
kubeadm: dynamically populate the current/minimum k8s versions
2021-08-09 21:59:17 -07:00
Lubomir I. Ivanov
e3538edc22 kubeadm: update unit tests to support dynamic version updates
Tests under /app and /test would fail if the current/minimum k8s version
is dynamically populated from the version in the kubeadm binary.
Adapt the tests to support that.
2021-08-09 19:42:08 +03:00
gkarthiks
019e8f71b6 refactor: normalizing URL string locally and move out from purell package
The purell package at github.com/PuerkitoBio/purell is no longer maintained and in k/k repo under kubeadm package its been used for normalizing the URL. This commit removes the dependency on this package and creates a local function for normalizing the URL within the preflight package under cmd/kubeadm.

Signed-off-by: gkarthiks <github.gkarthiks@gmail.com>

chore: add new line at end of the file

Signed-off-by: gkarthiks <github.gkarthiks@gmail.com>

fix: remove unused mod from vendor modules file

Signed-off-by: gkarthiks <github.gkarthiks@gmail.com>
2021-07-20 21:56:08 +05:30
Lubomir I. Ivanov
f01d251e38 kubeadm: statically default ImagePullPolicy in v1beta3
Instead of dynamically defaulting NodeRegistration.ImagePullPolicy,
which is common when doing defaulting depending on host state - e.g.
hostname, statically default it in v1beta3/defaults.go.

- Remove defaulting in checks.go
- Add one more unit test in checks_test.go
- Adapt v1beta2 conversion and fuzzer / round tripping tests

This also results in the default being visible when calling:
"kubeadm config print ...".
2021-07-05 21:48:06 +03:00
XinYang
c2a8cd359f
re-order the imports in kubeadm
Signed-off-by: XinYang <xinydev@gmail.com>

Update cmd/kubeadm/app/cmd/join.go

Co-authored-by: Lubomir I. Ivanov <neolit123@gmail.com>
2021-07-04 16:41:27 +08:00
Lubomir I. Ivanov
3b36e6bcea kubeadm: fix image pull policy integration
If the user has not specified a pull policy we must assume a default of
v1.PullIfNotPresent.

Add some extra verbose output to help users monitor what policy is
used and what images are skipped / pulled.

Use "fallthrough" and case handle "v1.PullAlways".

Update unit test.
2021-06-23 00:52:35 +03:00
Kubernetes Prow Robot
c864f2357d
Merge pull request #102901 from wangyysde/add-support-imagePullPolicy-fix524
kubeadm: add support of imagePullPolicy to kubeadm
2021-06-22 07:43:59 -07:00
wangyysde
459fe7d08a add support of imagePullPolicy to kubeadm
Signed-off-by: wangyysde <net_use@bzhy.com>
2021-06-22 07:13:25 +08:00
刁浩 10284789
84112d3690 refactor cmd/kubeadm/app/preflight/checks_test.go()
Signed-off-by: 刁浩 10284789 <diao.hao@zte.com.cn>
2021-06-16 01:46:27 +00:00
Lubomir I. Ivanov
8e5a982442 kubeadm: remove the cgroup driver detection code for Docker
Ideally this should be part of dockershim/CRI and not on the
side of kubeadm.

Remove the detection during:
- During preflight
- During kubelet config defaulting
2021-05-25 22:05:42 +03:00
pacoxu
2fdbfd8a27 kubeadm: move cgroupDriver defaulting to componentconfigs/kubelet.go#Default()
Signed-off-by: pacoxu <paco.xu@daocloud.io>
2021-05-21 17:27:40 +08:00
Benjamin Elder
56e092e382 hack/update-bazel.sh 2021-02-28 15:17:29 -08:00
pacoxu
2c89fa4a59 add hostname check in kubeadm join: warning log only
Co-authored-by: Lubomir I. Ivanov <neolit123@gmail.com>
2021-02-20 09:50:25 +08:00
Abel Barrera Duran
52979da973 32bit > 4GB integer overflow edge case fix 2020-12-21 13:12:42 -05:00
Kubernetes Prow Robot
92ba3eb793
Merge pull request #93275 from xlgao-zju/check-mem
kubeadm: Add a preflight check that the control-plane node has at least 1700MB of RAM
2020-09-03 08:17:40 -07:00
RobertKielty
737548a6b2 go fmt fix 2020-08-13 06:03:58 +01:00
RobertKielty
1eb1690a92 names unnamed testcases, adds name to t.Errorf msg 2020-08-12 00:22:38 +01:00
Xianglin Gao
c6975a7750 add test case for kubeadm memory check
Signed-off-by: Xianglin Gao <xianglin.gxl@alibaba-inc.com>
2020-07-24 10:57:22 +08:00
Xianglin Gao
e5bb66f899 Add a preflight check that the control-plane node has at least 2GB RAM
Signed-off-by: Xianglin Gao <xianglin.gxl@alibaba-inc.com>
2020-07-20 23:58:31 +08:00
Davanum Srinivas
07d88617e5
Run hack/update-vendor.sh
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-05-16 07:54:33 -04:00
Davanum Srinivas
442a69c3bd
switch over k/k to use klog v2
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-05-16 07:54:27 -04:00
Prasad Katti
b4e026a1ea kubeadm: update service check log to include service name 2020-04-23 16:51:39 -07:00
tangcong
90481a9596 fix kubeadm staticcheck err 2020-04-21 06:54:42 +08:00