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
bfd22a69
Commit
bfd22a69
authored
Jul 24, 2015
by
Mike Danese
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #10686 from mesosphere/kube-util
Move sourcing of provider-specific util.sh into kube-util.sh
parents
ae1c8e55
0229cb01
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
31 additions
and
24 deletions
+31
-24
upgrade.sh
cluster/gce/upgrade.sh
+1
-1
kube-down.sh
cluster/kube-down.sh
+1
-1
kube-push.sh
cluster/kube-push.sh
+1
-1
kube-up.sh
cluster/kube-up.sh
+1
-1
kube-util.sh
cluster/kube-util.sh
+25
-15
kubectl.sh
cluster/kubectl.sh
+1
-4
validate-cluster.sh
cluster/validate-cluster.sh
+1
-1
No files found.
cluster/gce/upgrade.sh
View file @
bfd22a69
...
...
@@ -29,7 +29,7 @@ fi
KUBE_ROOT
=
$(
dirname
"
${
BASH_SOURCE
}
"
)
/../..
source
"
${
KUBE_ROOT
}
/cluster/kube-env.sh"
source
"
${
KUBE_ROOT
}
/cluster/
${
KUBERNETES_PROVIDER
}
/
util.sh"
source
"
${
KUBE_ROOT
}
/cluster/
kube-
util.sh"
function
usage
()
{
echo
"!!! EXPERIMENTAL !!!"
...
...
cluster/kube-down.sh
View file @
bfd22a69
...
...
@@ -22,7 +22,7 @@ set -o pipefail
KUBE_ROOT
=
$(
dirname
"
${
BASH_SOURCE
}
"
)
/..
source
"
${
KUBE_ROOT
}
/cluster/kube-env.sh"
source
"
${
KUBE_ROOT
}
/cluster/
${
KUBERNETES_PROVIDER
}
/
util.sh"
source
"
${
KUBE_ROOT
}
/cluster/
kube-
util.sh"
echo
"Bringing down cluster using provider:
$KUBERNETES_PROVIDER
"
...
...
cluster/kube-push.sh
View file @
bfd22a69
...
...
@@ -25,7 +25,7 @@ set -o pipefail
KUBE_ROOT
=
$(
dirname
"
${
BASH_SOURCE
}
"
)
/..
source
"
${
KUBE_ROOT
}
/cluster/kube-env.sh"
source
"
${
KUBE_ROOT
}
/cluster/
${
KUBERNETES_PROVIDER
}
/
util.sh"
source
"
${
KUBE_ROOT
}
/cluster/
kube-
util.sh"
function
usage
()
{
echo
"
${
0
}
[-m|-n <node id>] <version>"
...
...
cluster/kube-up.sh
View file @
bfd22a69
...
...
@@ -26,7 +26,7 @@ set -o pipefail
KUBE_ROOT
=
$(
dirname
"
${
BASH_SOURCE
}
"
)
/..
source
"
${
KUBE_ROOT
}
/cluster/kube-env.sh"
source
"
${
KUBE_ROOT
}
/cluster/
${
KUBERNETES_PROVIDER
}
/
util.sh"
source
"
${
KUBE_ROOT
}
/cluster/
kube-
util.sh"
echo
"... Starting cluster using provider:
$KUBERNETES_PROVIDER
"
>
&2
...
...
cluster/kube-util.sh
View file @
bfd22a69
...
...
@@ -16,73 +16,83 @@
# A library of helper functions that each provider hosting Kubernetes must implement to use cluster/kube-*.sh scripts.
KUBE_ROOT
=
$(
dirname
"
${
BASH_SOURCE
}
"
)
/..
# Must ensure that the following ENV vars are set
function
detect-master
{
echo
"KUBE_MASTER_IP:
$KUBE_MASTER_IP
"
echo
"KUBE_MASTER:
$KUBE_MASTER
"
echo
"KUBE_MASTER_IP:
$KUBE_MASTER_IP
"
1>&2
echo
"KUBE_MASTER:
$KUBE_MASTER
"
1>&2
}
# Get minion names if they are not static.
function
detect-minion-names
{
echo
"MINION_NAMES:
${
MINION_NAMES
[*]
}
"
echo
"MINION_NAMES: [
${
MINION_NAMES
[*]
}
]"
1>&2
}
# Get minion IP addresses and store in KUBE_MINION_IP_ADDRESSES[]
function
detect-minions
{
echo
"KUBE_MINION_IP_ADDRESSES
=[]"
echo
"KUBE_MINION_IP_ADDRESSES
: [
${
KUBE_MINION_IP_ADDRESSES
[*]
}
]"
1>&2
}
# Verify prereqs on host machine
function
verify-prereqs
{
echo
"TODO
"
echo
"TODO
: verify-prereqs"
1>&2
}
# Instantiate a kubernetes cluster
function
kube-up
{
echo
"TODO
"
echo
"TODO
: kube-up"
1>&2
}
# Delete a kubernetes cluster
function
kube-down
{
echo
"TODO
"
echo
"TODO
: kube-down"
1>&2
}
# Update a kubernetes cluster
function
kube-push
{
echo
"TODO
"
echo
"TODO
: kube-push"
1>&2
}
# Prepare update a kubernetes component
function
prepare-push
{
echo
"TODO
"
echo
"TODO
: prepare-push"
1>&2
}
# Update a kubernetes master
function
push-master
{
echo
"TODO
"
echo
"TODO
: push-master"
1>&2
}
# Update a kubernetes node
function
push-node
{
echo
"TODO
"
echo
"TODO
: push-node"
1>&2
}
# Execute prior to running tests to build a release if required for env
function
test-build-release
{
echo
"TODO
"
echo
"TODO
: test-build-release"
1>&2
}
# Execute prior to running tests to initialize required structure
function
test-setup
{
echo
"TODO
"
echo
"TODO
: test-setup"
1>&2
}
# Execute after running tests to perform any required clean-up
function
test-teardown
{
echo
"TODO
"
echo
"TODO
: test-teardown"
1>&2
}
# Set the {KUBE_USER} and {KUBE_PASSWORD} environment values required to interact with provider
function
get-password
{
echo
"TODO
"
echo
"TODO
: get-password"
1>&2
}
# Providers util.sh scripts should define functions that override the above default functions impls
if
[
-n
"
${
KUBERNETES_PROVIDER
}
"
]
;
then
PROVIDER_UTILS
=
"
${
KUBE_ROOT
}
/cluster/
${
KUBERNETES_PROVIDER
}
/util.sh"
if
[
-f
${
PROVIDER_UTILS
}
]
;
then
source
"
${
PROVIDER_UTILS
}
"
fi
fi
cluster/kubectl.sh
View file @
bfd22a69
...
...
@@ -32,10 +32,7 @@ set -o pipefail
KUBE_ROOT
=
$(
dirname
"
${
BASH_SOURCE
}
"
)
/..
source
"
${
KUBE_ROOT
}
/cluster/kube-env.sh"
UTILS
=
${
KUBE_ROOT
}
/cluster/
${
KUBERNETES_PROVIDER
}
/util.sh
if
[
-f
${
UTILS
}
]
;
then
source
"
${
UTILS
}
"
fi
source
"
${
KUBE_ROOT
}
/cluster/kube-util.sh"
# Get the absolute path of the directory component of a file, i.e. the
# absolute path of the dirname of $1.
...
...
cluster/validate-cluster.sh
View file @
bfd22a69
...
...
@@ -22,7 +22,7 @@ set -o pipefail
KUBE_ROOT
=
$(
dirname
"
${
BASH_SOURCE
}
"
)
/..
source
"
${
KUBE_ROOT
}
/cluster/kube-env.sh"
source
"
${
KUBE_ROOT
}
/cluster/
${
KUBERNETES_PROVIDER
}
/
util.sh"
source
"
${
KUBE_ROOT
}
/cluster/
kube-
util.sh"
MINIONS_FILE
=
/tmp/minions-
$$
trap
'rm -rf "${MINIONS_FILE}"'
EXIT
...
...
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