Commit Graph

634 Commits

Author SHA1 Message Date
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
3df577ea28 kubeadm: remove unused variable DefaultAuditPolicyLogMaxAge 2023-01-12 12:30:30 +08:00
Paco Xu
cca7a205ad remove kubeadm v1beta2 support 2023-01-05 21:30:26 +08:00
Paco Xu
b3056ea9bd remove the deprecated kubeadm v1beta2 API 2023-01-04 12:19:15 +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
Dave Chen
1607babd35 kubeadm: print the invalid field when validating bootstrap token discovery
It was saying `discovery.bootstrapToken` is invalid with empty value, while
it is actually `discovery.bootstrapToken.caCertHashes` invalid.

Signed-off-by: Dave Chen <dave.chen@arm.com>
2022-10-26 13:45:00 +08:00
SataQiu
61cd585ad2 kubeadm: remove redundant import alias and unused apiclient util funcs 2022-09-28 12:36:54 +08:00
SataQiu
605f3dd89a kubeadm: fix the field path of ClusterConfiguration networking validation 2022-09-27 18:51:19 +08:00
SataQiu
b833e628b2 kubeadm: support image repository format validation 2022-09-26 19:38:42 +08:00
Claudiu Belu
d192029e6a unittests: Fixes cmd unit tests for Windows
Currently, there are some unit tests that are failing on Windows due to
various reasons:

- filepath.IsAbs does not consider "/" or "\" as absolute paths, even
  though files can be addressed as such.
- paths not properly joined (filepath.Join should be used).
- files not closed, which means that they cannot be removed / renamed.
- some assertions fail due to slashes / backslashes not matching.
- backslashes need to be escaped in yaml files, or put between ''
instead of "".
2022-08-26 16:03:13 +03:00
Kubernetes Prow Robot
3a650c5c56
Merge pull request #111502 from muyangren2/addtest_apiendpoint
add test for String
2022-08-01 12:10:40 -07:00
muyangren2
2422e99df3 add test for String
modify
2022-07-28 18:23:44 +08:00
muyangren2
fc6bbf991e add test in cmd/kubeadm/app/apis/kubeadm/validation/validation_test.go for ValidatePort
modify
2022-07-28 17:12:14 +08:00
Davanum Srinivas
a9593d634c
Generate and format files
- Run hack/update-codegen.sh
- Run hack/update-generated-device-plugin.sh
- Run hack/update-generated-protobuf.sh
- Run hack/update-generated-runtime.sh
- Run hack/update-generated-swagger-docs.sh
- Run hack/update-openapi-spec.sh
- Run hack/update-gofmt.sh

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2022-07-26 13:14:05 -04:00
Mengjiao Liu
88c6deb778 Update godoc.org to pkg.go.dev in kubeadm 2022-07-07 11:06:13 +08:00
Kubernetes Prow Robot
fa16bf8e12
Merge pull request #110791 from SataQiu/fix-kubeadm-20220626
kubeadm: fix the bug that configurable KubernetesVersion not respected during kubeadm join
2022-06-30 21:53:34 -07:00
SataQiu
2fb1941ae3 kubeadm: improve the error message of getClusterNodeMask func 2022-06-30 20:28:45 +08:00
SataQiu
5b2d6ca5df kubeadm: fix the bug that configurable KubernetesVersion not respected during kubeadm join 2022-06-30 14:47:33 +08:00
Lubomir I. Ivanov
428c3fe954 kubeadm: document "kubeletconfiguration" as a patch target
Document the "kubeletconfiguration" as a patch target in the
v1beta3 API Init/JoinConfiguration.Patches struct
and also for the --patches flag.
2022-06-06 20:37:26 +03:00
Davanum Srinivas
50bea1dad8
Move from k8s.gcr.io to registry.k8s.io
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2022-05-31 10:16:53 -04:00
Kubernetes Prow Robot
9169f16841
Merge pull request #108447 from pacoxu/kubeadm-json-upgrade-plan
`Kubeadm upgrade plan` support json/yaml output
2022-05-17 16:46:31 -07:00
Paco Xu
22fb3be96d cleanup: kubeadm upgrade plan supports json/yaml output
Co-authored-by: Lubomir I. Ivanov <neolit123@gmail.com>
2022-03-25 16:15:43 +08:00
Lubomir I. Ivanov
76e8a067d1 kubeadm: fix bad indentation in the API go docs
For the YAML examples, make the indentation consistent
by starting with a space and following with a TAB.
Also adjust the indentation of some fields to place them under
the right YAML field parent - e.g. ignorePreflightErrors
is under nodeRegistration.
2022-03-10 18:36:13 +02:00
Paco Xu
79ecd60208 bugfix(kubeadm): Fix UT and log optmize 2022-03-03 19:09:26 +08:00
Paco Xu
93daef6e77 feature(kubeadm): add support of json/yaml format for upgrade plan
- cherry-pick 83941 and rebase
2022-03-03 17:23:03 +08:00
Kubernetes Prow Robot
1fa888529e
Merge pull request #107533 from neolit123/1.24-update-master-label-taint
kubeadm: apply "master" label/taint migration for 1.24
2022-02-15 21:44:36 -08:00
Lubomir I. Ivanov
f6fbf6c6e6 kubeadm: remove mentions of the x.yy versioned kubelet config CM
The legacy naming "kubelet-config-x.yy" is no longer the
default behavior. Rename instances in documentation and comments
of "kubelet-config-x.yy" to "kubelet-config".
2022-02-10 18:14:50 +02:00
Kubernetes Prow Robot
f11dbaea2f
Merge pull request #106883 from calvin0327/move-well-know-systemConstant
kubeadm: move well-known system constants to constants.go
2022-02-01 17:28:21 -08:00
ahrtr
972dc46a1f replace deprecated io/ioutil with os and io for cmd 2022-02-01 13:59:41 +08:00
calvin
fcfcdef8fd move well-known system constants to constants.go 2022-01-27 10:39:14 +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
370031cada kubeadm: apply the new "control-plane" taint on CP nodes
- Apply "control-plane" taint during init/join by adding the
taint in SetNodeRegistrationDynamicDefaults(). The old
taint "master" is still applied.
- Clarify API docs (v1beta2 and v1beta3) for nodeRegistration.Taint
to not mention "master" taint and be more generic. Remove
example for taints that includes the word "master".
- Update unit tests.
2022-01-13 17:46:05 +02: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
Lubomir I. Ivanov
ad58393e19 kubeadm: remove the deprecated output/v1alpha1 API
The API was deprecated in 1.23 when output/v1alpha2 was
added. v1alpha1 is problematic since it embeds kubeadm/v1beta2
BootstrapToken related types directly. v1alpha2 imports
a new group dedicated to bootstrap tokens apis/bootstraptoken.
2022-01-11 12:51:46 +02:00
pacoxu
7594f0ef90 kubeadm: detect runtime socket as URL format
- Update defaults for v1beta2 and 3 to have URL scheme
- Raname DefaultUrlScheme to DefaultContainerRuntimeURLScheme
- Prepend a missing URL scheme to user sockets and warn them
that this might not be supported in the future
- Update socket validation to exclude IsAbs() testing
(This is broken on Windows). Assume the path is not empty and has
URL scheme at this point (validation happens after defaulting).
- Use net.Dial to open Unix sockets
- Update all related unit tests

Signed-off-by: pacoxu <paco.xu@daocloud.io>
Signed-off-by: Lubomir I. Ivanov <lubomirivanov@vmware.com>
2022-01-03 21:15:03 +02:00
Paco Xu
703f2a7b86 kubeadm: mark v1beta2 as deprecated 2021-12-15 09:36:42 +08:00
Kubernetes Prow Robot
35f9bcabf1
Merge pull request #105992 from hwdef/fix-kubeadm-2419
kubeadm: add mutation for Linux paths in KubeletConfiguration on Windows
2021-11-11 19:48:29 -08:00
hwdef
b985e094b0 kubeadm: fix absolute paths do not work properly in config files in windows 2021-11-12 10:42:46 +08:00
Kubernetes Prow Robot
73f4064fff
Merge pull request #105295 from neolit123/1.23-add-output-v1alpha2
kubeadm: add a new output/v1alpha2 API; deprecate output/v1alpha1
2021-11-08 06:01:11 -08:00
Lubomir I. Ivanov
d3e1f87fca kubeadm: remove TODO about moving SchemeBuilder to k8s.io/api
This TODO is no longer in scope, thus remove it from
all register.go files under /app/apis.
2021-11-03 19:11:43 +02:00
Lubomir I. Ivanov
f73894359d kubeadm: update converters after the output/v1alpha2 addition
The addition of output/v1alpha2 made the converter-gen require
an explicit converter for:
kubeadm/v1beta2.BootstrapToken -> bootstraptoken/v1.BootstrapToken.

Add this converter under kubeadm/v1beta.
Use the converter in output/v1alpha1.
2021-11-03 19:11:43 +02:00
haoyun
9b5f28053c feat: make a const of magic-number
Signed-off-by: haoyun <yun.hao@daocloud.io>
Co-authored-by: Lubomir I. Ivanov <neolit123@gmail.com>
2021-10-22 09:53:07 +08:00
Lubomir I. Ivanov
73d528dce9 kubeadm: make output/BootstrapToken use bootstraptoken/v1 2021-09-28 16:37:41 +03:00
Lubomir I. Ivanov
47af311ea4 kubeadm: mark output/v1alpha1 as deprecated 2021-09-28 16:37:40 +03:00
Lubomir I. Ivanov
473e781ccb kubeadm: set output/v1alpha2 as the priority version 2021-09-28 16:37:40 +03:00
Lubomir I. Ivanov
2d4fcedbcf kubeadm: add a new output/v1alpha2 API
The API is a copy of output/v1alpha1 with a minor difference
where output/v1alpha2.BootstrapToken embeds
bootstraptoken/v1.BootstrapToken instead of
kubeadm/v1beta2.BootstrapToken.

Embedding the later is an undesired binding between the "kubeadm"
and "output" groups, preventing the eventual deprecation and removal
of the kubeadm.v1beta2 API.

This new output API version, unlike v1alpha1, does not include
defaulting which is not needed.
2021-09-28 16:37:26 +03:00
Paco Xu
751ad37a05 kubeadm: cleanup remove some empty feature gate for dual-stack 2021-09-28 15:34:26 +08:00
Paco Xu
1385bd3a06 kubeadm: fix ut failures of dualstack GA 2021-09-14 13:16:40 +08:00
Paco Xu
a0cc3f1c9a cleanup: DualStack GA for kubeadm 2021-09-04 22:38:14 +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