优化创建集群配置
This commit is contained in:
parent
f5ccc7e47c
commit
865b9af4d6
@ -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
|
|
||||||
|
|
@ -1,12 +1,10 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
source ../single.env
|
|
||||||
|
|
||||||
# 初始化集群
|
# 初始化集群
|
||||||
sudo kubeadm init \
|
sudo kubeadm init \
|
||||||
--kubernetes-version 1.21.10 \
|
--kubernetes-version 1.21.10 \
|
||||||
--control-plane-endpoint "${API_SERVER}:6443" \
|
--control-plane-endpoint "$1:6443" \
|
||||||
--upload-certs \
|
--upload-certs \
|
||||||
--service-cidr=10.96.0.0/12 \
|
--service-cidr=10.96.0.0/12 \
|
||||||
--pod-network-cidr=10.244.0.0/16
|
--pod-network-cidr=10.244.0.0/16
|
||||||
|
Loading…
Reference in New Issue
Block a user