cluster提交

This commit is contained in:
zhanglikun 2023-09-12 22:58:49 +08:00
parent adb0301f61
commit 853932b43d
2 changed files with 27 additions and 0 deletions

12
cluster.env Normal file
View File

@ -0,0 +1,12 @@
# master 节点的IP
MASTER1="10.0.0.11"
MASTER2="10.0.0.12"
MASTER3="10.0.0.13"
# master 节点的网卡设备名
MASTER1_NIC="eth0"
MASTER2_NIC="eth0"
MASTER3_NIC="eth0"
# api server 填vip或者负载均衡的地址
API_SERVER="10.0.0.10"

15
cluster.sh Executable file
View File

@ -0,0 +1,15 @@
#!/bin/bash
set -euo pipefail
source cluster.env
if [ $(id -u) != "0" ]; then
echo "Error: You must be root to run this script"
exit 1
fi
cd scripts
./1-init.sh
sed -e "s/^apiserver=.*/apiserver=${VIP}/g" -i 2-create_k8s.sh
./2-create_k8s.sh
./3-nginx_ingress.sh