diff --git a/scripts/config.sh b/scripts/config.sh deleted file mode 100755 index 5c2c098..0000000 --- a/scripts/config.sh +++ /dev/null @@ -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 - diff --git a/scripts/create_cluster.sh b/scripts/create_cluster.sh index 1dc46b5..21d525a 100755 --- a/scripts/create_cluster.sh +++ b/scripts/create_cluster.sh @@ -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 diff --git a/single.sh b/single.sh index 2e48129..c9eda55 100755 --- a/single.sh +++ b/single.sh @@ -10,5 +10,5 @@ fi cd scripts ./init.sh -./create_cluster.sh +./create_cluster.sh ${API_SERVER} ./nginx_ingress.sh