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