From 853932b43de263cf74f5e6b1cdb5a58a4091aa91 Mon Sep 17 00:00:00 2001 From: zhanglikun Date: Tue, 12 Sep 2023 22:58:49 +0800 Subject: [PATCH] =?UTF-8?q?cluster=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cluster.env | 12 ++++++++++++ cluster.sh | 15 +++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 cluster.env create mode 100755 cluster.sh diff --git a/cluster.env b/cluster.env new file mode 100644 index 0000000..38be2df --- /dev/null +++ b/cluster.env @@ -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" \ No newline at end of file diff --git a/cluster.sh b/cluster.sh new file mode 100755 index 0000000..686c69e --- /dev/null +++ b/cluster.sh @@ -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