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
58cc06c4
Commit
58cc06c4
authored
Mar 31, 2016
by
Alex Robinson
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #23678 from gmarek/kubemark
Kubemark uses kubectl from the repo
parents
c2a59982
9120a607
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
13 deletions
+10
-13
common.sh
test/kubemark/common.sh
+2
-0
start-kubemark.sh
test/kubemark/start-kubemark.sh
+6
-11
stop-kubemark.sh
test/kubemark/stop-kubemark.sh
+2
-2
No files found.
test/kubemark/common.sh
View file @
58cc06c4
...
@@ -27,6 +27,8 @@ EVENT_STORE_NAME="${INSTANCE_PREFIX}-event-store"
...
@@ -27,6 +27,8 @@ EVENT_STORE_NAME="${INSTANCE_PREFIX}-event-store"
RETRIES
=
3
RETRIES
=
3
export
KUBECTL
=
"
${
KUBE_ROOT
}
/cluster/kubectl.sh"
# Runs gcloud compute command with the given parameters. Up to $RETRIES will be made
# Runs gcloud compute command with the given parameters. Up to $RETRIES will be made
# to execute the command.
# to execute the command.
# arguments:
# arguments:
...
...
test/kubemark/start-kubemark.sh
View file @
58cc06c4
...
@@ -18,11 +18,6 @@
...
@@ -18,11 +18,6 @@
KUBE_ROOT
=
$(
dirname
"
${
BASH_SOURCE
}
"
)
/../..
KUBE_ROOT
=
$(
dirname
"
${
BASH_SOURCE
}
"
)
/../..
if
!
command
-v
kubectl
>
/dev/null 2>&1
;
then
echo
"Please install kubectl before running this script"
exit
1
fi
source
"
${
KUBE_ROOT
}
/test/kubemark/common.sh"
source
"
${
KUBE_ROOT
}
/test/kubemark/common.sh"
RUN_FROM_DISTRO
=
${
RUN_FROM_DISTRO
:-
false
}
RUN_FROM_DISTRO
=
${
RUN_FROM_DISTRO
:-
false
}
...
@@ -209,15 +204,15 @@ EOF
...
@@ -209,15 +204,15 @@ EOF
sed
"s/##numreplicas##/
${
NUM_NODES
:-
10
}
/g"
"
${
KUBE_ROOT
}
"
/test/kubemark/hollow-node_template.json
>
"
${
KUBE_ROOT
}
"
/test/kubemark/hollow-node.json
sed
"s/##numreplicas##/
${
NUM_NODES
:-
10
}
/g"
"
${
KUBE_ROOT
}
"
/test/kubemark/hollow-node_template.json
>
"
${
KUBE_ROOT
}
"
/test/kubemark/hollow-node.json
sed
-i
''
-e
"s/##project##/
${
PROJECT
}
/g"
"
${
KUBE_ROOT
}
"
/test/kubemark/hollow-node.json
sed
-i
''
-e
"s/##project##/
${
PROJECT
}
/g"
"
${
KUBE_ROOT
}
"
/test/kubemark/hollow-node.json
kubectl
create
-f
"
${
KUBE_ROOT
}
"
/test/kubemark/kubemark-ns.json
"
${
KUBECTL
}
"
create
-f
"
${
KUBE_ROOT
}
"
/test/kubemark/kubemark-ns.json
kubectl
create
-f
"
${
KUBECONFIG_SECRET
}
"
--namespace
=
"kubemark"
"
${
KUBECTL
}
"
create
-f
"
${
KUBECONFIG_SECRET
}
"
--namespace
=
"kubemark"
kubectl
create
-f
"
${
KUBE_ROOT
}
"
/test/kubemark/hollow-node.json
--namespace
=
"kubemark"
"
${
KUBECTL
}
"
create
-f
"
${
KUBE_ROOT
}
"
/test/kubemark/hollow-node.json
--namespace
=
"kubemark"
rm
"
${
KUBECONFIG_SECRET
}
"
rm
"
${
KUBECONFIG_SECRET
}
"
echo
"Waiting for all HollowNodes to become Running..."
echo
"Waiting for all HollowNodes to become Running..."
start
=
$(
date
+%s
)
start
=
$(
date
+%s
)
nodes
=
$(
kubectl
--kubeconfig
=
"
${
KUBE_ROOT
}
"
/test/kubemark/kubeconfig.loc get node
)
||
true
nodes
=
$(
"
${
KUBECTL
}
"
--kubeconfig
=
"
${
KUBE_ROOT
}
"
/test/kubemark/kubeconfig.loc get node
)
||
true
ready
=
$(($(
echo
"
${
nodes
}
"
|
grep
-v
"NotReady"
|
wc
-l
)
-
1
))
ready
=
$(($(
echo
"
${
nodes
}
"
|
grep
-v
"NotReady"
|
wc
-l
)
-
1
))
until
[[
"
${
ready
}
"
-ge
"
${
NUM_NODES
}
"
]]
;
do
until
[[
"
${
ready
}
"
-ge
"
${
NUM_NODES
}
"
]]
;
do
...
@@ -229,14 +224,14 @@ until [[ "${ready}" -ge "${NUM_NODES}" ]]; do
...
@@ -229,14 +224,14 @@ until [[ "${ready}" -ge "${NUM_NODES}" ]]; do
echo
""
echo
""
echo
"Timeout waiting for all HollowNodes to become Running"
echo
"Timeout waiting for all HollowNodes to become Running"
# Try listing nodes again - if it fails it means that API server is not responding
# Try listing nodes again - if it fails it means that API server is not responding
if
kubectl
--kubeconfig
=
"
${
KUBE_ROOT
}
"
/test/kubemark/kubeconfig.loc get node &> /dev/null
;
then
if
"
${
KUBECTL
}
"
--kubeconfig
=
"
${
KUBE_ROOT
}
"
/test/kubemark/kubeconfig.loc get node &> /dev/null
;
then
echo
"Found only
${
ready
}
ready Nodes while waiting for
${
NUM_NODES
}
."
echo
"Found only
${
ready
}
ready Nodes while waiting for
${
NUM_NODES
}
."
exit
1
exit
1
fi
fi
echo
"Got error while trying to list Nodes. Probably API server is down."
echo
"Got error while trying to list Nodes. Probably API server is down."
exit
1
exit
1
fi
fi
nodes
=
$(
kubectl
--kubeconfig
=
"
${
KUBE_ROOT
}
"
/test/kubemark/kubeconfig.loc get node
)
||
true
nodes
=
$(
"
${
KUBECTL
}
"
--kubeconfig
=
"
${
KUBE_ROOT
}
"
/test/kubemark/kubeconfig.loc get node
)
||
true
ready
=
$(($(
echo
"
${
nodes
}
"
|
grep
-v
"NotReady"
|
wc
-l
)
-
1
))
ready
=
$(($(
echo
"
${
nodes
}
"
|
grep
-v
"NotReady"
|
wc
-l
)
-
1
))
done
done
...
...
test/kubemark/stop-kubemark.sh
View file @
58cc06c4
...
@@ -19,8 +19,8 @@ KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
...
@@ -19,8 +19,8 @@ KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
source
"
${
KUBE_ROOT
}
/test/kubemark/common.sh"
source
"
${
KUBE_ROOT
}
/test/kubemark/common.sh"
kubectl
delete
-f
${
KUBE_ROOT
}
/test/kubemark/hollow-kubelet.json &> /dev/null
||
true
"
${
KUBECTL
}
"
delete
-f
${
KUBE_ROOT
}
/test/kubemark/hollow-kubelet.json &> /dev/null
||
true
kubectl
delete
-f
${
KUBE_ROOT
}
/test/kubemark/kubemark-ns.json &> /dev/null
||
true
"
${
KUBECTL
}
"
delete
-f
${
KUBE_ROOT
}
/test/kubemark/kubemark-ns.json &> /dev/null
||
true
GCLOUD_COMMON_ARGS
=
"--project
${
PROJECT
}
--zone
${
ZONE
}
--quiet"
GCLOUD_COMMON_ARGS
=
"--project
${
PROJECT
}
--zone
${
ZONE
}
--quiet"
...
...
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