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
b8aae458
Unverified
Commit
b8aae458
authored
Feb 04, 2019
by
Bob Killen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix shellcheck lint errors in test/kubemark/start-kubemark.sh
parent
46333a01
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
9 deletions
+11
-9
.shellcheck_failures
hack/.shellcheck_failures
+0
-1
start-kubemark.sh
test/kubemark/start-kubemark.sh
+11
-8
No files found.
hack/.shellcheck_failures
View file @
b8aae458
...
@@ -145,7 +145,6 @@
...
@@ -145,7 +145,6 @@
./test/images/volume/rbd/create_block.sh
./test/images/volume/rbd/create_block.sh
./test/images/volume/rbd/mon.sh
./test/images/volume/rbd/mon.sh
./test/images/volume/rbd/osd.sh
./test/images/volume/rbd/osd.sh
./test/kubemark/start-kubemark.sh
./test/kubemark/stop-kubemark.sh
./test/kubemark/stop-kubemark.sh
./third_party/forked/shell2junit/sh2ju.sh
./third_party/forked/shell2junit/sh2ju.sh
./third_party/intemp/intemp.sh
./third_party/intemp/intemp.sh
...
...
test/kubemark/start-kubemark.sh
View file @
b8aae458
...
@@ -20,7 +20,7 @@ set -o errexit
...
@@ -20,7 +20,7 @@ set -o errexit
set
-o
nounset
set
-o
nounset
set
-o
pipefail
set
-o
pipefail
TMP_ROOT
=
"
$(
dirname
"
${
BASH_SOURCE
}
"
)
/../.."
TMP_ROOT
=
"
$(
dirname
"
${
BASH_SOURCE
[@]
}
"
)
/../.."
KUBE_ROOT
=
$(
readlink
-e
"
${
TMP_ROOT
}
"
2> /dev/null
||
perl
-MCwd
-e
'print Cwd::abs_path shift'
"
${
TMP_ROOT
}
"
)
KUBE_ROOT
=
$(
readlink
-e
"
${
TMP_ROOT
}
"
2> /dev/null
||
perl
-MCwd
-e
'print Cwd::abs_path shift'
"
${
TMP_ROOT
}
"
)
source
"
${
KUBE_ROOT
}
/test/kubemark/skeleton/util.sh"
source
"
${
KUBE_ROOT
}
/test/kubemark/skeleton/util.sh"
...
@@ -373,14 +373,14 @@ current-context: kubemark-context"
...
@@ -373,14 +373,14 @@ current-context: kubemark-context"
mkdir
-p
"
${
RESOURCE_DIRECTORY
}
/addons"
mkdir
-p
"
${
RESOURCE_DIRECTORY
}
/addons"
sed
"s/{{MASTER_IP}}/
${
MASTER_IP
}
/g"
"
${
RESOURCE_DIRECTORY
}
/heapster_template.json"
>
"
${
RESOURCE_DIRECTORY
}
/addons/heapster.json"
sed
"s/{{MASTER_IP}}/
${
MASTER_IP
}
/g"
"
${
RESOURCE_DIRECTORY
}
/heapster_template.json"
>
"
${
RESOURCE_DIRECTORY
}
/addons/heapster.json"
metrics_mem_per_node
=
4
metrics_mem_per_node
=
4
metrics_mem
=
$((
200
+
${
metrics_mem_per_node
}
*
${
NUM_NODES
}
))
metrics_mem
=
$((
200
+
metrics_mem_per_node
*
NUM_NODES
))
sed
-i
''
-e
"s/{{METRICS_MEM}}/
${
metrics_mem
}
/g"
"
${
RESOURCE_DIRECTORY
}
/addons/heapster.json"
sed
-i
''
-e
"s/{{METRICS_MEM}}/
${
metrics_mem
}
/g"
"
${
RESOURCE_DIRECTORY
}
/addons/heapster.json"
metrics_cpu_per_node_numerator
=
${
NUM_NODES
}
metrics_cpu_per_node_numerator
=
${
NUM_NODES
}
metrics_cpu_per_node_denominator
=
2
metrics_cpu_per_node_denominator
=
2
metrics_cpu
=
$((
80
+
metrics_cpu_per_node_numerator
/
metrics_cpu_per_node_denominator
))
metrics_cpu
=
$((
80
+
metrics_cpu_per_node_numerator
/
metrics_cpu_per_node_denominator
))
sed
-i
''
-e
"s/{{METRICS_CPU}}/
${
metrics_cpu
}
/g"
"
${
RESOURCE_DIRECTORY
}
/addons/heapster.json"
sed
-i
''
-e
"s/{{METRICS_CPU}}/
${
metrics_cpu
}
/g"
"
${
RESOURCE_DIRECTORY
}
/addons/heapster.json"
eventer_mem_per_node
=
500
eventer_mem_per_node
=
500
eventer_mem
=
$((
200
*
1024
+
${
eventer_mem_per_node
}
*
${
NUM_NODES
}
))
eventer_mem
=
$((
200
*
1024
+
eventer_mem_per_node
*
NUM_NODES
))
sed
-i
''
-e
"s/{{EVENTER_MEM}}/
${
eventer_mem
}
/g"
"
${
RESOURCE_DIRECTORY
}
/addons/heapster.json"
sed
-i
''
-e
"s/{{EVENTER_MEM}}/
${
eventer_mem
}
/g"
"
${
RESOURCE_DIRECTORY
}
/addons/heapster.json"
# Cluster Autoscaler.
# Cluster Autoscaler.
...
@@ -415,7 +415,7 @@ current-context: kubemark-context"
...
@@ -415,7 +415,7 @@ current-context: kubemark-context"
proxy_cpu
=
50
proxy_cpu
=
50
fi
fi
proxy_mem_per_node
=
50
proxy_mem_per_node
=
50
proxy_mem
=
$((
100
*
1024
+
${
proxy_mem_per_node
}
*
${
NUM_NODES
}
))
proxy_mem
=
$((
100
*
1024
+
proxy_mem_per_node
*
NUM_NODES
))
sed
-i
''
-e
"s/{{HOLLOW_PROXY_CPU}}/
${
proxy_cpu
}
/g"
"
${
RESOURCE_DIRECTORY
}
/hollow-node.yaml"
sed
-i
''
-e
"s/{{HOLLOW_PROXY_CPU}}/
${
proxy_cpu
}
/g"
"
${
RESOURCE_DIRECTORY
}
/hollow-node.yaml"
sed
-i
''
-e
"s/{{HOLLOW_PROXY_MEM}}/
${
proxy_mem
}
/g"
"
${
RESOURCE_DIRECTORY
}
/hollow-node.yaml"
sed
-i
''
-e
"s/{{HOLLOW_PROXY_MEM}}/
${
proxy_mem
}
/g"
"
${
RESOURCE_DIRECTORY
}
/hollow-node.yaml"
sed
-i
''
-e
"s'{{kubemark_image_registry}}'
${
KUBEMARK_IMAGE_REGISTRY
}
'g"
"
${
RESOURCE_DIRECTORY
}
/hollow-node.yaml"
sed
-i
''
-e
"s'{{kubemark_image_registry}}'
${
KUBEMARK_IMAGE_REGISTRY
}
'g"
"
${
RESOURCE_DIRECTORY
}
/hollow-node.yaml"
...
@@ -434,7 +434,7 @@ function wait-for-hollow-nodes-to-run-or-timeout {
...
@@ -434,7 +434,7 @@ function wait-for-hollow-nodes-to-run-or-timeout {
echo
-n
"Waiting for all hollow-nodes to become Running"
echo
-n
"Waiting for all hollow-nodes to become Running"
start
=
$(
date
+%s
)
start
=
$(
date
+%s
)
nodes
=
$(
"
${
KUBECTL
}
"
--kubeconfig
=
"
${
LOCAL_KUBECONFIG
}
"
get node 2> /dev/null
)
||
true
nodes
=
$(
"
${
KUBECTL
}
"
--kubeconfig
=
"
${
LOCAL_KUBECONFIG
}
"
get node 2> /dev/null
)
||
true
ready
=
$(($(
echo
"
${
nodes
}
"
|
grep
-v
"NotReady"
|
wc
-l
)
-
1
))
ready
=
$(($(
echo
"
${
nodes
}
"
|
grep
-v
c
"NotReady"
)
-
1
))
until
[[
"
${
ready
}
"
-ge
"
${
NUM_REPLICAS
}
"
]]
;
do
until
[[
"
${
ready
}
"
-ge
"
${
NUM_REPLICAS
}
"
]]
;
do
echo
-n
"."
echo
-n
"."
...
@@ -443,6 +443,7 @@ function wait-for-hollow-nodes-to-run-or-timeout {
...
@@ -443,6 +443,7 @@ function wait-for-hollow-nodes-to-run-or-timeout {
# Fail it if it already took more than 30 minutes.
# Fail it if it already took more than 30 minutes.
if
[
$((
now
-
start
))
-gt
1800
]
;
then
if
[
$((
now
-
start
))
-gt
1800
]
;
then
echo
""
echo
""
# shellcheck disable=SC2154 # Color defined in sourced script
echo
-e
"
${
color_red
}
Timeout waiting for all hollow-nodes to become Running.
${
color_norm
}
"
echo
-e
"
${
color_red
}
Timeout waiting for all hollow-nodes to become Running.
${
color_norm
}
"
# 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
=
"
${
LOCAL_KUBECONFIG
}
"
get node &> /dev/null
;
then
if
"
${
KUBECTL
}
"
--kubeconfig
=
"
${
LOCAL_KUBECONFIG
}
"
get node &> /dev/null
;
then
...
@@ -451,16 +452,17 @@ function wait-for-hollow-nodes-to-run-or-timeout {
...
@@ -451,16 +452,17 @@ function wait-for-hollow-nodes-to-run-or-timeout {
echo
"Got error while trying to list hollow-nodes. Probably API server is down."
echo
"Got error while trying to list hollow-nodes. Probably API server is down."
fi
fi
pods
=
$(
"
${
KUBECTL
}
"
get pods
-l
name
=
hollow-node
--namespace
=
kubemark
)
||
true
pods
=
$(
"
${
KUBECTL
}
"
get pods
-l
name
=
hollow-node
--namespace
=
kubemark
)
||
true
running
=
$(($(
echo
"
${
pods
}
"
|
grep
"Running"
|
wc
-l
)))
running
=
$(($(
echo
"
${
pods
}
"
|
grep
-c
"Running"
)))
echo
"
${
running
}
hollow-nodes are reported as 'Running'"
echo
"
${
running
}
hollow-nodes are reported as 'Running'"
not_running
=
$(($(
echo
"
${
pods
}
"
|
grep
-v
"Running"
|
wc
-l
)
-
1
))
not_running
=
$(($(
echo
"
${
pods
}
"
|
grep
-v
c
"Running"
)
-
1
))
echo
"
${
not_running
}
hollow-nodes are reported as NOT 'Running'"
echo
"
${
not_running
}
hollow-nodes are reported as NOT 'Running'"
echo
"
${
pods
}
"
|
grep
-v
Running
echo
"
${
pods
}
"
|
grep
-v
Running
exit
1
exit
1
fi
fi
nodes
=
$(
"
${
KUBECTL
}
"
--kubeconfig
=
"
${
LOCAL_KUBECONFIG
}
"
get node 2> /dev/null
)
||
true
nodes
=
$(
"
${
KUBECTL
}
"
--kubeconfig
=
"
${
LOCAL_KUBECONFIG
}
"
get node 2> /dev/null
)
||
true
ready
=
$(($(
echo
"
${
nodes
}
"
|
grep
-v
"NotReady"
|
wc
-l
)
-
1
))
ready
=
$(($(
echo
"
${
nodes
}
"
|
grep
-v
c
"NotReady"
)
-
1
))
done
done
# shellcheck disable=SC2154 # Color defined in sourced script
echo
-e
"
${
color_green
}
Done!
${
color_norm
}
"
echo
-e
"
${
color_green
}
Done!
${
color_norm
}
"
}
}
...
@@ -475,6 +477,7 @@ write-local-kubeconfig
...
@@ -475,6 +477,7 @@ write-local-kubeconfig
# Setup for master.
# Setup for master.
function
start-master
{
function
start-master
{
# shellcheck disable=SC2154 # Color defined in sourced script
echo
-e
"
${
color_yellow
}
STARTING SETUP FOR MASTER
${
color_norm
}
"
echo
-e
"
${
color_yellow
}
STARTING SETUP FOR MASTER
${
color_norm
}
"
create-master-environment-file
create-master-environment-file
create-master-instance-with-resources
create-master-instance-with-resources
...
...
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