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
d94bb267
Unverified
Commit
d94bb267
authored
Jan 13, 2017
by
Jordan Liggitt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Conditionally write token file entries
parent
3fa44312
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
8 deletions
+24
-8
configure-helper.sh
cluster/gce/container-linux/configure-helper.sh
+12
-4
configure-helper.sh
cluster/gce/gci/configure-helper.sh
+12
-4
No files found.
cluster/gce/container-linux/configure-helper.sh
View file @
d94bb267
...
@@ -157,10 +157,18 @@ function create-master-auth {
...
@@ -157,10 +157,18 @@ function create-master-auth {
replace_prefixed_line
"
${
basic_auth_csv
}
"
"
${
KUBE_PASSWORD
}
,
${
KUBE_USER
}
,"
"admin,system:masters"
replace_prefixed_line
"
${
basic_auth_csv
}
"
"
${
KUBE_PASSWORD
}
,
${
KUBE_USER
}
,"
"admin,system:masters"
fi
fi
local
-r
known_tokens_csv
=
"
${
auth_dir
}
/known_tokens.csv"
local
-r
known_tokens_csv
=
"
${
auth_dir
}
/known_tokens.csv"
replace_prefixed_line
"
${
known_tokens_csv
}
"
"
${
KUBE_BEARER_TOKEN
}
"
"admin,admin,system:masters"
if
[[
-n
"
${
KUBE_BEARER_TOKEN
:-}
"
]]
;
then
replace_prefixed_line
"
${
known_tokens_csv
}
"
"
${
KUBE_CONTROLLER_MANAGER_TOKEN
}
"
"system:kube-controller-manager,uid:system:kube-controller-manager"
replace_prefixed_line
"
${
known_tokens_csv
}
"
"
${
KUBE_BEARER_TOKEN
}
,"
"admin,admin,system:masters"
replace_prefixed_line
"
${
known_tokens_csv
}
"
"
${
KUBELET_TOKEN
}
"
"system:node:node-name,uid:kubelet,system:nodes"
fi
replace_prefixed_line
"
${
known_tokens_csv
}
"
"
${
KUBE_PROXY_TOKEN
}
"
"system:kube-proxy,uid:kube_proxy"
if
[[
-n
"
${
KUBE_CONTROLLER_MANAGER_TOKEN
:-}
"
]]
;
then
replace_prefixed_line
"
${
known_tokens_csv
}
"
"
${
KUBE_CONTROLLER_MANAGER_TOKEN
}
,"
"system:kube-controller-manager,uid:system:kube-controller-manager"
fi
if
[[
-n
"
${
KUBELET_TOKEN
:-}
"
]]
;
then
replace_prefixed_line
"
${
known_tokens_csv
}
"
"
${
KUBELET_TOKEN
}
,"
"system:node:node-name,uid:kubelet,system:nodes"
fi
if
[[
-n
"
${
KUBE_PROXY_TOKEN
:-}
"
]]
;
then
replace_prefixed_line
"
${
known_tokens_csv
}
"
"
${
KUBE_PROXY_TOKEN
}
,"
"system:kube-proxy,uid:kube_proxy"
fi
local
use_cloud_config
=
"false"
local
use_cloud_config
=
"false"
cat
<<
EOF
>/etc/gce.conf
cat
<<
EOF
>/etc/gce.conf
[global]
[global]
...
...
cluster/gce/gci/configure-helper.sh
View file @
d94bb267
...
@@ -224,10 +224,18 @@ function create-master-auth {
...
@@ -224,10 +224,18 @@ function create-master-auth {
replace_prefixed_line
"
${
basic_auth_csv
}
"
"
${
KUBE_PASSWORD
}
,
${
KUBE_USER
}
,"
"admin,system:masters"
replace_prefixed_line
"
${
basic_auth_csv
}
"
"
${
KUBE_PASSWORD
}
,
${
KUBE_USER
}
,"
"admin,system:masters"
fi
fi
local
-r
known_tokens_csv
=
"
${
auth_dir
}
/known_tokens.csv"
local
-r
known_tokens_csv
=
"
${
auth_dir
}
/known_tokens.csv"
replace_prefixed_line
"
${
known_tokens_csv
}
"
"
${
KUBE_BEARER_TOKEN
}
,"
"admin,admin,system:masters"
if
[[
-n
"
${
KUBE_BEARER_TOKEN
:-}
"
]]
;
then
replace_prefixed_line
"
${
known_tokens_csv
}
"
"
${
KUBE_CONTROLLER_MANAGER_TOKEN
}
,"
"system:kube-controller-manager,uid:system:kube-controller-manager"
replace_prefixed_line
"
${
known_tokens_csv
}
"
"
${
KUBE_BEARER_TOKEN
}
,"
"admin,admin,system:masters"
replace_prefixed_line
"
${
known_tokens_csv
}
"
"
${
KUBELET_TOKEN
}
,"
"system:node:node-name,uid:kubelet,system:nodes"
fi
replace_prefixed_line
"
${
known_tokens_csv
}
"
"
${
KUBE_PROXY_TOKEN
}
,"
"system:kube-proxy,uid:kube_proxy"
if
[[
-n
"
${
KUBE_CONTROLLER_MANAGER_TOKEN
:-}
"
]]
;
then
replace_prefixed_line
"
${
known_tokens_csv
}
"
"
${
KUBE_CONTROLLER_MANAGER_TOKEN
}
,"
"system:kube-controller-manager,uid:system:kube-controller-manager"
fi
if
[[
-n
"
${
KUBELET_TOKEN
:-}
"
]]
;
then
replace_prefixed_line
"
${
known_tokens_csv
}
"
"
${
KUBELET_TOKEN
}
,"
"system:node:node-name,uid:kubelet,system:nodes"
fi
if
[[
-n
"
${
KUBE_PROXY_TOKEN
:-}
"
]]
;
then
replace_prefixed_line
"
${
known_tokens_csv
}
"
"
${
KUBE_PROXY_TOKEN
}
,"
"system:kube-proxy,uid:kube_proxy"
fi
local
use_cloud_config
=
"false"
local
use_cloud_config
=
"false"
cat
<<
EOF
>/etc/gce.conf
cat
<<
EOF
>/etc/gce.conf
[global]
[global]
...
...
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