mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 20:24:09 +00:00
Merge pull request #8986 from ZJU-SEL/fix-util.sh
Add trap-add in util.sh
This commit is contained in:
commit
be2e61d069
@ -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 {
|
||||
|
@ -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.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user