2018-11-27 16:00:45 +08:00
|
|
|
|
# 集群部署节点:一般为运行ansible 脚本的节点
|
|
|
|
|
# 变量 NTP_ENABLED (=yes/no) 设置集群是否安装 chrony 时间同步
|
2017-11-11 19:14:21 +08:00
|
|
|
|
[deploy]
|
2018-08-17 09:18:55 +08:00
|
|
|
|
192.168.1.1 NTP_ENABLED=no
|
2017-11-11 19:14:21 +08:00
|
|
|
|
|
2018-11-27 16:00:45 +08:00
|
|
|
|
# etcd集群请提供如下NODE_NAME,注意etcd集群必须是1,3,5,7...奇数个节点
|
2017-11-11 19:14:21 +08:00
|
|
|
|
[etcd]
|
2018-06-09 22:19:20 +08:00
|
|
|
|
192.168.1.1 NODE_NAME=etcd1
|
|
|
|
|
192.168.1.2 NODE_NAME=etcd2
|
|
|
|
|
192.168.1.3 NODE_NAME=etcd3
|
2017-11-11 19:14:21 +08:00
|
|
|
|
|
|
|
|
|
[kube-master]
|
2018-06-09 22:19:20 +08:00
|
|
|
|
192.168.1.1
|
|
|
|
|
192.168.1.2
|
2017-11-21 09:26:51 +08:00
|
|
|
|
|
2017-11-11 19:14:21 +08:00
|
|
|
|
[kube-node]
|
2018-06-09 22:19:20 +08:00
|
|
|
|
192.168.1.3
|
|
|
|
|
192.168.1.4
|
2017-11-11 19:14:21 +08:00
|
|
|
|
|
2018-11-27 16:00:45 +08:00
|
|
|
|
# 参数 NEW_INSTALL:yes表示新建,no表示使用已有harbor服务器
|
2019-02-07 15:10:49 +08:00
|
|
|
|
# 如果不使用域名,可以设置 HARBOR_DOMAIN=""
|
2017-12-25 15:05:21 +08:00
|
|
|
|
[harbor]
|
2018-08-26 10:58:27 +08:00
|
|
|
|
#192.168.1.8 HARBOR_DOMAIN="harbor.yourdomain.com" NEW_INSTALL=no
|
2017-12-25 15:05:21 +08:00
|
|
|
|
|
2019-02-15 09:36:08 +08:00
|
|
|
|
# 负载均衡(目前已支持多于2节点,一般2节点就够了) 安装 haproxy+keepalived
|
|
|
|
|
[lb]
|
|
|
|
|
192.168.1.1 LB_ROLE=backup
|
|
|
|
|
192.168.1.2 LB_ROLE=master
|
2017-11-25 21:37:43 +08:00
|
|
|
|
|
2019-02-07 15:10:49 +08:00
|
|
|
|
#【可选】外部负载均衡,用于自有环境负载转发 NodePort 暴露的服务等
|
|
|
|
|
[ex-lb]
|
|
|
|
|
#192.168.1.6 LB_ROLE=backup EX_VIP=192.168.1.250
|
|
|
|
|
#192.168.1.7 LB_ROLE=master EX_VIP=192.168.1.250
|
|
|
|
|
|
2017-11-21 09:26:51 +08:00
|
|
|
|
[all:vars]
|
2018-11-27 16:00:45 +08:00
|
|
|
|
# ---------集群主要参数---------------
|
|
|
|
|
#集群部署模式:allinone, single-master, multi-master
|
2018-03-16 18:23:34 +08:00
|
|
|
|
DEPLOY_MODE=multi-master
|
|
|
|
|
|
2018-11-27 16:00:45 +08:00
|
|
|
|
# 集群 MASTER IP即 LB节点VIP地址,为区别与默认apiserver端口,设置VIP监听的服务端口8443
|
|
|
|
|
# 公有云上请使用云负载均衡内网地址和监听端口
|
2017-11-30 15:01:24 +08:00
|
|
|
|
MASTER_IP="192.168.1.10"
|
2018-06-09 17:57:17 +08:00
|
|
|
|
KUBE_APISERVER="https://{{ MASTER_IP }}:8443"
|
2017-11-11 19:14:21 +08:00
|
|
|
|
|
2018-11-27 16:00:45 +08:00
|
|
|
|
# 集群网络插件,目前支持calico, flannel, kube-router, cilium
|
2018-02-25 12:30:15 +08:00
|
|
|
|
CLUSTER_NETWORK="flannel"
|
2018-01-02 22:12:51 +08:00
|
|
|
|
|
2018-11-27 16:00:45 +08:00
|
|
|
|
# 服务网段 (Service CIDR),注意不要与内网已有网段冲突
|
2017-11-11 19:14:21 +08:00
|
|
|
|
SERVICE_CIDR="10.68.0.0/16"
|
|
|
|
|
|
2018-11-27 16:00:45 +08:00
|
|
|
|
# POD 网段 (Cluster CIDR),注意不要与内网已有网段冲突
|
2017-11-11 19:14:21 +08:00
|
|
|
|
CLUSTER_CIDR="172.20.0.0/16"
|
|
|
|
|
|
2018-11-27 16:00:45 +08:00
|
|
|
|
# 服务端口范围 (NodePort Range)
|
2017-12-17 17:48:44 +08:00
|
|
|
|
NODE_PORT_RANGE="20000-40000"
|
2017-11-11 19:14:21 +08:00
|
|
|
|
|
2018-11-27 16:00:45 +08:00
|
|
|
|
# kubernetes 服务 IP (预分配,一般是 SERVICE_CIDR 中第一个IP)
|
2017-11-11 19:14:21 +08:00
|
|
|
|
CLUSTER_KUBERNETES_SVC_IP="10.68.0.1"
|
|
|
|
|
|
2018-11-27 16:00:45 +08:00
|
|
|
|
# 集群 DNS 服务 IP (从 SERVICE_CIDR 中预分配)
|
2017-11-11 19:14:21 +08:00
|
|
|
|
CLUSTER_DNS_SVC_IP="10.68.0.2"
|
|
|
|
|
|
2018-11-27 16:00:45 +08:00
|
|
|
|
# 集群 DNS 域名
|
2017-11-11 19:14:21 +08:00
|
|
|
|
CLUSTER_DNS_DOMAIN="cluster.local."
|
|
|
|
|
|
2018-11-27 16:00:45 +08:00
|
|
|
|
# ---------附加参数--------------------
|
|
|
|
|
#默认二进制文件目录
|
2018-05-06 09:08:09 +08:00
|
|
|
|
bin_dir="/opt/kube/bin"
|
2017-11-11 19:14:21 +08:00
|
|
|
|
|
2018-11-27 16:00:45 +08:00
|
|
|
|
#证书目录
|
2017-11-11 19:14:21 +08:00
|
|
|
|
ca_dir="/etc/kubernetes/ssl"
|
|
|
|
|
|
2018-11-27 16:00:45 +08:00
|
|
|
|
#部署目录,即 ansible 工作目录,建议不要修改
|
2017-11-11 19:14:21 +08:00
|
|
|
|
base_dir="/etc/ansible"
|