From 865b9af4d6ecade59ca7e8b0d69a7fea86dbd899 Mon Sep 17 00:00:00 2001 From: zhanglikun Date: Wed, 13 Sep 2023 10:40:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=88=9B=E5=BB=BA=E9=9B=86?= =?UTF-8?q?=E7=BE=A4=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/config.sh | 15 --------------- scripts/create_cluster.sh | 4 +--- single.sh | 2 +- 3 files changed, 2 insertions(+), 19 deletions(-) delete mode 100755 scripts/config.sh 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