From 02b5d3324d2acc9c515fd6d5e24509c4a226e836 Mon Sep 17 00:00:00 2001 From: zhanglikun Date: Fri, 2 Feb 2024 17:39:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B4=E5=90=88=E9=85=8D=E7=BD=AE=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E4=B8=BA=E4=B8=80=E4=B8=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 13 +++++++++++++ README.md | 4 ++-- cluster.env | 10 ---------- cluster.sh | 2 +- single.env | 2 -- single.sh | 2 +- 6 files changed, 17 insertions(+), 16 deletions(-) create mode 100644 .env delete mode 100644 cluster.env delete mode 100644 single.env diff --git a/.env b/.env new file mode 100644 index 0000000..39ae65f --- /dev/null +++ b/.env @@ -0,0 +1,13 @@ +# master 节点的IP, 单节点版不用配置 +MASTER1="10.0.0.11" +MASTER2="10.0.0.12" +MASTER3="10.0.0.13" + +# master 节点的网卡设备名, 单节点版不用配置 +NETWORK_NIC="eth0" + +# api server 填vip或者负载均衡的地址, 如果是单节点 填自己的IP地址 +API_SERVER="10.0.0.10" + +# 是否使用国内源 +USE_CHINA_MIRROR="no" diff --git a/README.md b/README.md index 3c49600..553eba3 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ centos 7 最小化安装, 所有节点之间做好 ssh 免密并成功登录一 ## 单节点k8s部署 1. 执行 download.sh 下载需要的包 -2. 修改 single.env 里面的apiserver地址, 单节点就填自己的 ip +2. 修改 .env 里面的apiserver地址, 单节点就填自己的 ip 3. 执行 single.sh 即可创建单 master k8s ## 集群部署 @@ -37,7 +37,7 @@ centos 7 最小化安装, 所有节点之间做好 ssh 免密并成功登录一 执行 download.sh 下载需要的包 -修改 cluster.env 配置 +修改 .env 配置 执行 cluster.sh 进行初始化 diff --git a/cluster.env b/cluster.env deleted file mode 100644 index 34e837e..0000000 --- a/cluster.env +++ /dev/null @@ -1,10 +0,0 @@ -# master 节点的IP -MASTER1="10.0.0.11" -MASTER2="10.0.0.12" -MASTER3="10.0.0.13" - -# master 节点的网卡设备名 -NETWORK_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 index 6291233..25bce2b 100755 --- a/cluster.sh +++ b/cluster.sh @@ -1,6 +1,6 @@ #!/bin/bash -source cluster.env +source .env if [ $(id -u) != "0" ]; then echo "Error: You must be root to run this script" diff --git a/single.env b/single.env deleted file mode 100644 index dc162e8..0000000 --- a/single.env +++ /dev/null @@ -1,2 +0,0 @@ -# 单节点 填自己的IP地址 -API_SERVER="10.0.0.32" \ No newline at end of file diff --git a/single.sh b/single.sh index 9af828b..1732af5 100755 --- a/single.sh +++ b/single.sh @@ -1,6 +1,6 @@ #!/bin/bash -source single.env +source .env if [ $(id -u) != "0" ]; then echo "Error: You must be root to run this script"