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
8b66b3f1
Commit
8b66b3f1
authored
Feb 12, 2015
by
Brendan Burns
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4400 from erictune/no_port_conflict
Make cleanup of local cluster more robust.
parents
edea91e5
e82b97d2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
17 deletions
+18
-17
local-up-cluster.sh
hack/local-up-cluster.sh
+18
-17
No files found.
hack/local-up-cluster.sh
View file @
8b66b3f1
...
@@ -87,6 +87,22 @@ esac
...
@@ -87,6 +87,22 @@ esac
GO_OUT
=
"
${
KUBE_ROOT
}
/_output/local/bin/
${
host_os
}
/
${
host_arch
}
"
GO_OUT
=
"
${
KUBE_ROOT
}
/_output/local/bin/
${
host_os
}
/
${
host_arch
}
"
cleanup
()
{
echo
"Cleaning up..."
[[
-n
"
${
APISERVER_PID
-
}
"
]]
&&
sudo kill
"
${
APISERVER_PID
}
"
[[
-n
"
${
CTLRMGR_PID
-
}
"
]]
&&
sudo kill
"
${
CTLRMGR_PID
}
"
[[
-n
"
${
KUBELET_PID
-
}
"
]]
&&
sudo kill
"
${
KUBELET_PID
}
"
[[
-n
"
${
PROXY_PID
-
}
"
]]
&&
sudo kill
"
${
PROXY_PID
}
"
[[
-n
"
${
SCHEDULER_PID
-
}
"
]]
&&
sudo kill
"
${
SCHEDULER_PID
}
"
[[
-n
"
${
ETCD_PID
-
}
"
]]
&&
kill
"
${
ETCD_PID
}
"
[[
-n
"
${
ETCD_DIR
-
}
"
]]
&&
rm
-rf
"
${
ETCD_DIR
}
"
exit
0
}
trap
cleanup EXIT
APISERVER_LOG
=
/tmp/kube-apiserver.log
APISERVER_LOG
=
/tmp/kube-apiserver.log
sudo
"
${
GO_OUT
}
/kube-apiserver"
\
sudo
"
${
GO_OUT
}
/kube-apiserver"
\
--v
=
${
LOG_LEVEL
}
\
--v
=
${
LOG_LEVEL
}
\
...
@@ -99,7 +115,8 @@ sudo "${GO_OUT}/kube-apiserver" \
...
@@ -99,7 +115,8 @@ sudo "${GO_OUT}/kube-apiserver" \
APISERVER_PID
=
$!
APISERVER_PID
=
$!
# Wait for kube-apiserver to come up before launching the rest of the components.
# Wait for kube-apiserver to come up before launching the rest of the components.
kube::util::wait_for_url
"http://
${
API_HOST
}
:
${
API_PORT
}
/api/v1beta1/pods"
"apiserver: "
echo
"Waiting for apiserver to come up"
kube::util::wait_for_url
"http://
${
API_HOST
}
:
${
API_PORT
}
/api/v1beta1/pods"
"apiserver: "
1 10
||
exit
1
CTLRMGR_LOG
=
/tmp/kube-controller-manager.log
CTLRMGR_LOG
=
/tmp/kube-controller-manager.log
sudo
"
${
GO_OUT
}
/kube-controller-manager"
\
sudo
"
${
GO_OUT
}
/kube-controller-manager"
\
...
@@ -147,20 +164,4 @@ To start using your cluster, open up another terminal/tab and run:
...
@@ -147,20 +164,4 @@ To start using your cluster, open up another terminal/tab and run:
cluster/kubectl.sh
cluster/kubectl.sh
EOF
EOF
cleanup
()
{
echo
"Cleaning up..."
sudo kill
"
${
APISERVER_PID
}
"
sudo kill
"
${
CTLRMGR_PID
}
"
sudo kill
"
${
KUBELET_PID
}
"
sudo kill
"
${
PROXY_PID
}
"
sudo kill
"
${
SCHEDULER_PID
}
"
kill
"
${
ETCD_PID
}
"
rm
-rf
"
${
ETCD_DIR
}
"
exit
0
}
trap
cleanup EXIT
while
true
;
do
sleep
1
;
done
while
true
;
do
sleep
1
;
done
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