Commit Graph

57 Commits

Author SHA1 Message Date
Lubomir I. Ivanov
7938631e22
Revert "UpdateOrCreateToken get secrets err handling optimization" 2023-01-14 00:11:49 +02: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
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
SataQiu
aed6f56257 kubeadm: make the phase prefix and capitalization consistent 2022-01-16 00:01:35 +08:00
calvin
c5c9429d0e fix some kubeadm init phase constants 2021-11-09 10:30:01 +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
Lubomir I. Ivanov
14fa296bb3 kubeadm: use the bootstraptoken/v1 API across the code base
- Make v1beta3 use bootstraptoken/v1 instead of local copies
- Make the internal API use bootstraptoken/v1
- Update validation, /cmd, /util and other packages
- Update v1beta2 conversion
2021-07-02 00:11:49 +03:00
Benjamin Elder
56e092e382 hack/update-bazel.sh 2021-02-28 15:17:29 -08:00
Andrei Kvapil
9de0b2bf46
kubeadm: flatten admin.conf for cluster-info 2021-02-08 17:22:01 +01: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
Mike Danese
3aa59f7f30 generated: run refactor 2020-02-07 18:16:47 -08:00
Lubomir I. Ivanov
b117a928a6 kubeadm: prevent bootstrap of nodes with known names
If a Node name in the cluster is already taken and this Node is Ready,
prevent TLS bootsrap on "kubeadm join" and exit early.

This change requires that a new ClusterRole is granted to the
"system:bootstrappers:kubeadm:default-node-token" group to be
able get Nodes in the cluster. The same group already has access
to obtain objects such as the KubeletConfiguration and kubeadm's
ClusterConfiguration.

The motivation of this change is to prevent undefined behavior
and the potential control-plane breakdown if such a cluster
is racing to have two nodes with the same name for long periods
of time.

The following values are validated in the following precedence
from lower to higher:
- actual hostname
- NodeRegistration.Name (or "--node-name") from JoinConfiguration
- "--hostname-override" passed via kubeletExtraArgs

If the user decides to not let kubeadm know about a custom node name
and to instead override the hostname from a kubelet systemd unit file,
kubeadm will not be able to detect the problem.
2020-01-26 18:50:54 +02:00
Kubernetes Prow Robot
b2990bf796
Merge pull request #79025 from rosti/kubeadm-nuke-apiResource
kubeadm: Don't use "//pkg/apis/core".Resource helper
2019-06-15 12:56:34 -07:00
Rostislav M. Georgiev
7ba7bdaa22 kubeadm: Don't use "//pkg/apis/core".Resource helper
This helper is used in tests and pulls in unnecessary dependency, which should
not be used if kubeadm is to move to staging.
Replace with direct use of the GroupResource type.

Signed-off-by: Rostislav M. Georgiev <rostislavg@vmware.com>
2019-06-14 16:14:43 +03:00
Rostislav M. Georgiev
c394d0fd80 kubeadm: Don't use RBAC helpers
RBAC construction helpers are part of the Kubernetes internal APIs. As such,
we cannot use them once we move to staging.
Hence, replace their use with manual RBAC rule construction.

Signed-off-by: Rostislav M. Georgiev <rostislavg@vmware.com>
2019-06-14 14:08:31 +03:00
SataQiu
8b7b2349c7 capitalize the first letter of the prompt for consistency 2019-04-14 19:10:51 +08:00
Ed Bartosh
296df304a4 kubeadm: use t.Run in app/phases
Used T.Run API for kubeadm tests in app/phases/*

This should improve testing output and make it more visible
which test is doing what.

Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
2019-03-27 19:39:30 +01:00
Akihito INOH
4a3b990bbe Change to [bootstrap-token] in kubeadm output
In output of "kubeadm init", there are two strings for meaning of
bootstrap token which are "bootstraptoken" and "bootstrap-token".
This changes `[bootstraptoken]` to `[bootstrap-token]`.
2019-01-24 08:40:58 +09:00
Lubomir I. Ivanov
9a37f2d878
kubeadm: set pod-infra-container-image for the kubelet
The kubelet allows you to set `--pod-infra-container-image`
(also called `PodSandboxImage` in the kubelet config),
which can be a custom location to the "pause" image in the case
of Docker. Other CRIs are not supported.

Set the CLI flag for the Docker case in flags.go using
WriteKubeletDynamicEnvFile().
2018-11-13 13:10:22 -05:00
Davanum Srinivas
954996e231
Move from glog to klog
- Move from the old github.com/golang/glog to k8s.io/klog
- klog as explicit InitFlags() so we add them as necessary
- we update the other repositories that we vendor that made a similar
change from glog to klog
  * github.com/kubernetes/repo-infra
  * k8s.io/gengo/
  * k8s.io/kube-openapi/
  * github.com/google/cadvisor
- Entirely remove all references to glog
- Fix some tests by explicit InitFlags in their init() methods

Change-Id: I92db545ff36fcec83afe98f550c9e630098b3135
2018-11-10 07:50:31 -05:00
yuexiao-wang
c0a9b4d04d add BUILD
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
2018-10-30 16:23:52 +08:00
yuexiao-wang
cc303c8774 [kubeadm/app/]switch to github.com/pkg/errors
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
2018-10-30 16:23:24 +08:00
Yu Liao
fc21115c3f Moved staging/src/k8s.io/client-go/tools/bootstrap to staging/src/k8s.io/cluster-bootstrap 2018-10-02 09:46:13 -07:00
Jeff Grafton
23ceebac22 Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
Chuck Ha
125f5ac61a
Replace glog.Info{f,ln} with fmt.Print{f,ln}
This follows the pattern `kubectl` uses for logging.

There are two remaining glog.Infof call that cannot be removed easily.

One glog call comes from kubelet validation which calls features.SetFromMap.
The other comes from test/e2e during kernel validation.

Mostly fixes kubernetes/kubeadm#852

Signed-off-by: Chuck Ha <ha.chuck@gmail.com>
2018-06-04 10:34:31 -04:00
Lucas Käldström
67a9f1bfe7
autogenerated 2018-05-31 22:21:06 +03:00
Lucas Käldström
17adbf9b08
Add unit tests for the new Bootstrap Token objects and functions 2018-05-31 22:19:47 +03:00
Lucas Käldström
c473039580
kubeadm: Initial refactor of the Bootstrap Tokens. Add the new API objects, add/move helpers and start using the new flow in the code 2018-05-31 22:19:26 +03:00
Malhar Vora
9c4706f519 Implement verbosity feature for kubeadm init
Fixes #340

Adds functionality to see logs with various level of verbosity.

Currently there are two verbosity levels: 0 and 1
2018-03-25 09:43:31 -07:00
Jeff Grafton
ef56a8d6bb Autogenerated: hack/update-bazel.sh 2018-02-16 13:43:01 -08:00
Gavin
f653d02b05 create auto-gen files 2018-01-17 16:23:03 +08:00
Gavin
bb5e156aba Add generic Bootstrap Token constants and helpers to client-go 2018-01-17 16:22:37 +08:00
Jeff Grafton
efee0704c6 Autogenerate BUILD files 2017-12-23 13:12:11 -08:00
Kubernetes Submit Queue
5653b69bee
Merge pull request #53929 from wackxu/valuse
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Validate usage strings when creating bootstrap tokens via kubeadm

**What this PR does / why we need it**:

fix TODO: Validate usages here so we don't allow something unsupported

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-11-18 15:31:28 -08:00
xiangpengzhao
b8e7315b5e Clean up no longer used k8sVersion param 2017-11-15 23:24:17 +08:00
wackxu
0e1a74731d Validate usage strings when creating bootstrap tokens via kubeadm 2017-11-13 09:37:20 +08:00
Dr. Stefan Schimanski
bec617f3cc Update generated files 2017-11-09 12:14:08 +01:00
Dr. Stefan Schimanski
012b085ac8 pkg/apis/core: mechanical import fixes in dependencies 2017-11-09 12:14:08 +01:00
xiangpengzhao
df81ecf396 Remove MinimumCSRAutoApprovalClusterRolesVersion in 1.9 cycle. 2017-11-01 20:51:32 +08:00
Jeff Grafton
aee5f457db update BUILD files 2017-10-15 18:18:13 -07:00
andrewsykim
c92471e524 kubeadm: prepare for v1.9 cycle 2017-10-12 13:08:42 -04:00
Alexander Kanevskiy
59561efb78 Enable node certificate autorotation
As of 1.8.0 kubelet in kubeadm configuration ships with enabled feature
of node certificate autorotation, it makes sense to enable automatic
certificate rotation csr signing. It will help to avoid issues like
described in #53231 and #53237.
2017-09-29 21:57:50 +03:00
madhukar32
ad8c9a3b8a Removes creation of CSR approval CR from kubeadm 2017-09-26 07:04:32 -07:00
Serguei Bezverkhi
9d725da4c3 Switching to rbac/v1
Closes https://github.com/kubernetes/kubeadm/issues/398
2017-09-24 10:47:29 -04:00
Lucas Käldström
a455f995ac
kubeadm: Upgrade Bootstrap Tokens to beta when upgrading to v1.8 2017-09-06 21:04:33 +03:00
Matt Moyer
77f1b72a40 kubeadm: add --groups flag for kubeadm token create.
This adds support for creating a bootstrap token that authenticates with extra `system:bootstrappers:*` groups in addition to `system:bootstrappers`.
2017-08-25 16:26:20 -05:00