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
02031929
Unverified
Commit
02031929
authored
May 17, 2019
by
Kubernetes Prow Robot
Committed by
GitHub
May 17, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #78044 from dekkagaijin/patch-6
Consolidate logic to ensure kubectl auth
parents
3db67158
9bc3c2af
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
10 deletions
+11
-10
configure-helper.sh
cluster/gce/gci/configure-helper.sh
+11
-10
No files found.
cluster/gce/gci/configure-helper.sh
View file @
02031929
...
...
@@ -588,7 +588,7 @@ function create-master-auth {
append_or_replace_prefixed_line
"
${
known_tokens_csv
}
"
"
${
KUBE_BEARER_TOKEN
}
,"
"admin,admin,system:masters"
fi
if
[[
-n
"
${
KUBE_BOOTSTRAP_TOKEN
:-}
"
]]
;
then
append_or_replace_prefixed_line
"
${
known_tokens_csv
}
"
"
${
KUBE_BOOTSTRAP_TOKEN
}
,"
"
system:cluster-bootstrap,uid:system:cluster
-bootstrap,system:masters"
append_or_replace_prefixed_line
"
${
known_tokens_csv
}
"
"
${
KUBE_BOOTSTRAP_TOKEN
}
,"
"
gcp:kube-bootstrap,uid:gcp:kube
-bootstrap,system:masters"
fi
if
[[
-n
"
${
KUBE_CONTROLLER_MANAGER_TOKEN
:-}
"
]]
;
then
append_or_replace_prefixed_line
"
${
known_tokens_csv
}
"
"
${
KUBE_CONTROLLER_MANAGER_TOKEN
}
,"
"system:kube-controller-manager,uid:system:kube-controller-manager"
...
...
@@ -1506,7 +1506,7 @@ function compute-master-manifest-variables {
INSECURE_PORT_MAPPING
=
""
if
[[
"
${
ENABLE_APISERVER_INSECURE_PORT
:-
false
}
"
==
"true"
]]
;
then
INSECURE_PORT_MAPPING
=
"{
\"
name
\"
:
\"
local
\"
,
\"
containerPort
\"
: 8080,
\"
hostPort
\"
: 8080},"
fi
fi
}
# A helper function that bind mounts kubelet dirs for running mount in a chroot
...
...
@@ -2846,11 +2846,12 @@ function wait-till-apiserver-ready() {
done
}
function
ensure-bootstrap-kubectl-auth
{
# Creating an authenticated kubeconfig is only necessary if the insecure port is disabled.
function
ensure-master-bootstrap-kubectl-auth
{
# By default, `kubectl` uses http://localhost:8080
# If the insecure port is disabled, kubectl will need to use an admin-authenticated kubeconfig.
if
[[
-n
"
${
KUBE_BOOTSTRAP_TOKEN
:-}
"
]]
;
then
create-kubeconfig
"
cluster-bootstrap"
${
KUBE_BOOTSTRAP_TOKEN
}
export
KUBECONFIG
=
/etc/srv/kubernetes/
cluster
-bootstrap/kubeconfig
create-kubeconfig
"
kube-bootstrap"
"
${
KUBE_BOOTSTRAP_TOKEN
}
"
export
KUBECONFIG
=
/etc/srv/kubernetes/
kube
-bootstrap/kubeconfig
fi
}
...
...
@@ -2971,13 +2972,13 @@ function main() {
KUBE_CONTROLLER_MANAGER_TOKEN
=
"
$(
secure_random 32
)
"
KUBE_SCHEDULER_TOKEN
=
"
$(
secure_random 32
)
"
KUBE_CLUSTER_AUTOSCALER_TOKEN
=
"
$(
secure_random 32
)
"
if
[[
"
${
ENABLE_APISERVER_INSECURE_PORT
:-
false
}
"
!=
"true"
]]
;
then
KUBE_BOOTSTRAP_TOKEN
=
"
$(
secure_random 32
)
"
fi
if
[[
"
${
ENABLE_L7_LOADBALANCING
:-}
"
==
"glbc"
]]
;
then
GCE_GLBC_TOKEN
=
"
$(
secure_random 32
)
"
fi
ADDON_MANAGER_TOKEN
=
"
$(
secure_random 32
)
"
if
[[
"
${
ENABLE_APISERVER_INSECURE_PORT
:-
false
}
"
!=
"true"
]]
;
then
KUBE_BOOTSTRAP_TOKEN
=
"
$(
secure_random 32
)
"
fi
setup-os-params
config-ip-firewall
...
...
@@ -2990,7 +2991,7 @@ function main() {
create-node-pki
create-master-pki
create-master-auth
ensure-bootstrap-kubectl-auth
ensure-
master-
bootstrap-kubectl-auth
create-master-kubelet-auth
create-master-etcd-auth
create-master-etcd-apiserver-auth
...
...
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