#!/usr/bin/env bash
# 安装k8s的方法直接调用
export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
[ $(id -u) != "0" ] && { echo "${CFAILURE}Error: You must be root to run this script${CEND}"; exit 1; }
ROOT_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # ./k8s/scripts
WORKSPACE=`dirname $(dirname $ROOT_PATH)`
WWW_PATH=/data/ev-www
SCRIPTS_PATH=/data/ev-scripts
mkdir -p /data/ev-das/image/sftp/model_upload/upload/
MANIFESTS=$WORKSPACE/scripts/scripts/manifests/
BIN_PATH=$WORKSPACE/pkg/bin
SSL_PATH=$WORKSPACE/scripts/scripts/ssl/
CONFIG_PATH=$WORKSPACE/scripts/scripts/config/
SERVICE_PATH=$WORKSPACE/scripts/scripts/service/
PKG_PATH=$WORKSPACE/pkg/
IMAGE_PATH=$PKG_PATH/images
#K8S_API_URL="ev-k8s01.extremevision.com.cn"
K8S_API_URL="127.0.0.1"
init_k8s(){
mkdir -p $WWW_PATH
mkdir -p $SSL_PATH
mkdir -p $SCRIPTS_PATH
mkdir -p /etc/kubernetes/ssl
mkdir -p /etc/kubernetes/cfg
mkdir -p /log/kubernetes/log
mkdir -p /var/lib/kubelet
sysctl -p > /dev/null 2>&1
}
clear_kubernetes(){
#read -p "Please confirm again whether to reinstall [y/n]: " rejudge_reinstall
read -p "请输入clear进行还原" clear_word
if [ $clear_word != "clear" ]
then
echo 正在退出
return
else
# 删除配置文件
rm -rf /etc/kubernetes/
rm -rf /data/ev-redis
rm -rf /data/ev-mysql
rm -rf /data/ev-www
#rm -rf $SSL_PATH
rm -rf /etc/cni
rm -rf /var/lib/etcd/default.etcd
rm -rf /var/lib/etcd
rm -rf /kubernetes
rm -rf /var/lib/kubelet
rm -rf /root/.kube
# 关闭程序
systemctl stop kube-apiserver.service
systemctl stop kube-controller-manager.service
systemctl stop kubelet.service
systemctl stop flannel.service
systemctl stop kube-proxy.service
systemctl stop kube-scheduler.service
systemctl stop etcd.service
systemctl stop docker.service
# 关闭自启
systemctl disable kube-apiserver.service
systemctl disable kube-controller-manager.service
systemctl disable kubelet.service
systemctl disable flannel.service
systemctl disable kube-proxy.service
systemctl disable kube-scheduler.service
systemctl disable etcd.service
systemctl disable docker.service
sed -i '/systemctl restart etcd/d' /etc/rc.local
sed -i '/systemctl restart kubelet/d' /etc/rc.local
sed -i '/systemctl restart flannel/d' /etc/rc.local
sed -i '/systemctl restart docker/d' /etc/rc.local
# 删除启动项
rm -f /etc/systemd/system/kube-apiserver.service
rm -f /etc/systemd/system/kube-controller-manager.service
rm -f /etc/systemd/system/kubelet.service
rm -f /etc/systemd/system/kube-proxy.service
rm -f /etc/systemd/system/etcd.service
rm -f /etc/systemd/system/flannel.service
rm -f /etc/systemd/system/kube-scheduler.service
#if [ -f /usr/lib/systemd/system/docker.service.bak ]
#then
# rm -f /usr/lib/systemd/system/docker.service
# mv /usr/lib/systemd/system/docker.service.bak /usr/lib/systemd/system/docker.service
#else
# rm -f /lib/systemd/system/docker.service
# mv /lib/systemd/system/docker.service.bak /lib/systemd/system/docker.service
#fi
# 清空规则
iptables -Z
iptables -F
iptables -X
ipvsadm --clear
ipvsadm -Z
read -p "是否删除命令[y/n]: " judge_del_command
if [[ $judge_del_command = y ]]
then
# 删除命令
rm -rf /usr/local/bin/cni
rm -f /usr/local/bin/etcd
rm -f /usr/local/bin/etcdctl
rm -f /usr/local/bin/flanneld
rm -f /usr/local/bin/kube-apiserver
rm -f /usr/local/bin/kube-controller-manager
rm -f /usr/local/bin/kubectl
rm -f /usr/local/bin/kubectl-inspect-gpushare
rm -f /usr/local/bin/kubelet
rm -f /usr/local/bin/kube-proxy
rm -f /usr/local/bin/kube-scheduler
rm -f /usr/local/bin/remove-docker0.sh
rm -f /usr/local/bin/mk-docker-opts.sh
fi
init_k8s
fi
}
reinstall_kubernetes(){
echo "重新安装会把所有已经安装的软件清空"
read -p "你真想重新安装吗?[y/n]: " judge_reinstall
if [ $judge_reinstall = y ];then
clear_kubernetes
elif [ $judge_reinstall = Y ];then
clear_kubernetes
else
echo 退出重新安装步骤
fi
}
install_etcd(){
init_k8s
cd $ROOT_PATH
if [ ! -f /usr/local/bin/cfssl ]
then
cp -a $BIN_PATH/cfssl /usr/local/bin
fi
if [ ! -f /usr/local/bin/cfssl-certinfo ]
then
cp -a ${BIN_PATH}/cfssl-certinfo /usr/local/bin
fi
if [ ! -f /usr/local/bin/cfssljson ]
then
cp -a $BIN_PATH/cfssljson /usr/local/bin
fi
if [ ! -f /usr/local/bin/etcd ]
then
cp -a $BIN_PATH/etcd /usr/local/bin
fi
if [ ! -f /usr/local/bin/etcdctl ]
then
cp -a $BIN_PATH/etcdctl /usr/local/bin
fi
# 生成证书
date -s "1 day ago" +"%y%m%d"
cd $SSL_PATH
pwd
/usr/local/bin/cfssl gencert -initca ca-csr.json | cfssljson -bare ca
cp ca-config.json ca.csr /etc/kubernetes/ssl
mv ca.pem ca-key.pem /etc/kubernetes/ssl
/usr/local/bin/cfssl gencert -ca=/etc/kubernetes/ssl/ca.pem \
-ca-key=/etc/kubernetes/ssl/ca-key.pem \
-config=/etc/kubernetes/ssl/ca-config.json \
-profile=kubernetes etcd-csr.json | cfssljson -bare etcd
mv etcd*.pem /etc/kubernetes/ssl
if [ ! -f /etc/kubernetes/cfg/etcd.conf ]
then
cp -a $CONFIG_PATH/etcd.conf /etc/kubernetes/cfg/etcd.conf
fi
mkdir -p /var/lib/etcd
cp $SERVICE_PATH/etcd.service /etc/systemd/system/etcd.service
systemctl daemon-reload
systemctl restart etcd
systemctl enable etcd
grep etcd /etc/rc.d/rc.local > /dev/null 2>&1
if [ $? != 0 ]
then
echo 'systemctl restart etcd' >> /etc/rc.d/rc.local
fi
}
check_etcd(){
/usr/local/bin/etcdctl --endpoints=https://127.0.0.1:2379 \
--cacert=/etc/kubernetes/ssl/ca.pem \
--cert=/etc/kubernetes/ssl/etcd.pem \
--key=/etc/kubernetes/ssl/etcd-key.pem endpoint health
if [ $? != 0 ]
then
echo "etcd安装有误"
exit 1
fi
}
install_apiserver(){
if [ ! -f /usr/local/bin/kube-apiserver ]
then
cp -a $BIN_PATH/kube-apiserver /usr/local/bin
fi
cd $SSL_PATH
/usr/local/bin/cfssl gencert -ca=/etc/kubernetes/ssl/ca.pem \
-ca-key=/etc/kubernetes/ssl/ca-key.pem \
-config=/etc/kubernetes/ssl/ca-config.json \
-profile=kubernetes kubernetes-csr.json | cfssljson -bare kubernetes
mv kubernetes*.pem /etc/kubernetes/ssl/
/usr/local/bin/cfssl gencert -ca=/etc/kubernetes/ssl/ca.pem \
-ca-key=/etc/kubernetes/ssl/ca-key.pem \
-config=/etc/kubernetes/ssl/ca-config.json \
-profile=kubernetes kube-proxy-csr.json | cfssljson -bare kube-proxy
mv kube-proxy*.pem /etc/kubernetes/ssl/
if [ ! -f /etc/kubernetes/ssl/bootstrap-token.csv ]
then
cp bootstrap-token.csv /etc/kubernetes/ssl/bootstrap-token.csv
fi
if [ ! -f /etc/kubernetes/ssl/basic-auth.csv ]
then
cp basic-auth.csv /etc/kubernetes/ssl/basic-auth.csv
fi
cp $SERVICE_PATH/kube-apiserver.service /etc/systemd/system/kube-apiserver.service
systemctl daemon-reload
systemctl enable kube-apiserver
systemctl restart kube-apiserver
if [ $? != 0 ]
then
echo "apiserver安装有误"
exit 1
fi
}
install_controller_manager(){
if [ ! -f /usr/local/bin/kube-controller-manager ]
then
cp -a $BIN_PATH/kube-controller-manager /usr/local/bin
fi
cp $SERVICE_PATH/kube-controller-manager.service /etc/systemd/system/kube-controller-manager.service
systemctl daemon-reload
systemctl enable kube-controller-manager
systemctl start kube-controller-manager
if [ $? != 0 ]
then
echo "controller-manager安装有误"
exit 1
fi
}
install_scheduler(){
if [ ! -f /etc/kubernetes/scheduler-policy-config.json ];then
cp -a $CONFIG_PATH/scheduler-policy-config.json /etc/kubernetes/scheduler-policy-config.json
fi
if [ ! -f /usr/local/bin/kube-scheduler ]
then
cp -a $BIN_PATH/kube-scheduler /usr/local/bin
fi
cp $SERVICE_PATH/kube-scheduler.service /etc/systemd/system/kube-scheduler.service
systemctl daemon-reload
systemctl enable kube-scheduler
systemctl start kube-scheduler
if [ $? != 0 ]
then
echo "scheduler安装有误"
exit 1
fi
}
install_kubectl(){
if [ ! -f /usr/local/bin/kubectl ]
then
cp -a $BIN_PATH/kubectl /usr/local/bin
fi
cd $SSL_PATH
/usr/local/bin/cfssl gencert -ca=/etc/kubernetes/ssl/ca.pem \
-ca-key=/etc/kubernetes/ssl/ca-key.pem \
-config=/etc/kubernetes/ssl/ca-config.json \
-profile=kubernetes admin-csr.json | cfssljson -bare admin
mv admin*.pem /etc/kubernetes/ssl/
/usr/local/bin/kubectl config set-cluster kubernetes \
--certificate-authority=/etc/kubernetes/ssl/ca.pem \
--embed-certs=true \
--server=https://${K8S_API_URL}:6443
/usr/local/bin/kubectl config set-credentials admin \
--client-certificate=/etc/kubernetes/ssl/admin.pem \
--embed-certs=true \
--client-key=/etc/kubernetes/ssl/admin-key.pem
/usr/local/bin/kubectl config set-context kubernetes \
--cluster=kubernetes \
--user=admin
/usr/local/bin/kubectl config use-context kubernetes
kubectl get cs
if [ $? != 0 ]
then
echo "整体环境安装有误"
exit 1
fi
}
install_kubelet(){
if [ ! -f /usr/local/bin/kubelet ]
then
cp -a $BIN_PATH/kubelet /usr/local/bin
fi
/usr/local/bin/kubectl create clusterrolebinding kubelet-bootstrap --clusterrole=system:node-bootstrapper --user=kubelet-bootstrap
/usr/local/bin/kubectl config set-cluster kubernetes \
--certificate-authority=/etc/kubernetes/ssl/ca.pem \
--embed-certs=true \
--server=https://${K8S_API_URL}:6443 \
--kubeconfig=bootstrap.kubeconfig
/usr/local/bin/kubectl config set-credentials kubelet-bootstrap \
--token=00f1c8a566d853d0af327de8fe959457 \
--kubeconfig=bootstrap.kubeconfig
/usr/local/bin/kubectl config set-context default \
--cluster=kubernetes \
--user=kubelet-bootstrap \
--kubeconfig=bootstrap.kubeconfig
/usr/local/bin/kubectl config use-context default --kubeconfig=bootstrap.kubeconfig
mv bootstrap.kubeconfig /etc/kubernetes/cfg
sed -i 's#node_name#node01#g' $SERVICE_PATH/kubelet.service
cp $SERVICE_PATH/kubelet.service /etc/systemd/system/kubelet.service
systemctl daemon-reload
systemctl enable kubelet
systemctl start kubelet
if [ $? != 0 ]
then
echo "kubelet安装有误"
exit 1
fi
kubectl get cs
grep kubelet /etc/rc.d/rc.local > /dev/null 2>&1
if [ $? != 0 ]
then
echo 'systemctl restart kubelet' >> /etc/rc.d/rc.local
fi
}
agree_node_join(){
systemctl restart kubelet
sleep 30
/usr/local/bin/kubectl get csr
/usr/local/bin/kubectl get csr|grep 'Pending' | awk 'NR>0{print $1}'| xargs kubectl certificate approve
sleep 3
/usr/local/bin/kubectl get node
}
install_proxy(){
sysctl -p > /dev/null 2>&1
if [ ! -f /usr/local/bin/kube-proxy ]
then
cp -a $BIN_PATH/kube-proxy /usr/local/bin/kube-proxy
fi
cd $SSL_PATH
/usr/local/bin/kubectl config set-cluster kubernetes \
--certificate-authority=/etc/kubernetes/ssl/ca.pem \
--embed-certs=true \
--server=https://${K8S_API_URL}:6443 \
--kubeconfig=kube-proxy.kubeconfig
/usr/local/bin/kubectl config set-credentials kube-proxy \
--client-certificate=/etc/kubernetes/ssl/kube-proxy.pem \
--client-key=/etc/kubernetes/ssl/kube-proxy-key.pem \
--embed-certs=true \
--kubeconfig=kube-proxy.kubeconfig
/usr/local/bin/kubectl config set-context default \
--cluster=kubernetes \
--user=kube-proxy \
--kubeconfig=kube-proxy.kubeconfig
/usr/local/bin/kubectl config use-context default --kubeconfig=kube-proxy.kubeconfig
mv kube-proxy.kubeconfig /etc/kubernetes/cfg/
mkdir -p /var/lib/kube-proxy
sed -i 's#node_name#node01#g' $SERVICE_PATH/kube-proxy.service
cp $SERVICE_PATH/kube-proxy.service /etc/systemd/system/kube-proxy.service
systemctl daemon-reload
systemctl enable kube-proxy
systemctl start kube-proxy
if [ $? != 0 ]
then
echo "kube-proxy安装有误"
exit 1
fi
}
install_calico(){
grep ccr.ccs.tencentyun.com /etc/docker/daemon.json > /dev/null 2>&1
if [ $? != 0 ]
then
if [ -c /dev/nvidia0 ]
then
\cp -a $WORKSPACE/scripts/scripts/config/daemon.json /etc/docker/daemon.json
else
\cp -a $WORKSPACE/scripts/scripts/config/daemon-cpu.json /etc/docker/daemon.json
fi
fi
docker load < $IMAGE_PATH/kube-controllers.tar
docker load < $IMAGE_PATH/calico-cni.tar
docker load < $IMAGE_PATH/pod2daemon.tar
docker load < $IMAGE_PATH/calico-node.tar
docker load < $IMAGE_PATH/pause.tar
cp -a $BIN_PATH/cni /usr/local/bin
kubectl create -f $MANIFESTS/calico.yaml
cd $SSL_PATH
mkdir -p /kubernetes/network
systemctl daemon-reload
systemctl restart docker
systemctl enable docker
grep docker /etc/rc.d/rc.local > /dev/null 2>&1
if [ $? != 0 ]
then
echo 'systemctl restart docker' >> /etc/rc.d/rc.local
fi
docker login --username=100013519212 ccr.ccs.tencentyun.com -pC3o6qm4jE1n
}
install_coredns(){
docker load < $IMAGE_PATH/dns.tar
kubectl create -f $MANIFESTS/coredns.yaml
}
install_dashboard(){
docker load < $IMAGE_PATH/dashboard.tar
kubectl create -f $MANIFESTS/dashboard-adminuser.yaml
kubectl create -f $MANIFESTS/kubernetes-dashboard.yaml
}
install_redis(){
kubectl create -f $MANIFESTS/ev-redis.yaml
}
install_mysql(){
kubectl create -f $MANIFESTS/ev-mysql.yaml
}
install_rtmp(){
kubectl create -f $MANIFESTS/rtmp.yaml
}
install_das(){
docker load < $IMAGE_PATH/das.tar
kubectl create -f $MANIFESTS/ev-das.yaml
}
reinstall_basic_user_rbac(){
kubectl delete -f $MANIFESTS/basic-user.yaml
kubectl create -f $MANIFESTS/basic-user.yaml
}
install_monitor(){
docker load < $IMAGE_PATH/metrics.tar
kubectl create -f $MANIFESTS/metrics-server
}
create_configmap(){
kubectl create -f $MANIFESTS/nginx-conf-configmap.yaml
}
create_ev_device_pvc(){
/usr/local/bin/kubectl label node node01 node-role.kubernetes.io/master=node01
node_name=`kubectl get node |grep master | awk '{print $1}' | head -1`
if [ -z $node_name ]
then
echo "节点名称没有master"
exit 1
else
sed -i "s#ev-node#$node_name#g" $MANIFESTS/device-pvc.yaml
#sed -i "s#ev-node#$node_name#g" $MANIFESTS/mem-pvc.yaml
# 只检查三块硬盘的盘符,一旦超过 直接退出
if [ -b /dev/sda ]
then
sed -i 's#ev-device-block#/dev/sda#g' $MANIFESTS/device-pvc.yaml
sed -i 's#/dev/.*#/dev/sda#g' $MANIFESTS/device-pvc.yaml
sed -i 's#dev-name#/dev/sda#g' $MANIFESTS/device-config.yaml
sed -i 's#/dev/.*#/dev/sda#g' $MANIFESTS/device-config.yaml
echo -n "/dev/sda" >> $WWW_PATH/.device
elif [ -b /dev/sdb ]
then
sed -i 's#ev-device-block#/dev/sdb#g' $MANIFESTS/device-pvc.yaml
sed -i 's#/dev/.*#/dev/sdb#g' $MANIFESTS/device-pvc.yaml
sed -i 's#dev-name#/dev/sdb#g' $MANIFESTS/device-config.yaml
sed -i 's#/dev/.*#/dev/sdb#g' $MANIFESTS/device-config.yaml
echo -n "/dev/sda" >> $WWW_PATH/.device
elif [ -b /dev/sdc ]
then
sed -i 's#ev-device-block#/dev/sdc#g' $MANIFESTS/device-pvc.yaml
sed -i 's#/dev/.*#/dev/sdc#g' $MANIFESTS/device-pvc.yaml
sed -i 's#dev-name#/dev/sdc#g' $MANIFESTS/device-config.yaml
sed -i 's#/dev/.*#/dev/sdc#g' $MANIFESTS/device-config.yaml
echo -n "/dev/sda" >> $WWW_PATH/.device
elif [ -b /dev/nvme0n1 ]
then
sed -i 's#ev-device-block#/dev/nvme0n1#g' $MANIFESTS/device-pvc.yaml
sed -i 's#/dev/.*#/dev/nvme0n1#g' $MANIFESTS/device-pvc.yaml
sed -i 's#dev-name#/dev/nvme0n1#g' $MANIFESTS/device-config.yaml
sed -i 's#/dev/.*#/dev/nvme0n1#g' $MANIFESTS/device-config.yaml
echo -n "/dev/nvme0n1" >> $WWW_PATH/.device
elif [ -b /dev/nvme0n2 ]
then
sed -i 's#ev-device-block#/dev/nvme0n2#g' $MANIFESTS/device-pvc.yaml
sed -i 's#/dev/.*#/dev/nvme0n2#g' $MANIFESTS/device-pvc.yaml
sed -i 's#dev-name#/dev/nvme0n2#g' $MANIFESTS/device-config.yaml
sed -i 's#/dev/.*#/dev/nvme0n2#g' $MANIFESTS/device-config.yaml
echo -n "/dev/nvme0n2" >> $WWW_PATH/.device
elif [ -b /dev/nvme1n1 ]
then
sed -i 's#ev-device-block#/dev/nvme1n1#g' $MANIFESTS/device-pvc.yaml
sed -i 's#/dev/.*#/dev/nvme1n1#g' $MANIFESTS/device-pvc.yaml
sed -i 's#dev-name#/dev/nvme1n1#g' $MANIFESTS/device-config.yaml
sed -i 's#/dev/.*#/dev/nvme1n1#g' $MANIFESTS/device-config.yaml
echo -n "/dev/nvme1n1" >> $WWW_PATH/.device
else
echo '/dev/sda /dev/sdb /dev/sdc /dev/nvme0 /dev/nvme1 不存在'
echo '请查看网址 http://doc-config.cvmart.net:8088/mistake/chapter01.html '
read -p "请输入设备位置,例如/dev/mem: " device_name
if [ -b $device_name ]
then
sed -i 's#/dev/.*#/dev/$device_name#g' $MANIFESTS/device-pvc.yaml
sed -i "s#ev-device-block#$device_name#g" $MANIFESTS/device-pvc.yaml
sed -i "s#dev-name#$device_name#g" $MANIFESTS/device-config.yaml
sed -i 's#/dev/.*#/dev/$device_name#g' $MANIFESTS/device-config.yaml
echo -n "$device_name" >> $WWW_PATH/.device
else
echo $device_name 不是一个设备
read -p "继续请回车" p
exit 1
fi
fi
fi
kubectl delete -f $MANIFESTS/device-pvc.yaml
kubectl apply -f $MANIFESTS/device-pvc.yaml
kubectl delete -f $MANIFESTS/device-config.yaml
kubectl apply -f $MANIFESTS/device-config.yaml
}
install_nfs(){
grep 'net.core.wmem_max = 16777216' /etc/rc.d/rc.local > /dev/null 2>&1
if [ $? != 0 ]
then
echo net.core.wmem_default = 8388608 >> /etc/sysctl.conf
echo net.core.rmem_default = 8388608 >> /etc/sysctl.conf
echo net.core.rmem_max = 16777216 >> /etc/sysctl.conf
echo net.core.wmem_max = 16777216 >> /etc/sysctl.conf
sysctl -p > /dev/null 2>&1
fi
grep '/data/ev-redis *(rw,sync,no_root_squash)' /etc/rc.d/rc.local > /dev/null 2>&1
if [ $? != 0 ]
then
mkdir -p /data/ev-redis /data/ev-www /usr/local/ev/
echo '/data/ev-redis *(rw,sync,no_root_squash)' >> /etc/exports
echo '/data/ev-www *(rw,sync,no_root_squash)' >> /etc/exports
echo '/usr/local/ev/ *(rw,sync,no_root_squash)' >> /etc/exports
fi
systemctl restart nfs
systemctl enable nfs
}
install_nfs_pvc(){
kubectl apply -f $MANIFESTS/web-nfs-pvc.yaml
}
install_cronjob(){
docker load < $IMAGE_PATH/busybox.tar
kubectl apply -f $MANIFESTS/ev-clear-vas-log.yaml
}
install_check_network(){
kubectl apply -f $MANIFESTS/ev-check-network-job.yaml
sleep 10
val=`kubectl get job -o go-template --template='{{range.items }}{{- if .metadata.labels.evchecknet }} {{.status.succeeded}} {{- end}}{{end }}'`
if [[ $val = 1 ]]
then
echo -e "\033[32;1m 容器网络访问百度正常 \033[0m"
else
echo -e "\033[31;1m 容器网络访问百度失败 \033[0m"
fi
kubectl delete -f $MANIFESTS/ev-check-network-job.yaml
}
create_secret_docker_registry(){
/usr/local/bin/kubectl -n default create secret docker-registry registry-key --docker-server=ccr.ccs.tencentyun.com --docker-username=100013519212 --docker-password=C3o6qm4jE1n [email protected]
/usr/local/bin/kubectl -n kube-system create secret docker-registry registry-key --docker-server=ccr.ccs.tencentyun.com --docker-username=100013519212 --docker-password=C3o6qm4jE1n [email protected]
/usr/local/bin/kubectl -n ns-monitor create secret docker-registry registry-key --docker-server=ccr.ccs.tencentyun.com --docker-username=100013519212 --docker-password=C3o6qm4jE1n [email protected]
}
install_kubernetes(){
install_nfs
install_etcd
check_etcd
install_apiserver
install_controller_manager
install_scheduler
install_kubectl
sleep 10
install_kubelet
sleep 10
systemctl restart kubelet
agree_node_join
install_proxy
install_calico
create_secret_docker_registry
install_coredns
install_dashboard
install_redis
install_mysql
install_rtmp
create_configmap
reinstall_basic_user_rbac
create_ev_device_pvc
install_monitor
install_das
install_cronjob
sleep 30
kubectl get pod -A
install_check_network
}