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
6e3d6738
Commit
6e3d6738
authored
Sep 15, 2015
by
jayvyas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[examples k8petstore] Fix nodeport impl
parent
0902f80f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
k8petstore-nodeport.sh
examples/k8petstore/k8petstore-nodeport.sh
+8
-6
No files found.
examples/k8petstore/k8petstore-nodeport.sh
View file @
6e3d6738
...
...
@@ -20,7 +20,8 @@ echo "WRITING KUBE FILES , will overwrite the jsons, then testing pods. is kube
#Args below can be overriden when calling from cmd line.
#Just send all the args in order.
#for dev/test you can use:
#kubectl=$GOPATH/src/github.com/kubernetes/kubernetes/cluster/kubectl.sh"
#kubectl="$GOPATH/src/k8s.io/kubernetes/cluster/kubectl.sh"
kubectl
=
"kubectl"
VERSION
=
"r.2.8.19"
_SECONDS
=
1000
# number of seconds to measure throughput.
...
...
@@ -40,7 +41,7 @@ SLAVE="${6:-$SLAVE}" # amount of redis slaves
TEST
=
"
${
7
:-
$TEST
}
"
# 0 = Dont run tests, 1 = Do run tests.
NS
=
"
${
8
:-
$NS
}
"
# namespace
NODE_PORT
=
"
${
9
:-
$NODE_PORT
}
"
#nodePort, see fe-s.json
echo
"Running w/ args: kubectl
$kubectl
version
$VERSION
sec
$_SECONDS
fe
$FE
lg
$LG
slave
$SLAVE
test
$TEST
NAMESPACE
$NS
NODE_PORT
$NODE_PORT
"
echo
"Running w/ args: kubectl
$kubectl
version
$VERSION
sec
$_SECONDS
fe
$FE
lg
$LG
slave
$SLAVE
test
=
$TEST
, NAMESPACE =
$NS
, NODE_PORT =
$NODE_PORT
"
function
create
{
cat
<<
EOF
> fe-rc.json
...
...
@@ -249,16 +250,17 @@ function getIP {
}
function
getNodePort
{
NODE_PORT
=
$(
$kubectl
get services/frontend
-o
go-template
=
'{{(index .spec.ports 0).nodePort}}'
)
if
[
-z
"
$NODE_PORT
"
]
;
then
NODE_PORT
=
$(
$kubectl
get services/frontend
--namespace
=
$NS
-o
go-template
=
'{{(index .spec.ports 0).nodePort}}'
)
if
[
-z
"
$NODE_PORT
"
]
;
then
echo
"Error: Can't get NodePort of services/frontend!!!"
exit
1
else
else
printf
'\n\n\n%*s\n'
"
${
COLUMNS
:-$(
tput cols
)}
"
''
|
tr
' '
=
echo
-e
"NodePort of services/frontend:
\n
$NODE_PORT
"
echo
-e
"WARNING: On cloud platforms like GCE, you may need to add a firewall rule to allow TCP traffic on port
$NODE_PORT
"
printf
'%*s\n\n\n\n'
"
${
COLUMNS
:-$(
tput cols
)}
"
''
|
tr
' '
=
fi
fi
}
function
pollfor
{
...
...
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