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
509c3f5b
Commit
509c3f5b
authored
Jun 18, 2015
by
wizard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hot fix for ubuntu k8s
parent
47436683
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 @
509c3f5b
...
@@ -17,8 +17,6 @@
...
@@ -17,8 +17,6 @@
# A library of helper functions that each provider hosting Kubernetes must implement to use cluster/kube-*.sh scripts.
# A library of helper functions that each provider hosting Kubernetes must implement to use cluster/kube-*.sh scripts.
set
-e
set
-e
source
"
${
KUBE_ROOT
}
/cluster/common.sh"
SSH_OPTS
=
"-oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null -oLogLevel=ERROR"
SSH_OPTS
=
"-oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null -oLogLevel=ERROR"
# use an array to record name and ip
# use an array to record name and ip
...
@@ -254,23 +252,11 @@ EOF
...
@@ -254,23 +252,11 @@ EOF
# KUBE_USER
# KUBE_USER
# KUBE_PASSWORD
# KUBE_PASSWORD
function
get-password
{
function
get-password
{
local
file
=
"
$HOME
/.kubernetes_auth"
get-kubeconfig-basicauth
if
[[
-r
"
$file
"
]]
;
then
if
[[
-z
"
${
KUBE_USER
}
"
||
-z
"
${
KUBE_PASSWORD
}
"
]]
;
then
KUBE_USER
=
$(
cat
"
$file
"
| python
-c
'import json,sys;print json.load(sys.stdin)["User"]'
)
KUBE_USER
=
admin
KUBE_PASSWORD
=
$(
cat
"
$file
"
| python
-c
'import json,sys;print json.load(sys.stdin)["Password"]'
)
KUBE_PASSWORD
=
$(
python
-c
'import string,random; print "".join(random.SystemRandom().choice(string.ascii_letters + string.digits) for _ in range(16))'
)
return
fi
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
# Detect the IP for the master
...
@@ -353,8 +339,14 @@ function kube-up {
...
@@ -353,8 +339,14 @@ function kube-up {
verify-cluster
verify-cluster
detect-master
detect-master
export
KUBE_MASTER_IP
=
"
${
KUBE_MASTER_IP
}
:8080"
export
CONTEXT
=
"ubuntu"
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
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