优化创建集群配置

This commit is contained in:
zhanglikun 2023-09-13 10:40:03 +08:00
parent f5ccc7e47c
commit 865b9af4d6
3 changed files with 2 additions and 19 deletions

View File

@ -1,15 +0,0 @@
#!/bin/bash
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
# 修改脚本内VIP
sed -e "s/__API_SERVER__/${VIP}/g" -i create_cluster.sh

View File

@ -1,12 +1,10 @@
#!/bin/bash
set -euo pipefail
source ../single.env
# 初始化集群
sudo kubeadm init \
--kubernetes-version 1.21.10 \
--control-plane-endpoint "${API_SERVER}:6443" \
--control-plane-endpoint "$1:6443" \
--upload-certs \
--service-cidr=10.96.0.0/12 \
--pod-network-cidr=10.244.0.0/16

View File

@ -10,5 +10,5 @@ fi
cd scripts
./init.sh
./create_cluster.sh
./create_cluster.sh ${API_SERVER}
./nginx_ingress.sh