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
973b417a
Commit
973b417a
authored
Oct 17, 2016
by
Euan Kemp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
local-up: Add option to guess binary path
parent
f85d8f2e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
5 deletions
+25
-5
running-locally.md
docs/devel/running-locally.md
+6
-0
local-up-cluster.sh
hack/local-up-cluster.sh
+19
-5
No files found.
docs/devel/running-locally.md
View file @
973b417a
...
...
@@ -102,6 +102,12 @@ hack/local-up-cluster.sh
This will build and start a lightweight local cluster, consisting of a master
and a single node. Type Control-C to shut it down.
If you've already compiled the Kubernetes components, then you can avoid rebuilding them with this script by using the `-O` flag.
```
sh
./hack/local-up-cluster.sh -O
```
You can use the cluster/kubectl.sh script to interact with the local cluster. hack/local-up-cluster.sh will
print the commands to run to point kubectl at the local cluster.
...
...
hack/local-up-cluster.sh
View file @
973b417a
...
...
@@ -71,21 +71,35 @@ source "${KUBE_ROOT}/hack/lib/init.sh"
function
usage
{
echo
"This script starts a local kube cluster. "
echo
"Example 1: hack/local-up-cluster.sh -o _output/dockerized/bin/linux/amd64/ (run from docker output)"
echo
"Example 2: hack/local-up-cluster.sh (build a local copy of the source)"
echo
"Example 2: hack/local-up-cluster.sh -O (auto-guess the bin path for your platform)"
echo
"Example 3: hack/local-up-cluster.sh (build a local copy of the source)"
}
# This function guesses where the existing cached binary build is for the `-O`
# flag
function
guess_built_binary_path
{
local
hyperkube_path
=
$(
kube::util::find-binary
"hyperkube"
)
if
[[
-z
"
${
hyperkube_path
}
"
]]
;
then
return
fi
echo
-n
"
$(
dirname
"
${
hyperkube_path
}
"
)
"
}
### Allow user to supply the source directory.
GO_OUT
=
""
while
getopts
"o:"
OPTION
while
getopts
"o:
O
"
OPTION
do
case
$OPTION
in
o
)
echo
"skipping build"
echo
"using source
$OPTARG
"
GO_OUT
=
"
$OPTARG
"
echo
"using source
$GO_OUT
"
;;
O
)
GO_OUT
=
$(
guess_built_binary_path
)
if
[
$GO_OUT
==
""
]
;
then
echo
"
You provided an invalid value for the build output directory
."
exit
echo
"
Could not guess the correct output directory to use
."
exit
1
fi
;;
?
)
...
...
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