Commit Graph

335 Commits

Author SHA1 Message Date
SataQiu
8e4cf3b8d2 kubeadm: move show-join-command as a separate phase 2022-08-26 23:35:58 +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
Paco Xu
a0cc3f1c9a cleanup: DualStack GA for kubeadm 2021-09-04 22:38:14 +08:00
XinYang
72fd01095d
re-order imports for kubeadm
Signed-off-by: XinYang <xinydev@gmail.com>
2021-08-17 22:40:46 +08: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
Kubernetes Prow Robot
1345a802de
Merge pull request #103187 from Haleygo/fix-dry-run-when-using-externalCA
Kubeadm init --dry-run should work when using an external ca
2021-07-02 07:58:25 -07:00
Haleygo
6d6d200c3a dry-run can work when using an external ca 2021-07-02 18:53:51 +08:00
Lubomir I. Ivanov
70a524659a kubeadm: add {Init|Join}Configuration.Patches.Directory to v1beta3
Add {Init|Join}Configuration.Patches, which is a structure that
contains patch related options. Currently it only has the "Directory"
field which is the same option as the existing --experimental-patches
flag.

The flags --[experimental-]patches value override this value
if both a flag and config is passed during "init" or "join".
2021-06-23 22:24:10 +03:00
Kubernetes Prow Robot
e52b7be7d7
Merge pull request #101600 from KofClubs/fix-cri-socket-kubeadm
kubeadm: disallow the mixture of --cri-socket and --config
2021-06-11 00:04:58 -07:00
Lubomir I. Ivanov
24a1f9d817 kubeadm: use "SkipPhases" from configuration for "init" and "join"
During Runner data initialization, if the value for the flag
"--skip-phases" was empty set the {init|join}Runner.Options.SkipPhases
to the {Init|Join}Configuration.SkipPhases value.
2021-05-28 18:12:06 +03:00
Zhang Zhanpeng
5c2841c8cd Forbid the use of --config and --cri-socket at the same time
Signed-off-by: Zhang Zhanpeng <zhanpeng.zhang@daocloud.io>
2021-05-27 12:54:13 +08: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
Lubomir I. Ivanov
4cba7dcc43 kubeadm: enable v1beta3 accross the code base
- scheme: switch to:
utilruntime.Must(scheme.SetVersionPriority(v1beta3.SchemeGroupVersion))
- change all imports in the code base from v1beta2 to v1beta3
- rename all import aliases for kubeadmapiv1beta2 to "kubeadmapiv".
this allows smaller diffs when changing the default public API.
2021-04-20 03:47:27 +03:00
Lubomir I. Ivanov
b6ff320507 kubeadm: set the kubelet cgroup driver to "systemd" during "init"
The kubeadm documentation instructs users to set the container
runtime driver to "systemd", since kubeadm manages a kubelet via
the systemd init system. The kubelet default however is "cgroupfs".
For new clusters set the driver to "systemd" unless the user
is explicit about it. The same defaulting would not happen
during "upgrade".
2021-03-02 18:39:39 +02:00
SataQiu
646f4e2b62 make new command functions to keep private when they are not required to be public 2020-10-10 12:03:02 +08:00
Lubomir I. Ivanov
8ece27bf4b kubeadm: remove the --experimental-kustomize feature
The feature was replaced by --experimental-patches and deprecated in
1.19.
2020-09-18 03:49:53 +03:00
Hu Shuai
2be66feb49 Improve the prompt message when kubeadm init is successful
Signed-off-by: Hu Shuai <hus.fnst@cn.fujitsu.com>
2020-08-31 15:27:20 +08:00
Lubomir I. Ivanov
144778db83 kubeadm: plumb the patches option trough init/join/upgrade
This changes adds the "patches" option in all places where
the "kustomize" option is already present.
2020-06-26 02:14:47 +03:00
xphoniex
64cca18f4f move KubeletStartPhase past config writing phase(s) 2020-05-15 11:06:52 +00:00
Lubomir I. Ivanov
a18502615e kubeadm-init: allow overriding the dry-run temp directory
Allow overriding the dry-run temporary directory with
an env. variable (KUBEADM_INIT_DRYRUN_DIR).

Use the same variable in test/cmd/init_test.go.
This allows running integration tests as non-root.
2020-04-09 01:20:24 +03:00
Lubomir I. Ivanov
431fd630ff kubeadm: enable kubelet client certificate rotation on primary CP nodes
- Don't always print to stdout that the kubelet is starting.
instead delegate this to the callers of TryStartKubelet.
- Add a new root kubeadm init phase called "kubelet-finalize"
- Add a sub-phase to "kubelet-finalize"
called "experimental-cert-rotation"
- "cert-rotation" performs the following actions:
  - tries to guess if kubelet client cert rotation is enabled
  - update the kubelet.conf to use the rotatable cert/key
2019-11-13 15:49:33 +02:00
Kubernetes Prow Robot
f3981710db
Merge pull request #82473 from Nordix/kubeadm-dualstack-service-ip
Kubeadm DualStack Support for List of Service IPs
2019-10-02 11:26:08 -07:00
Arvinderpal Wander
bacc06d8fc kubeadm --service-cluster-ip-range supports a comma seperated list
of service subnets.

Update DNS, Cert, dry-run logic to support list of Service CIDRs.
Added unit tests for GetKubernetesServiceCIDR and updated
GetDNSIP() unit test to inclue dual-sack cases.
2019-09-16 09:33:43 -07:00
Jianfei Bai
fcfcd880fb refactor: replace all calls to os.Exit() / CheckErr(). 2019-09-05 10:16:53 +08:00
fabriziopandini
a92e7975d2 kubeadm-kustomize-ux 2019-08-15 09:14:31 +02:00
SataQiu
33b980272b kubeadm: add --control-plane-endpoint flag 2019-06-25 11:27:40 +08:00
SataQiu
c794929d1d kubeadm: cleanup ExperimentalControlPlane and ExperimentalUploadCerts 2019-06-24 11:52:57 +08:00
Kubernetes Prow Robot
44a3bf4755
Merge pull request #78452 from fabriziopandini/rename-ha-flags
kubeadm: rename-ha-flags
2019-05-30 02:25:13 -07: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
fabriziopandini
f3b5cb2145 rename-ha-flags 2019-05-28 22:16:03 +02:00
yameiwang
7e1badd7fd fix typo worklow->workflow 2019-05-25 07:05:37 +08:00
Marc Carré
e706d27262
kubeadm errors now ignorable via v1beta2 config files
Specifically, IgnorePreflightErrors in {Init,Join}Configuration's NodeRegistrationOptions can be used to achieve this.
See also: https://docs.google.com/document/d/1XnP67oO1i9VcDIpw42IzptnJsc5OQM-HTf8cVcjCR2w/edit
2019-05-23 16:22:17 +09:00
SataQiu
d46bd0dc7a make KubernetesDir a true constant 2019-05-09 17:16:59 +08:00
Kubernetes Prow Robot
f29138c372
Merge pull request #77012 from rosti/certkey-v1beta2
kubeadm: Add certificateKey field to v1beta2 config
2019-05-03 15:11:39 -07:00
Rostislav M. Georgiev
1826e445fe kubeadm: Add certificateKey field to v1beta2 config
This change introduces config fields to the v1beta2 format, that allow
certificate key to be specified in the config file. This certificate key is a
hex encoded AES key, that is used to encrypt certificates and keys, needed for
secondary control plane nodes to join. The same key is used for the decryption
during control plane join.
It is important to note, that this key is never uploaded to the cluster. It can
only be specified on either command line or the config file.
The new fields can be used like so:

---
apiVersion: kubeadm.k8s.io/v1beta2
kind: InitConfiguration
certificateKey: "yourSecretHere"
---
apiVersion: kubeadm.k8s.io/v1beta2
kind: JoinConfiguration
controlPlane:
  certificateKey: "yourSecretHere"
---

Signed-off-by: Rostislav M. Georgiev <rostislavg@vmware.com>
2019-05-02 11:47:07 +03:00
Àbéjídé Àyodélé
a2b0cb62a1 Clean up kubeadm.
These are based on recommendation from
[staticcheck](http://staticcheck.io/).

- Remove unused struct fields
- Remove unused function
- Remove unused variables
- Remove unused constants.
- Miscellaneous cleanups
2019-05-01 22:16:06 +00: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
SataQiu
3949ee0f79 clean up command description information for consistency and readability 2019-04-16 22:58:10 +08:00
SataQiu
4f6003b61f refactor code about setting KubernetesVersionFlag 2019-03-29 15:51:16 +08:00
SataQiu
c9cd3db627 fix none feature gates list 2019-03-28 20:11:47 +08:00
Kubernetes Prow Robot
c7e56c7ea1
Merge pull request #74719 from vaamarnath/refactor-dir-create-for-dry-runs
kubeadm: refactored directory fetch code
2019-03-19 20:15:20 -07:00
Kubernetes Prow Robot
b61baea135
Merge pull request #75420 from fabriziopandini/fix-kubeadm-init-output
fix kubeadm init output
2019-03-18 06:07:11 -07:00
fabriziopandini
fcadf143a5 fix-kubeadm-init-output 2019-03-18 12:52:41 +01:00
fabriziopandini
ff072aa639 fix-external-ca 2019-03-17 13:03:40 +01:00
Amarnath
be8d1c24f1 kubeadm: refactored directory fetch code 2019-03-13 18:28:53 +05:30
Lubomir I. Ivanov
c5c4cd2580 kubeadm: print key inside the upload-certs phase of init
The standalone execution of upload-certs phase does not print
the key that that user should use for the newly uploaded encrypted
secret. Print this key in the upload-certs phase in both
standalone mode or if executed in the standard init workflow.

Make it possible to omit the printing if the user passes
--skip-certificate-key-print.

Also:
- Uppercase string in Printf call in copycerts.go
- Don't use V(1) for the "Skipping phase" message in uploadcerts.go
instead always print a message that the user case use
--experimental-upload-certs. This solves a problem if the user tried
the standalone phase but didn't pass --experimental-upload-certs.
2019-03-10 19:13:06 +02:00
Yago Nobre
b1936853c4
Add certificate-key to kubeadm init upload-certs phase, and improve init output 2019-03-05 14:35:52 -03:00
pytimer
f600348006 kubeadm: reduce some functions number of parameters 2019-03-03 15:16:19 +08:00
Lubomir I. Ivanov
de5e17e6c3 kubeadm/phases: use common interfaces for init and join phases
The custom sub-set interfaces in init/join phases as a pattern
have isolation benefits - e.g. when a consumer imports these
but we don't want them to be able to call all methods from
the original object that satisfies a complete interface.

On the other hand these sub-set interfaces under phases/init
and phases/join are private.

Expose a couple of new common interfaces:
- InitData from phases/init/data.go
- JoinData from phases/join/data.go

Use these interfaces in init/join phases accordingly instead
of the sub-set interfaces.

Use compile-time type assertion to verify that these
interfaces can be satisfied by init.go's initData and
join.go's joinData.

Add NO-OP objects called testInitData and joinInitData
that can be used for unit testing if embedded.
2019-02-26 02:23:50 +02:00
Ed Bartosh
39871f565d kubeadm: remove dead code
Removed unused functions and variables from
the kubeadm codebase.
2019-02-22 23:01:14 +01:00