Merge pull request #8986 from ZJU-SEL/fix-util.sh

Add trap-add in util.sh
This commit is contained in:
Eric Tune 2015-06-01 10:27:49 -07:00
commit be2e61d069
2 changed files with 11 additions and 23 deletions

View File

@ -102,30 +102,18 @@ function verify-prereqs {
fi fi
} }
# Check prereqs on every k8s node # Install handler for signal trap
function check-prereqs { function trap-add {
PATH=$PATH:/opt/bin/ local handler="$1"
# use ubuntu local signal="${2-EXIT}"
if ! $(grep Ubuntu /etc/lsb-release > /dev/null 2>&1) local cur
then
echo "warning: not detecting a ubuntu system" cur="$(eval "sh -c 'echo \$3' -- $(trap -p ${signal})")"
exit 1 if [[ -n "${cur}" ]]; then
handler="${cur}; ${handler}"
fi fi
# check etcd trap "${handler}" ${signal}
if ! $(which etcd > /dev/null)
then
echo "warning: etcd binary is not found in the PATH: $PATH"
exit 1
fi
# detect the etcd version, we support only etcd 2.0.
etcdVersion=$(/opt/bin/etcd --version | awk '{print $3}')
if [ "$etcdVersion" != "2.0.0" ]; then
echo "We only support 2.0.0 version of etcd"
exit 1
fi
} }
function verify-cluster { function verify-cluster {

View File

@ -1,4 +1,4 @@
# Kubernetes deployed on ubuntu nodes # Kubernetes Deployment On Bare-metal Ubuntu Nodes
This document describes how to deploy kubernetes on ubuntu nodes, including 1 master node and 3 minion nodes, and people uses this approach can scale to **any number of minion nodes** by changing some settings with ease. The original idea was heavily inspired by @jainvipin 's ubuntu single node work, which has been merge into this document. This document describes how to deploy kubernetes on ubuntu nodes, including 1 master node and 3 minion nodes, and people uses this approach can scale to **any number of minion nodes** by changing some settings with ease. The original idea was heavily inspired by @jainvipin 's ubuntu single node work, which has been merge into this document.