Commit Graph

31 Commits

Author SHA1 Message Date
ahrtr
972dc46a1f replace deprecated io/ioutil with os and io for cmd 2022-02-01 13:59:41 +08:00
Lubomir I. Ivanov
6578e0f6c5 kubeadm: introduce static defaults for unit tests
Add DefaultedStaticInitConfiguration() which can be
used instead of DefaultedInitConfiguration() during unit tests.

The later can be slow since it performs dynamic defaulting.
2021-02-01 19:43:57 +02:00
KeZhang
0abed09a6a remove unused funcs for kubeadm tests 2020-12-22 19:37:30 +08:00
alan
cd2ecefb80 kubeadm: fix name of CA spell error 2019-08-06 12:01:28 +08:00
Rostislav M. Georgiev
5671ea9cf1 kubeadm: Remove ClusterConfiguration from InitConfiguration in v1beta2
Ever since v1alpha3, InitConfiguration is containing ClusterConfiguration
embedded in it. This was done to mimic the internal InitConfiguration, which in
turn is used throughout the kubeadm code base as if it is the old
MasterConfiguration of v1alpha2.

This, however, is confusing to users who vendor in kubeadm as the embedded
ClusterConfiguration inside InitConfiguration is not marshalled to YAML.
For this to happen, special care must be taken for the ClusterConfiguration
field to marshalled separately.

Thus, to make things smooth for users and to reduce third party exposure to
technical debt, this change removes ClusterConfiguration embedding from
InitConfiguration.

Signed-off-by: Rostislav M. Georgiev <rostislavg@vmware.com>
2019-05-29 12:13:37 +03:00
Rostislav M. Georgiev
9e1ac76c1a kubeadm: Introduce v1beta2 config
Signed-off-by: Rostislav M. Georgiev <rostislavg@vmware.com>
2019-04-25 17:10:04 +03:00
aaa
81c30cbeb0 kubeadm cleanup: master -> control-plane
update pul request
2019-04-20 06:15:19 -04:00
Rostislav M. Georgiev
51197e4393 kubeadm: Refactor InitConfiguration init APIs
Currently ConfigFileAndDefaultsToInternalConfig and
FetchConfigFromFileOrCluster are used to default and load InitConfiguration
from file or cluster. These two APIs do a couple of completely separate things
depending on how they were invoked. In the case of

ConfigFileAndDefaultsToInternalConfig, an InitConfiguration could be either
defaulted with external override parameters, or loaded from file.
With FetchConfigFromFileOrCluster an InitConfiguration is either loaded from
file or from the config map in the cluster.

The two share both some functionality, but not enough code. They are also quite
difficult to use and sometimes even error prone.

To solve the issues, the following steps were taken:

- Introduce DefaultedInitConfiguration which returns defaulted version agnostic
  InitConfiguration. The function takes InitConfiguration for overriding the
  defaults.

- Introduce LoadInitConfigurationFromFile, which loads, converts, validates and
  defaults an InitConfiguration from file.

- Introduce FetchInitConfigurationFromCluster that fetches InitConfiguration
  from the config map.

- Reduce, when possible, the usage of ConfigFileAndDefaultsToInternalConfig by
  replacing it with DefaultedInitConfiguration or LoadInitConfigurationFromFile
  invocations.

- Replace all usages of FetchConfigFromFileOrCluster with calls to
  LoadInitConfigurationFromFile or FetchInitConfigurationFromCluster.

- Delete FetchConfigFromFileOrCluster as it's no longer used.

- Rename ConfigFileAndDefaultsToInternalConfig to
  LoadOrDefaultInitConfiguration in order to better describe what the function
  is actually doing.

Signed-off-by: Rostislav M. Georgiev <rostislavg@vmware.com>
2019-02-11 14:45:34 +02:00
Sascha Grunert
ba7aaa911d
Update dedent to latest release
Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2019-01-17 08:30:07 +01:00
Ed Bartosh
b40018da7b kubeadm: simplify minimum Kubernetes version bumps
Replaced hardcoded "v0.12.0" strings with MinimumControlPlaneVersion and
MinimumKubeletVersion global variables.

This should help with a regular release version bumps.
2018-12-19 20:41:25 +02:00
yuexiao-wang
0dc0659e07 move test utilites out of /test
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
2018-12-04 19:27:17 +08:00
Rostislav M. Georgiev
aa414e139e kubeadm: Bump minimum Kubernetes version to v1.12
Bump MinimumControlPlaneVersion and MinimumKubeletVersion to v1.12 and update
any related tests.

Signed-off-by: Rostislav M. Georgiev <rostislavg@vmware.com>
2018-11-20 16:21:49 +02:00
Lucas Käldström
731bcdc864
kubeadm: InitConfiguration.APIEndpoint -> LocalAPIEndpoint 2018-11-09 14:47:21 +02:00
yuexiao-wang
4f0c2ecf09 move certs/pkiutil to generic kubeadm utils
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
2018-11-01 15:05:19 +08:00
k8s-ci-robot
b836fa432e
Merge pull request #69420 from ereslibre/fix-kubeadm-panic
kubeadm: do not panic if etcd local alpha phase is called when an external etcd config is used
2018-10-05 10:55:30 -07:00
Rafael Fernández López
503c6c7b85
kubeadm: do not panic if etcd local alpha phase is called when an external etcd config is used
If etcd local alpha phase is called manually while the kubeadm configuration
points to an external etcd cluster kubeadm panics.
2018-10-05 07:55:17 +02:00
fabriziopandini
9aec633c40 Fix tests 2018-10-04 13:20:11 +02:00
Lubomir I. Ivanov
fb365768e0 kubeadm: update MinimumControlPlaneVersion to v1.11.0
Update MinimumControlPlaneVersion to v1.11.0. Also update related
unit tests and test configurations.
2018-09-15 05:26:40 +03:00
liz
cda8c39f77
Fixes using externally managed certs for kubeadm
Walk the certificate tree, at each step checking for a CACert.
If the CACert is found, try to use it to generate certificates.
Otherwise, generate a new CA cert.
2018-09-06 11:28:51 -04:00
fabriziopandini
7dfb3c7134 kubeadm config add support for more than one APIEndpoint 2018-08-27 09:00:26 +02:00
Lucas Käldström
5224551fa1 kubeadm: Split out ClusterConfiguration from InitConfiguration
Trivial rebasement, fixed some broken tests,
and inserted some TODOs: Rostislav M. Georgiev <rostislavg@vmware.com>
2018-08-22 11:43:02 +03:00
Lucas Käldström
52f0591ad9
Automated rename from MasterConfiguration to InitConfiguration 2018-07-09 04:55:02 +03:00
Lucas Käldström
c9b52ede7e
Automated bump from v1alpha2 references to v1alpha3 2018-07-04 14:07:53 +03:00
Lucas Käldström
e2ca0f7cce
Fix kubeadm unit tests relying on internet access 2018-06-19 20:34:45 +03:00
Lucas Käldström
b48f23b786
kubeadm: Move .NodeName and .CRISocket to a common sub-struct 2018-05-29 17:51:39 +03:00
Lucas Käldström
e28242a245
autogenerated move to reference the v1alpha2 API inside of kubeadm 2018-05-16 09:59:41 +01:00
cheyang
4ca3903eab fix typo in kubeadm
Signed-off-by: cheyang <cheyang@163.com>
2018-02-06 13:48:18 +08:00
fabriziopandini
5fac458f5f Main work -- refactor certs phase 2017-08-18 09:13:49 +02:00
fabriziopandini
f9f91bf18e fully implement kubeadm-phase-kubeconfig 2017-08-05 16:44:39 +02:00
Derek McQuay
1459bbade4
kubeadm: updated cmd tests as discussed in SIG
After today's SIG meeting, it was discussed how to proceed with these
types of test-cmd tests.  They will live in kubeamd/test/cmd and will
provide a flag that will allow you to skip them (--kubeadm-cmd-skip) and
by default will fail if kubeadm binary is not present
2017-02-07 12:47:07 -08:00
Jacob Beacham
cf6b6778dc Adding CLI tests for kubeadm. 2016-10-31 11:12:51 -07:00