From 9fed990da633be29bc41f75c59750c28ec2bb8f1 Mon Sep 17 00:00:00 2001 From: Deyuan Deng Date: Thu, 28 Aug 2014 20:48:36 -0400 Subject: [PATCH 1/2] Start scheduler locally. --- hack/local-up-cluster.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/hack/local-up-cluster.sh b/hack/local-up-cluster.sh index 372263096fc81..0e08c060b6bd1 100755 --- a/hack/local-up-cluster.sh +++ b/hack/local-up-cluster.sh @@ -69,12 +69,18 @@ ${GO_OUT}/proxy \ --master="http://${API_HOST}:${API_PORT}" &> ${PROXY_LOG} & PROXY_PID=$! +SCHEDULER_LOG=/tmp/k8s-scheduler.log +${GO_OUT}/scheduler \ + --master="http://${API_HOST}:${API_PORT}" &> ${SCHEDULER_LOG} & +SCHEDULER_PID=$! + echo "Local Kubernetes cluster is running. Press Ctrl-C to shut it down." echo "Logs: " echo " ${APISERVER_LOG}" echo " ${CTLRMGR_LOG}" echo " ${KUBELET_LOG}" echo " ${PROXY_LOG}" +echo " ${SCHEDULER_LOG}" cleanup() { @@ -83,12 +89,13 @@ cleanup() kill ${CTLRMGR_PID} kill ${KUBELET_PID} kill ${PROXY_PID} + kill ${SCHEDULER_PID} kill ${ETCD_PID} rm -rf ${ETCD_DIR} exit 0 } - + trap cleanup EXIT while true; do read x; done From c63205b0a7937362e3febbf50b6a8bc586ea47ae Mon Sep 17 00:00:00 2001 From: Deyuan Deng Date: Thu, 28 Aug 2014 22:31:53 -0400 Subject: [PATCH 2/2] Add quotes for variable; change shell redirection. --- hack/local-up-cluster.sh | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/hack/local-up-cluster.sh b/hack/local-up-cluster.sh index 0e08c060b6bd1..db70dd57beb7d 100755 --- a/hack/local-up-cluster.sh +++ b/hack/local-up-cluster.sh @@ -44,34 +44,34 @@ KUBELET_PORT=${KUBELET_PORT:-10250} GO_OUT=$(dirname $0)/../output/go/bin APISERVER_LOG=/tmp/apiserver.log -${GO_OUT}/apiserver \ +"${GO_OUT}/apiserver" \ --address="${API_HOST}" \ --port="${API_PORT}" \ --etcd_servers="http://127.0.0.1:4001" \ - --machines="127.0.0.1" &> ${APISERVER_LOG} & + --machines="127.0.0.1" >"${APISERVER_LOG}" 2>&1 & APISERVER_PID=$! CTLRMGR_LOG=/tmp/controller-manager.log -${GO_OUT}/controller-manager \ - --master="${API_HOST}:${API_PORT}" &> ${CTLRMGR_LOG} & +"${GO_OUT}/controller-manager" \ + --master="${API_HOST}:${API_PORT}" >"${CTLRMGR_LOG}" 2>&1 & CTLRMGR_PID=$! KUBELET_LOG=/tmp/kubelet.log -${GO_OUT}/kubelet \ +"${GO_OUT}/kubelet" \ --etcd_servers="http://127.0.0.1:4001" \ --hostname_override="127.0.0.1" \ --address="127.0.0.1" \ - --port="$KUBELET_PORT" &> ${KUBELET_LOG} & + --port="$KUBELET_PORT" >"${KUBELET_LOG}" 2>&1 & KUBELET_PID=$! PROXY_LOG=/tmp/kube-proxy.log -${GO_OUT}/proxy \ - --master="http://${API_HOST}:${API_PORT}" &> ${PROXY_LOG} & +"${GO_OUT}/proxy" \ + --master="http://${API_HOST}:${API_PORT}" >"${PROXY_LOG}" 2>&1 & PROXY_PID=$! SCHEDULER_LOG=/tmp/k8s-scheduler.log -${GO_OUT}/scheduler \ - --master="http://${API_HOST}:${API_PORT}" &> ${SCHEDULER_LOG} & +"${GO_OUT}/scheduler" \ + --master="http://${API_HOST}:${API_PORT}" >"${SCHEDULER_LOG}" 2>&1 & SCHEDULER_PID=$! echo "Local Kubernetes cluster is running. Press Ctrl-C to shut it down." @@ -85,14 +85,14 @@ echo " ${SCHEDULER_LOG}" cleanup() { echo "Cleaning up..." - kill ${APISERVER_PID} - kill ${CTLRMGR_PID} - kill ${KUBELET_PID} - kill ${PROXY_PID} - kill ${SCHEDULER_PID} - - kill ${ETCD_PID} - rm -rf ${ETCD_DIR} + kill "${APISERVER_PID}" + kill "${CTLRMGR_PID}" + kill "${KUBELET_PID}" + kill "${PROXY_PID}" + kill "${SCHEDULER_PID}" + + kill "${ETCD_PID}" + rm -rf "${ETCD_DIR}" exit 0 }