mirror of https://github.com/easzlab/kubeasz.git
修正example hosts files
parent
42b7cd782b
commit
95f70eb5e7
|
@ -2,12 +2,13 @@
|
|||
[deploy]
|
||||
192.168.1.1
|
||||
|
||||
#etcd集群请提供如下NODE_NAME、NODE_IP变量
|
||||
# etcd集群请提供如下NODE_NAME、NODE_IP变量
|
||||
# 请注意etcd集群必须是1,3,5,7...奇数个节点
|
||||
[etcd]
|
||||
192.168.1.1 NODE_NAME=etcd1 NODE_IP="192.168.1.1"
|
||||
|
||||
[kube-master]
|
||||
192.168.1.1
|
||||
192.168.1.1 NODE_IP="192.168.1.1"
|
||||
|
||||
#确保node节点有变量NODE_ID=node1
|
||||
[kube-node]
|
||||
|
@ -17,7 +18,7 @@
|
|||
kube-node
|
||||
kube-master
|
||||
|
||||
[kube-cluster:vars]
|
||||
[all:vars]
|
||||
# ---------集群主要参数---------------
|
||||
#集群 MASTER IP
|
||||
MASTER_IP="192.168.1.1"
|
||||
|
|
|
@ -1,49 +1,51 @@
|
|||
# 部署节点:运行这份 ansible 脚本的节点
|
||||
[deploy]
|
||||
192.168.1.1
|
||||
|
||||
# 负载均衡至少两个节点,安装 haproxy+keepalived
|
||||
[lb]
|
||||
192.168.1.1 LB_NAME=lb1 LB_IF="eth0" LB_ROLE=master
|
||||
192.168.1.2 LB_NAME=lb2 LB_IF="eth0" LB_ROLE=backup
|
||||
[lb:vars]
|
||||
LB_EP1="192.168.1.1:6443" # api-server 实际成员地址端口
|
||||
LB_EP2="192.168.1.2:6443" # api-server 实际成员地址端口
|
||||
MASTER_IP="192.168.1.100" # api-server 虚地址
|
||||
MASTER_PORT="8443" # api-server 服务端口
|
||||
192.168.1.31
|
||||
|
||||
# etcd集群请提供如下NODE_NAME、NODE_IP变量
|
||||
# 请注意etcd集群必须是3,5,7...奇数个节点
|
||||
# 请注意etcd集群必须是1,3,5,7...奇数个节点
|
||||
[etcd]
|
||||
192.168.1.1 NODE_NAME=etcd1 NODE_IP="192.168.1.1"
|
||||
192.168.1.2 NODE_NAME=etcd2 NODE_IP="192.168.1.2"
|
||||
192.168.1.3 NODE_NAME=etcd3 NODE_IP="192.168.1.3"
|
||||
192.168.1.32 NODE_NAME=etcd1 NODE_IP="192.168.1.32"
|
||||
192.168.1.33 NODE_NAME=etcd2 NODE_IP="192.168.1.33"
|
||||
192.168.1.62 NODE_NAME=etcd3 NODE_IP="192.168.1.62"
|
||||
|
||||
[kube-master]
|
||||
192.168.1.1
|
||||
192.168.1.2
|
||||
192.168.1.34 NODE_IP="192.168.1.34"
|
||||
192.168.1.35 NODE_IP="192.168.1.35"
|
||||
192.168.1.63 NODE_IP="192.168.1.63"
|
||||
|
||||
# 负载均衡至少两个节点,安装 haproxy+keepalived
|
||||
# 根据master节点数量同步修改roles/lb/templates/haproxy.cfg.j2
|
||||
[lb]
|
||||
192.168.1.31 LB_IF="ens3" LB_ROLE=backup
|
||||
192.168.1.61 LB_IF="ens3" LB_ROLE=master
|
||||
[lb:vars]
|
||||
LB_EP1="192.168.1.34:6443" # api-server 实际成员地址端口
|
||||
LB_EP2="192.168.1.35:6443" # api-server 实际成员地址端口
|
||||
LB_EP3="192.168.1.63:6443" # api-server 实际成员地址端口
|
||||
MASTER_IP="192.168.1.30" # api-server 虚地址
|
||||
MASTER_PORT="6443" # api-server 服务端口
|
||||
|
||||
#确保node节点有变量NODE_ID=node1
|
||||
[kube-node]
|
||||
192.168.1.1 NODE_ID=node1 NODE_IP="192.168.1.1"
|
||||
192.168.1.2 NODE_ID=node2 NODE_IP="192.168.1.2"
|
||||
192.168.1.3 NODE_ID=node3 NODE_IP="192.168.1.3"
|
||||
192.168.1.4 NODE_ID=node4 NODE_IP="192.168.1.4"
|
||||
192.168.1.5 NODE_ID=node5 NODE_IP="192.168.1.5"
|
||||
192.168.1.36 NODE_ID=node1 NODE_IP="192.168.1.36"
|
||||
192.168.1.37 NODE_ID=node2 NODE_IP="192.168.1.37"
|
||||
192.168.1.64 NODE_ID=node3 NODE_IP="192.168.1.64"
|
||||
192.168.1.65 NODE_ID=node4 NODE_IP="192.168.1.65"
|
||||
192.168.1.66 NODE_ID=node5 NODE_IP="192.168.1.66"
|
||||
|
||||
[kube-cluster:children]
|
||||
kube-node
|
||||
kube-master
|
||||
lb
|
||||
|
||||
[kube-cluster:vars]
|
||||
[all:vars]
|
||||
# ---------集群主要参数---------------
|
||||
#集群 MASTER IP, 需要外部负载均衡,一般为VIP地址
|
||||
MASTER_IP="192.168.1.100"
|
||||
KUBE_APISERVER="https://192.168.1.100:8443"
|
||||
MASTER_IP="192.168.1.30"
|
||||
KUBE_APISERVER="https://192.168.1.30:6443"
|
||||
|
||||
#TLS Bootstrapping 使用的 Token,使用 head -c 16 /dev/urandom | od -An -t x | tr -d ' ' 生成
|
||||
BOOTSTRAP_TOKEN="d18f94b5fa585c7123f56803d925d2e7"
|
||||
BOOTSTRAP_TOKEN="c30302226d4b810e08731702d3890f50"
|
||||
|
||||
# 服务网段 (Service CIDR),部署前路由不可达,部署后集群内使用 IP:Port 可达
|
||||
SERVICE_CIDR="10.68.0.0/16"
|
||||
|
@ -67,10 +69,10 @@ CLUSTER_DNS_SVC_IP="10.68.0.2"
|
|||
CLUSTER_DNS_DOMAIN="cluster.local."
|
||||
|
||||
# etcd 集群间通信的IP和端口, **根据实际 etcd 集群成员设置**
|
||||
ETCD_NODES="etcd1=https://192.168.1.1:2380,etcd2=https://192.168.1.2:2380,etcd3=https://192.168.1.3:2380"
|
||||
ETCD_NODES="etcd1=https://192.168.1.32:2380,etcd2=https://192.168.1.33:2380,etcd3=https://192.168.1.62:2380"
|
||||
|
||||
# etcd 集群服务地址列表, **根据实际 etcd 集群成员设置**
|
||||
ETCD_ENDPOINTS="https://192.168.1.1:2379,https://192.168.1.2:2379,https://192.168.1.3:2379"
|
||||
ETCD_ENDPOINTS="https://192.168.1.32:2379,https://192.168.1.33:2379,https://192.168.1.62:2379"
|
||||
|
||||
# 集群basic auth 使用的用户名和密码
|
||||
BASIC_AUTH_USER="admin"
|
||||
|
@ -88,4 +90,4 @@ base_dir="/etc/ansible"
|
|||
|
||||
#私有仓库 harbor服务器 (域名或者IP)
|
||||
#需要把 harbor服务器证书复制到roles/harbor/files/harbor-ca.crt
|
||||
HARBOR_SERVER="harbor.yourdomain.com"
|
||||
HARBOR_SERVER="harbor.mydomain.com"
|
||||
|
|
|
@ -2,14 +2,15 @@
|
|||
[deploy]
|
||||
192.168.1.1
|
||||
|
||||
#etcd集群请提供如下NODE_NAME、NODE_IP变量
|
||||
# etcd集群请提供如下NODE_NAME、NODE_IP变量
|
||||
# 请注意etcd集群必须是1,3,5,7...奇数个节点
|
||||
[etcd]
|
||||
192.168.1.1 NODE_NAME=etcd1 NODE_IP="192.168.1.1"
|
||||
192.168.1.2 NODE_NAME=etcd2 NODE_IP="192.168.1.2"
|
||||
192.168.1.3 NODE_NAME=etcd3 NODE_IP="192.168.1.3"
|
||||
|
||||
[kube-master]
|
||||
192.168.1.1
|
||||
192.168.1.1 NODE_IP="192.168.1.1"
|
||||
|
||||
#确保node节点有变量NODE_ID=node1
|
||||
[kube-node]
|
||||
|
@ -21,7 +22,7 @@
|
|||
kube-node
|
||||
kube-master
|
||||
|
||||
[kube-cluster:vars]
|
||||
[all:vars]
|
||||
# ---------集群主要参数---------------
|
||||
#集群 MASTER IP
|
||||
MASTER_IP="192.168.1.1"
|
||||
|
|
Loading…
Reference in New Issue