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
087b6e32
Commit
087b6e32
authored
Jun 18, 2015
by
Satnam Singh
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #10005 from ZJU-SEL/Fix9237
Hot fix for ubuntu k8s
parents
847d7711
509c3f5b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
19 deletions
+11
-19
util.sh
cluster/ubuntu/util.sh
+11
-19
No files found.
cluster/ubuntu/util.sh
View file @
087b6e32
...
...
@@ -17,8 +17,6 @@
# A library of helper functions that each provider hosting Kubernetes must implement to use cluster/kube-*.sh scripts.
set
-e
source
"
${
KUBE_ROOT
}
/cluster/common.sh"
SSH_OPTS
=
"-oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null -oLogLevel=ERROR"
# use an array to record name and ip
...
...
@@ -254,23 +252,11 @@ EOF
# KUBE_USER
# KUBE_PASSWORD
function
get-password
{
local
file
=
"
$HOME
/.kubernetes_auth"
if
[[
-r
"
$file
"
]]
;
then
KUBE_USER
=
$(
cat
"
$file
"
| python
-c
'import json,sys;print json.load(sys.stdin)["User"]'
)
KUBE_PASSWORD
=
$(
cat
"
$file
"
| python
-c
'import json,sys;print json.load(sys.stdin)["Password"]'
)
return
get-kubeconfig-basicauth
if
[[
-z
"
${
KUBE_USER
}
"
||
-z
"
${
KUBE_PASSWORD
}
"
]]
;
then
KUBE_USER
=
admin
KUBE_PASSWORD
=
$(
python
-c
'import string,random; print "".join(random.SystemRandom().choice(string.ascii_letters + string.digits) for _ in range(16))'
)
fi
KUBE_USER
=
admin
KUBE_PASSWORD
=
$(
python
-c
'import string,random; print "".join(random.SystemRandom().choice(string.ascii_letters + string.digits) for _ in range(16))'
)
# Store password for reuse.
cat
<<
EOF
> "
$file
"
{
"User": "
$KUBE_USER
",
"Password": "
$KUBE_PASSWORD
"
}
EOF
chmod
0600
"
$file
"
}
# Detect the IP for the master
...
...
@@ -353,8 +339,14 @@ function kube-up {
verify-cluster
detect-master
export
KUBE_MASTER_IP
=
"
${
KUBE_MASTER_IP
}
:8080"
export
CONTEXT
=
"ubuntu"
export
KUBE_SERVER
=
"http://
${
KUBE_MASTER_IP
}
:8080"
source
"
${
KUBE_ROOT
}
/cluster/common.sh"
# set kubernetes user and password
get-password
create-kubeconfig
}
...
...
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