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
c9988db0
Commit
c9988db0
authored
Apr 22, 2015
by
Zach Loafman
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7146 from brendandburns/get-k8s
Extend the get-cluster.sh script to use sudo if necessary.
parents
8b04e7f7
42121d18
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
5 deletions
+20
-5
util.sh
cluster/gce/util.sh
+10
-2
util.sh
cluster/gke/util.sh
+10
-3
No files found.
cluster/gce/util.sh
View file @
c9988db0
...
@@ -25,6 +25,7 @@ source "${KUBE_ROOT}/cluster/common.sh"
...
@@ -25,6 +25,7 @@ source "${KUBE_ROOT}/cluster/common.sh"
NODE_INSTANCE_PREFIX
=
"
${
INSTANCE_PREFIX
}
-minion"
NODE_INSTANCE_PREFIX
=
"
${
INSTANCE_PREFIX
}
-minion"
KUBE_PROMPT_FOR_UPDATE
=
y
KUBE_PROMPT_FOR_UPDATE
=
y
KUBE_SKIP_UPDATE
=
${
KUBE_SKIP_UPDATE
-
"n"
}
# Verify prereqs
# Verify prereqs
function
verify-prereqs
{
function
verify-prereqs
{
...
@@ -48,12 +49,19 @@ function verify-prereqs {
...
@@ -48,12 +49,19 @@ function verify-prereqs {
fi
fi
fi
fi
done
done
if
[[
"
${
KUBE_SKIP_UPDATE
}
== "
y
" ]]; then
return
fi
# update and install components as needed
# update and install components as needed
if [[ "
${
KUBE_PROMPT_FOR_UPDATE
}
" != "
y
" ]]; then
if [[ "
${
KUBE_PROMPT_FOR_UPDATE
}
" != "
y
" ]]; then
gcloud_prompt="
-q
"
gcloud_prompt="
-q
"
fi
fi
gcloud
${
gcloud_prompt
:-}
components update preview
||
true
if [ ! -w
$(
dirname
`
which gcloud
`
)
]; then
gcloud
${
gcloud_prompt
:-}
components update
||
true
sudo_prefix="
sudo
"
fi
${
sudo_prefix
}
gcloud
${
gcloud_prompt
:-}
components update preview || true
${
sudo_prefix
}
gcloud
${
gcloud_prompt
:-}
components update alpha || true
${
sudo_prefix
}
gcloud
${
gcloud_prompt
:-}
components update || true
}
}
# Create a temp dir that'll be deleted at the end of this bash session.
# Create a temp dir that'll be deleted at the end of this bash session.
...
...
cluster/gke/util.sh
View file @
c9988db0
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
# config-default.sh.
# config-default.sh.
KUBE_PROMPT_FOR_UPDATE
=
y
KUBE_PROMPT_FOR_UPDATE
=
y
KUBE_SKIP_UPDATE
=
${
KUBE_SKIP_UPDATE
-
"n"
}
KUBE_ROOT
=
$(
dirname
"
${
BASH_SOURCE
}
"
)
/../..
KUBE_ROOT
=
$(
dirname
"
${
BASH_SOURCE
}
"
)
/../..
source
"
${
KUBE_ROOT
}
/cluster/gke/
${
KUBE_CONFIG_FILE
:-
config
-default.sh
}
"
source
"
${
KUBE_ROOT
}
/cluster/gke/
${
KUBE_CONFIG_FILE
:-
config
-default.sh
}
"
...
@@ -86,13 +87,19 @@ function verify-prereqs() {
...
@@ -86,13 +87,19 @@ function verify-prereqs() {
exit
1
exit
1
fi
fi
fi
fi
if
[[
"
${
KUBE_SKIP_UPDATE
}
== "
y
" ]]; then
return
fi
# update and install components as needed
# update and install components as needed
if [[ "
${
KUBE_PROMPT_FOR_UPDATE
}
" != "
y
" ]]; then
if [[ "
${
KUBE_PROMPT_FOR_UPDATE
}
" != "
y
" ]]; then
gcloud_prompt="
-q
"
gcloud_prompt="
-q
"
fi
fi
gcloud
${
gcloud_prompt
:-}
components update preview
||
true
if [ ! -w
$(
dirname
`
which gcloud
`
)
]; then
gcloud
${
gcloud_prompt
:-}
components update alpha
||
true
sudo_prefix="
sudo
"
gcloud
${
gcloud_prompt
:-}
components update
||
true
fi
${
sudo_prefix
}
gcloud
${
gcloud_prompt
:-}
components update preview || true
${
sudo_prefix
}
gcloud
${
gcloud_prompt
:-}
components update alpha|| true
${
sudo_prefix
}
gcloud
${
gcloud_prompt
:-}
components update || true
}
}
# Instantiate a kubernetes cluster
# Instantiate a kubernetes cluster
...
...
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