Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
e743f0e4
Unverified
Commit
e743f0e4
authored
Nov 07, 2018
by
Yago Nobre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kubeadm graduate bootstrap-token phase
parent
e4c5d451
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
4 additions
and
102 deletions
+4
-102
BUILD
cmd/kubeadm/app/cmd/BUILD
+0
-1
alpha.go
cmd/kubeadm/app/cmd/alpha/alpha.go
+0
-1
init.go
cmd/kubeadm/app/cmd/init.go
+2
-48
BUILD
cmd/kubeadm/app/cmd/phases/BUILD
+0
-2
bootstraptoken.go
cmd/kubeadm/app/cmd/phases/bootstraptoken.go
+0
-0
.generated_docs
docs/.generated_docs
+2
-14
kubeadm_alpha_phase_bootstrap-token_cluster-info.md
...admin/kubeadm_alpha_phase_bootstrap-token_cluster-info.md
+0
-3
kubeadm_alpha_phase_bootstrap-token_create.md
docs/admin/kubeadm_alpha_phase_bootstrap-token_create.md
+0
-3
kubeadm_alpha_phase_bootstrap-token_node.md
docs/admin/kubeadm_alpha_phase_bootstrap-token_node.md
+0
-3
kubeadm_alpha_phase_bootstrap-token_node_allow-auto-approve.md
...dm_alpha_phase_bootstrap-token_node_allow-auto-approve.md
+0
-3
kubeadm_alpha_phase_bootstrap-token_node_allow-post-csrs.md
...beadm_alpha_phase_bootstrap-token_node_allow-post-csrs.md
+0
-3
kubeadm_init_phase_bootstrap-token.md
docs/admin/kubeadm_init_phase_bootstrap-token.md
+0
-0
kubeadm-alpha-phase-bootstrap-token-all.1
docs/man/man1/kubeadm-alpha-phase-bootstrap-token-all.1
+0
-3
kubeadm-alpha-phase-bootstrap-token-cluster-info.1
...n/man1/kubeadm-alpha-phase-bootstrap-token-cluster-info.1
+0
-3
kubeadm-alpha-phase-bootstrap-token-create.1
docs/man/man1/kubeadm-alpha-phase-bootstrap-token-create.1
+0
-3
kubeadm-alpha-phase-bootstrap-token-node-allow-auto-approve.1
...adm-alpha-phase-bootstrap-token-node-allow-auto-approve.1
+0
-3
kubeadm-alpha-phase-bootstrap-token-node-allow-post-csrs.1
...ubeadm-alpha-phase-bootstrap-token-node-allow-post-csrs.1
+0
-3
kubeadm-alpha-phase-bootstrap-token-node.1
docs/man/man1/kubeadm-alpha-phase-bootstrap-token-node.1
+0
-3
kubeadm-alpha-phase-bootstrap-token.1
docs/man/man1/kubeadm-alpha-phase-bootstrap-token.1
+0
-3
kubeadm-init-phase-bootstrap-token.1
docs/man/man1/kubeadm-init-phase-bootstrap-token.1
+0
-0
No files found.
cmd/kubeadm/app/cmd/BUILD
View file @
e743f0e4
...
@@ -38,7 +38,6 @@ go_library(
...
@@ -38,7 +38,6 @@ go_library(
"//cmd/kubeadm/app/images:go_default_library",
"//cmd/kubeadm/app/images:go_default_library",
"//cmd/kubeadm/app/phases/addons/dns:go_default_library",
"//cmd/kubeadm/app/phases/addons/dns:go_default_library",
"//cmd/kubeadm/app/phases/addons/proxy:go_default_library",
"//cmd/kubeadm/app/phases/addons/proxy:go_default_library",
"//cmd/kubeadm/app/phases/bootstraptoken/clusterinfo:go_default_library",
"//cmd/kubeadm/app/phases/bootstraptoken/node:go_default_library",
"//cmd/kubeadm/app/phases/bootstraptoken/node:go_default_library",
"//cmd/kubeadm/app/phases/certs:go_default_library",
"//cmd/kubeadm/app/phases/certs:go_default_library",
"//cmd/kubeadm/app/phases/controlplane:go_default_library",
"//cmd/kubeadm/app/phases/controlplane:go_default_library",
...
...
cmd/kubeadm/app/cmd/alpha/alpha.go
View file @
e743f0e4
...
@@ -52,7 +52,6 @@ func newCmdPhase(out io.Writer) *cobra.Command {
...
@@ -52,7 +52,6 @@ func newCmdPhase(out io.Writer) *cobra.Command {
}
}
cmd
.
AddCommand
(
phases
.
NewCmdAddon
())
cmd
.
AddCommand
(
phases
.
NewCmdAddon
())
cmd
.
AddCommand
(
phases
.
NewCmdBootstrapToken
())
cmd
.
AddCommand
(
phases
.
NewCmdMarkMaster
())
cmd
.
AddCommand
(
phases
.
NewCmdMarkMaster
())
cmd
.
AddCommand
(
phases
.
NewCmdSelfhosting
())
cmd
.
AddCommand
(
phases
.
NewCmdSelfhosting
())
...
...
cmd/kubeadm/app/cmd/init.go
View file @
e743f0e4
...
@@ -44,8 +44,6 @@ import (
...
@@ -44,8 +44,6 @@ import (
"k8s.io/kubernetes/cmd/kubeadm/app/features"
"k8s.io/kubernetes/cmd/kubeadm/app/features"
dnsaddonphase
"k8s.io/kubernetes/cmd/kubeadm/app/phases/addons/dns"
dnsaddonphase
"k8s.io/kubernetes/cmd/kubeadm/app/phases/addons/dns"
proxyaddonphase
"k8s.io/kubernetes/cmd/kubeadm/app/phases/addons/proxy"
proxyaddonphase
"k8s.io/kubernetes/cmd/kubeadm/app/phases/addons/proxy"
clusterinfophase
"k8s.io/kubernetes/cmd/kubeadm/app/phases/bootstraptoken/clusterinfo"
nodebootstraptokenphase
"k8s.io/kubernetes/cmd/kubeadm/app/phases/bootstraptoken/node"
certsphase
"k8s.io/kubernetes/cmd/kubeadm/app/phases/certs"
certsphase
"k8s.io/kubernetes/cmd/kubeadm/app/phases/certs"
kubeconfigphase
"k8s.io/kubernetes/cmd/kubeadm/app/phases/kubeconfig"
kubeconfigphase
"k8s.io/kubernetes/cmd/kubeadm/app/phases/kubeconfig"
kubeletphase
"k8s.io/kubernetes/cmd/kubeadm/app/phases/kubelet"
kubeletphase
"k8s.io/kubernetes/cmd/kubeadm/app/phases/kubelet"
...
@@ -182,6 +180,7 @@ func NewCmdInit(out io.Writer) *cobra.Command {
...
@@ -182,6 +180,7 @@ func NewCmdInit(out io.Writer) *cobra.Command {
initRunner
.
AppendPhase
(
phases
.
NewEtcdPhase
())
initRunner
.
AppendPhase
(
phases
.
NewEtcdPhase
())
initRunner
.
AppendPhase
(
phases
.
NewWaitControlPlanePhase
())
initRunner
.
AppendPhase
(
phases
.
NewWaitControlPlanePhase
())
initRunner
.
AppendPhase
(
phases
.
NewUploadConfigPhase
())
initRunner
.
AppendPhase
(
phases
.
NewUploadConfigPhase
())
initRunner
.
AppendPhase
(
phases
.
NewBootstrapTokenPhase
())
// TODO: add other phases to the runner.
// TODO: add other phases to the runner.
// sets the data builder function, that will be used by the runner
// sets the data builder function, that will be used by the runner
...
@@ -505,51 +504,6 @@ func runInit(i *initData, out io.Writer) error {
...
@@ -505,51 +504,6 @@ func runInit(i *initData, out io.Writer) error {
}
}
}
}
// PHASE 5: Set up the node bootstrap tokens
tokens
:=
[]
string
{}
for
_
,
bt
:=
range
i
.
cfg
.
BootstrapTokens
{
tokens
=
append
(
tokens
,
bt
.
Token
.
String
())
}
if
!
i
.
skipTokenPrint
{
if
len
(
tokens
)
==
1
{
fmt
.
Printf
(
"[bootstraptoken] using token: %s
\n
"
,
tokens
[
0
])
}
else
if
len
(
tokens
)
>
1
{
fmt
.
Printf
(
"[bootstraptoken] using tokens: %v
\n
"
,
tokens
)
}
}
// Create the default node bootstrap token
glog
.
V
(
1
)
.
Infof
(
"[init] creating RBAC rules to generate default bootstrap token"
)
if
err
:=
nodebootstraptokenphase
.
UpdateOrCreateTokens
(
client
,
false
,
i
.
cfg
.
BootstrapTokens
);
err
!=
nil
{
return
errors
.
Wrap
(
err
,
"error updating or creating token"
)
}
// Create RBAC rules that makes the bootstrap tokens able to post CSRs
glog
.
V
(
1
)
.
Infof
(
"[init] creating RBAC rules to allow bootstrap tokens to post CSR"
)
if
err
:=
nodebootstraptokenphase
.
AllowBootstrapTokensToPostCSRs
(
client
);
err
!=
nil
{
return
errors
.
Wrap
(
err
,
"error allowing bootstrap tokens to post CSRs"
)
}
// Create RBAC rules that makes the bootstrap tokens able to get their CSRs approved automatically
glog
.
V
(
1
)
.
Infof
(
"[init] creating RBAC rules to automatic approval of CSRs automatically"
)
if
err
:=
nodebootstraptokenphase
.
AutoApproveNodeBootstrapTokens
(
client
);
err
!=
nil
{
return
errors
.
Wrap
(
err
,
"error auto-approving node bootstrap tokens"
)
}
// Create/update RBAC rules that makes the nodes to rotate certificates and get their CSRs approved automatically
glog
.
V
(
1
)
.
Infof
(
"[init] creating/updating RBAC rules for rotating certificate"
)
if
err
:=
nodebootstraptokenphase
.
AutoApproveNodeCertificateRotation
(
client
);
err
!=
nil
{
return
err
}
// Create the cluster-info ConfigMap with the associated RBAC rules
glog
.
V
(
1
)
.
Infof
(
"[init] creating bootstrap configmap"
)
if
err
:=
clusterinfophase
.
CreateBootstrapConfigMapIfNotExists
(
client
,
adminKubeConfigPath
);
err
!=
nil
{
return
errors
.
Wrap
(
err
,
"error creating bootstrap configmap"
)
}
glog
.
V
(
1
)
.
Infof
(
"[init] creating ClusterInfo RBAC rules"
)
if
err
:=
clusterinfophase
.
CreateClusterInfoRBACRules
(
client
);
err
!=
nil
{
return
errors
.
Wrap
(
err
,
"error creating clusterinfo RBAC rules"
)
}
glog
.
V
(
1
)
.
Infof
(
"[init] ensuring DNS addon"
)
glog
.
V
(
1
)
.
Infof
(
"[init] ensuring DNS addon"
)
if
err
:=
dnsaddonphase
.
EnsureDNSAddon
(
i
.
cfg
,
client
);
err
!=
nil
{
if
err
:=
dnsaddonphase
.
EnsureDNSAddon
(
i
.
cfg
,
client
);
err
!=
nil
{
return
errors
.
Wrap
(
err
,
"error ensuring dns addon"
)
return
errors
.
Wrap
(
err
,
"error ensuring dns addon"
)
...
@@ -578,7 +532,7 @@ func runInit(i *initData, out io.Writer) error {
...
@@ -578,7 +532,7 @@ func runInit(i *initData, out io.Writer) error {
}
}
// Prints the join command, multiple times in case the user has multiple tokens
// Prints the join command, multiple times in case the user has multiple tokens
for
_
,
token
:=
range
tokens
{
for
_
,
token
:=
range
i
.
Tokens
()
{
if
err
:=
printJoinCommand
(
out
,
adminKubeConfigPath
,
token
,
i
.
skipTokenPrint
);
err
!=
nil
{
if
err
:=
printJoinCommand
(
out
,
adminKubeConfigPath
,
token
,
i
.
skipTokenPrint
);
err
!=
nil
{
return
errors
.
Wrap
(
err
,
"failed to print join command"
)
return
errors
.
Wrap
(
err
,
"failed to print join command"
)
}
}
...
...
cmd/kubeadm/app/cmd/phases/BUILD
View file @
e743f0e4
...
@@ -54,12 +54,10 @@ go_library(
...
@@ -54,12 +54,10 @@ go_library(
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/util/sets:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/util/sets:go_default_library",
"//staging/src/k8s.io/client-go/kubernetes:go_default_library",
"//staging/src/k8s.io/client-go/kubernetes:go_default_library",
"//staging/src/k8s.io/cluster-bootstrap/token/api:go_default_library",
"//vendor/github.com/golang/glog:go_default_library",
"//vendor/github.com/golang/glog:go_default_library",
"//vendor/github.com/pkg/errors:go_default_library",
"//vendor/github.com/pkg/errors:go_default_library",
"//vendor/github.com/renstrom/dedent:go_default_library",
"//vendor/github.com/renstrom/dedent:go_default_library",
"//vendor/github.com/spf13/cobra:go_default_library",
"//vendor/github.com/spf13/cobra:go_default_library",
"//vendor/github.com/spf13/pflag:go_default_library",
"//vendor/k8s.io/utils/exec:go_default_library",
"//vendor/k8s.io/utils/exec:go_default_library",
],
],
)
)
...
...
cmd/kubeadm/app/cmd/phases/bootstraptoken.go
View file @
e743f0e4
This diff is collapsed.
Click to expand it.
docs/.generated_docs
View file @
e743f0e4
...
@@ -27,13 +27,6 @@ docs/admin/kubeadm_alpha_phase_addon.md
...
@@ -27,13 +27,6 @@ docs/admin/kubeadm_alpha_phase_addon.md
docs/admin/kubeadm_alpha_phase_addon_all.md
docs/admin/kubeadm_alpha_phase_addon_all.md
docs/admin/kubeadm_alpha_phase_addon_coredns.md
docs/admin/kubeadm_alpha_phase_addon_coredns.md
docs/admin/kubeadm_alpha_phase_addon_kube-proxy.md
docs/admin/kubeadm_alpha_phase_addon_kube-proxy.md
docs/admin/kubeadm_alpha_phase_bootstrap-token.md
docs/admin/kubeadm_alpha_phase_bootstrap-token_all.md
docs/admin/kubeadm_alpha_phase_bootstrap-token_cluster-info.md
docs/admin/kubeadm_alpha_phase_bootstrap-token_create.md
docs/admin/kubeadm_alpha_phase_bootstrap-token_node.md
docs/admin/kubeadm_alpha_phase_bootstrap-token_node_allow-auto-approve.md
docs/admin/kubeadm_alpha_phase_bootstrap-token_node_allow-post-csrs.md
docs/admin/kubeadm_alpha_phase_mark-master.md
docs/admin/kubeadm_alpha_phase_mark-master.md
docs/admin/kubeadm_alpha_phase_selfhosting.md
docs/admin/kubeadm_alpha_phase_selfhosting.md
docs/admin/kubeadm_alpha_phase_selfhosting_convert-from-staticpods.md
docs/admin/kubeadm_alpha_phase_selfhosting_convert-from-staticpods.md
...
@@ -54,6 +47,7 @@ docs/admin/kubeadm_config_upload_from-flags.md
...
@@ -54,6 +47,7 @@ docs/admin/kubeadm_config_upload_from-flags.md
docs/admin/kubeadm_config_view.md
docs/admin/kubeadm_config_view.md
docs/admin/kubeadm_init.md
docs/admin/kubeadm_init.md
docs/admin/kubeadm_init_phase.md
docs/admin/kubeadm_init_phase.md
docs/admin/kubeadm_init_phase_bootstrap-token.md
docs/admin/kubeadm_init_phase_certs.md
docs/admin/kubeadm_init_phase_certs.md
docs/admin/kubeadm_init_phase_certs_apiserver-etcd-client.md
docs/admin/kubeadm_init_phase_certs_apiserver-etcd-client.md
docs/admin/kubeadm_init_phase_certs_apiserver-kubelet-client.md
docs/admin/kubeadm_init_phase_certs_apiserver-kubelet-client.md
...
@@ -123,13 +117,6 @@ docs/man/man1/kubeadm-alpha-phase-addon-all.1
...
@@ -123,13 +117,6 @@ docs/man/man1/kubeadm-alpha-phase-addon-all.1
docs/man/man1/kubeadm-alpha-phase-addon-coredns.1
docs/man/man1/kubeadm-alpha-phase-addon-coredns.1
docs/man/man1/kubeadm-alpha-phase-addon-kube-proxy.1
docs/man/man1/kubeadm-alpha-phase-addon-kube-proxy.1
docs/man/man1/kubeadm-alpha-phase-addon.1
docs/man/man1/kubeadm-alpha-phase-addon.1
docs/man/man1/kubeadm-alpha-phase-bootstrap-token-all.1
docs/man/man1/kubeadm-alpha-phase-bootstrap-token-cluster-info.1
docs/man/man1/kubeadm-alpha-phase-bootstrap-token-create.1
docs/man/man1/kubeadm-alpha-phase-bootstrap-token-node-allow-auto-approve.1
docs/man/man1/kubeadm-alpha-phase-bootstrap-token-node-allow-post-csrs.1
docs/man/man1/kubeadm-alpha-phase-bootstrap-token-node.1
docs/man/man1/kubeadm-alpha-phase-bootstrap-token.1
docs/man/man1/kubeadm-alpha-phase-mark-master.1
docs/man/man1/kubeadm-alpha-phase-mark-master.1
docs/man/man1/kubeadm-alpha-phase-selfhosting-convert-from-staticpods.1
docs/man/man1/kubeadm-alpha-phase-selfhosting-convert-from-staticpods.1
docs/man/man1/kubeadm-alpha-phase-selfhosting.1
docs/man/man1/kubeadm-alpha-phase-selfhosting.1
...
@@ -151,6 +138,7 @@ docs/man/man1/kubeadm-config-upload-from-flags.1
...
@@ -151,6 +138,7 @@ docs/man/man1/kubeadm-config-upload-from-flags.1
docs/man/man1/kubeadm-config-upload.1
docs/man/man1/kubeadm-config-upload.1
docs/man/man1/kubeadm-config-view.1
docs/man/man1/kubeadm-config-view.1
docs/man/man1/kubeadm-config.1
docs/man/man1/kubeadm-config.1
docs/man/man1/kubeadm-init-phase-bootstrap-token.1
docs/man/man1/kubeadm-init-phase-certs-apiserver-etcd-client.1
docs/man/man1/kubeadm-init-phase-certs-apiserver-etcd-client.1
docs/man/man1/kubeadm-init-phase-certs-apiserver-kubelet-client.1
docs/man/man1/kubeadm-init-phase-certs-apiserver-kubelet-client.1
docs/man/man1/kubeadm-init-phase-certs-apiserver.1
docs/man/man1/kubeadm-init-phase-certs-apiserver.1
...
...
docs/admin/kubeadm_alpha_phase_bootstrap-token_cluster-info.md
deleted
100644 → 0
View file @
e4c5d451
This file is autogenerated, but we've stopped checking such files into the
repository to reduce the need for rebases. Please run hack/generate-docs.sh to
populate this file.
docs/admin/kubeadm_alpha_phase_bootstrap-token_create.md
deleted
100644 → 0
View file @
e4c5d451
This file is autogenerated, but we've stopped checking such files into the
repository to reduce the need for rebases. Please run hack/generate-docs.sh to
populate this file.
docs/admin/kubeadm_alpha_phase_bootstrap-token_node.md
deleted
100644 → 0
View file @
e4c5d451
This file is autogenerated, but we've stopped checking such files into the
repository to reduce the need for rebases. Please run hack/generate-docs.sh to
populate this file.
docs/admin/kubeadm_alpha_phase_bootstrap-token_node_allow-auto-approve.md
deleted
100644 → 0
View file @
e4c5d451
This file is autogenerated, but we've stopped checking such files into the
repository to reduce the need for rebases. Please run hack/generate-docs.sh to
populate this file.
docs/admin/kubeadm_alpha_phase_bootstrap-token_node_allow-post-csrs.md
deleted
100644 → 0
View file @
e4c5d451
This file is autogenerated, but we've stopped checking such files into the
repository to reduce the need for rebases. Please run hack/generate-docs.sh to
populate this file.
docs/admin/kubeadm_
alpha
_phase_bootstrap-token.md
→
docs/admin/kubeadm_
init
_phase_bootstrap-token.md
View file @
e743f0e4
File moved
docs/man/man1/kubeadm-alpha-phase-bootstrap-token-all.1
deleted
100644 → 0
View file @
e4c5d451
This file is autogenerated, but we've stopped checking such files into the
repository to reduce the need for rebases. Please run hack/generate-docs.sh to
populate this file.
docs/man/man1/kubeadm-alpha-phase-bootstrap-token-cluster-info.1
deleted
100644 → 0
View file @
e4c5d451
This file is autogenerated, but we've stopped checking such files into the
repository to reduce the need for rebases. Please run hack/generate-docs.sh to
populate this file.
docs/man/man1/kubeadm-alpha-phase-bootstrap-token-create.1
deleted
100644 → 0
View file @
e4c5d451
This file is autogenerated, but we've stopped checking such files into the
repository to reduce the need for rebases. Please run hack/generate-docs.sh to
populate this file.
docs/man/man1/kubeadm-alpha-phase-bootstrap-token-node-allow-auto-approve.1
deleted
100644 → 0
View file @
e4c5d451
This file is autogenerated, but we've stopped checking such files into the
repository to reduce the need for rebases. Please run hack/generate-docs.sh to
populate this file.
docs/man/man1/kubeadm-alpha-phase-bootstrap-token-node-allow-post-csrs.1
deleted
100644 → 0
View file @
e4c5d451
This file is autogenerated, but we've stopped checking such files into the
repository to reduce the need for rebases. Please run hack/generate-docs.sh to
populate this file.
docs/man/man1/kubeadm-alpha-phase-bootstrap-token-node.1
deleted
100644 → 0
View file @
e4c5d451
This file is autogenerated, but we've stopped checking such files into the
repository to reduce the need for rebases. Please run hack/generate-docs.sh to
populate this file.
docs/man/man1/kubeadm-alpha-phase-bootstrap-token.1
deleted
100644 → 0
View file @
e4c5d451
This file is autogenerated, but we've stopped checking such files into the
repository to reduce the need for rebases. Please run hack/generate-docs.sh to
populate this file.
docs/
admin/kubeadm_alpha_phase_bootstrap-token_all.md
→
docs/
man/man1/kubeadm-init-phase-bootstrap-token.1
View file @
e743f0e4
File moved
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment