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
}
# Check prereqs on every k8s node
function check-prereqs {
PATH=$PATH:/opt/bin/
# use ubuntu
if ! $(grep Ubuntu /etc/lsb-release > /dev/null 2>&1)
then
echo "warning: not detecting a ubuntu system"
exit 1
# Install handler for signal trap
function trap-add {
local handler="$1"
local signal="${2-EXIT}"
local cur
cur="$(eval "sh -c 'echo \$3' -- $(trap -p ${signal})")"
if [[ -n "${cur}" ]]; then
handler="${cur}; ${handler}"
fi
# check etcd
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
trap "${handler}" ${signal}
}
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.