整理文件结构
This commit is contained in:
parent
bb0cf1697d
commit
19766ba1a1
2
.env
2
.env
@ -1,5 +1,3 @@
|
||||
MODE="single"
|
||||
# MODE="cluster"
|
||||
MASTER1="10.0.0.112"
|
||||
MASTER2="10.0.0.122"
|
||||
MASTER3="10.0.0.132"
|
||||
|
@ -3,10 +3,13 @@ set -euo pipefail
|
||||
|
||||
source .env
|
||||
|
||||
# 生成keepalived配置文件
|
||||
sed -e "s/__MASTER1__/${MASTER1}/g" \
|
||||
-e "s/__MASTER2__/${MASTER2}/g" \
|
||||
-e "s/__MASTER3__/${MASTER3}/g" \
|
||||
-e "s/__VIP__/${VIP}/g" \
|
||||
-i keepalived/*.conf
|
||||
|
||||
sed -e "s/__API_SERVER__/${VIP}/g" -i 2-create_k8s.sh
|
||||
# 修改脚本内VIP
|
||||
sed -e "s/__API_SERVER__/${VIP}/g" -i 2-create_k8s.sh
|
||||
|
||||
|
@ -2,4 +2,4 @@
|
||||
set -euo pipefail
|
||||
|
||||
# 更新内核, 可选操作
|
||||
cd ../kernel_5.4 && bash install.sh && cd ..
|
||||
cd ../kernel_5.4 && bash install.sh && cd -
|
||||
|
@ -26,6 +26,6 @@ sudo sysctl --system
|
||||
swapoff -a
|
||||
sed -i 's/.*swap.*/#&/' /etc/fstab
|
||||
|
||||
cd ./docker && bash ./install.sh && cd ..
|
||||
cd ./kubeadm && bash ./install.sh && cd ..
|
||||
cd ../docker && bash ./install.sh && cd -
|
||||
cd ../kubeadm && bash ./install.sh && cd -
|
||||
|
||||
|
@ -25,4 +25,4 @@ source <(kubectl completion bash)
|
||||
EOF
|
||||
fi
|
||||
|
||||
cd flannel && bash install.sh && cd ..
|
||||
cd ../flannel && bash install.sh && cd -
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
cd ingress-nginx && bash install.sh && cd ..
|
||||
cd ../ingress-nginx && bash install.sh && cd -
|
||||
|
18
single.sh
Normal file
18
single.sh
Normal file
@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
VIP="10.0.0.32"
|
||||
|
||||
if [ $(id -u) != "0" ]; then
|
||||
echo "Error: You must be root to run this script"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
source .env
|
||||
|
||||
|
||||
cd scripts
|
||||
./1-init.sh
|
||||
sed -e "s/__API_SERVER__/${VIP}/g" -i 2-create_k8s.sh
|
||||
./2-create_k8s.sh
|
||||
./3-nginx_ingress.sh
|
Loading…
Reference in New Issue
Block a user