2017-11-11 19:14:21 +08:00
|
|
|
|
# 部署节点:运行ansible 脚本的节点
|
|
|
|
|
[deploy]
|
|
|
|
|
192.168.1.1
|
|
|
|
|
|
2017-11-21 09:26:51 +08:00
|
|
|
|
# etcd集群请提供如下NODE_NAME、NODE_IP变量
|
|
|
|
|
# 请注意etcd集群必须是1,3,5,7...奇数个节点
|
2017-11-11 19:14:21 +08:00
|
|
|
|
[etcd]
|
|
|
|
|
192.168.1.1 NODE_NAME=etcd1 NODE_IP="192.168.1.1"
|
|
|
|
|
|
|
|
|
|
[kube-master]
|
2017-11-21 09:26:51 +08:00
|
|
|
|
192.168.1.1 NODE_IP="192.168.1.1"
|
2017-11-11 19:14:21 +08:00
|
|
|
|
|
|
|
|
|
#确保node节点有变量NODE_ID=node1
|
|
|
|
|
[kube-node]
|
|
|
|
|
192.168.1.1 NODE_ID=node1 NODE_IP="192.168.1.1"
|
|
|
|
|
|
|
|
|
|
[kube-cluster:children]
|
|
|
|
|
kube-node
|
|
|
|
|
kube-master
|
|
|
|
|
|
2017-12-25 15:05:21 +08:00
|
|
|
|
# 如果启用harbor,请配置后面harbor相关参数
|
|
|
|
|
[harbor]
|
|
|
|
|
#10.100.97.44 NODE_IP="192.168.1.8"
|
|
|
|
|
|
2017-11-21 09:26:51 +08:00
|
|
|
|
[all:vars]
|
2017-11-11 19:14:21 +08:00
|
|
|
|
# ---------集群主要参数---------------
|
|
|
|
|
#集群 MASTER IP
|
|
|
|
|
MASTER_IP="192.168.1.1"
|
|
|
|
|
|
|
|
|
|
#集群 APISERVER
|
|
|
|
|
KUBE_APISERVER="https://192.168.1.1:6443"
|
|
|
|
|
|
2017-12-19 17:46:34 +08:00
|
|
|
|
#pause镜像地址
|
|
|
|
|
POD_INFRA_CONTAINER_IMAGE=mirrorgooglecontainers/pause-amd64:3.0
|
|
|
|
|
|
2017-11-11 19:14:21 +08:00
|
|
|
|
#TLS Bootstrapping 使用的 Token,使用 head -c 16 /dev/urandom | od -An -t x | tr -d ' ' 生成
|
|
|
|
|
BOOTSTRAP_TOKEN="d18f94b5fa585c7123f56803d925d2e7"
|
|
|
|
|
|
|
|
|
|
# 服务网段 (Service CIDR),部署前路由不可达,部署后集群内使用 IP:Port 可达
|
|
|
|
|
SERVICE_CIDR="10.68.0.0/16"
|
|
|
|
|
|
2017-11-30 15:01:24 +08:00
|
|
|
|
# POD 网段 (Cluster CIDR),部署前路由不可达,**部署后**路由可达
|
2017-11-11 19:14:21 +08:00
|
|
|
|
CLUSTER_CIDR="172.20.0.0/16"
|
|
|
|
|
|
|
|
|
|
# 服务端口范围 (NodePort Range)
|
2017-12-17 17:48:44 +08:00
|
|
|
|
NODE_PORT_RANGE="20000-40000"
|
2017-11-11 19:14:21 +08:00
|
|
|
|
|
|
|
|
|
# kubernetes 服务 IP (预分配,一般是 SERVICE_CIDR 中第一个IP)
|
|
|
|
|
CLUSTER_KUBERNETES_SVC_IP="10.68.0.1"
|
|
|
|
|
|
|
|
|
|
# 集群 DNS 服务 IP (从 SERVICE_CIDR 中预分配)
|
|
|
|
|
CLUSTER_DNS_SVC_IP="10.68.0.2"
|
|
|
|
|
|
|
|
|
|
# 集群 DNS 域名
|
|
|
|
|
CLUSTER_DNS_DOMAIN="cluster.local."
|
|
|
|
|
|
|
|
|
|
# etcd 集群间通信的IP和端口, **根据实际 etcd 集群成员设置**
|
|
|
|
|
ETCD_NODES="etcd1=https://192.168.1.1:2380"
|
|
|
|
|
|
|
|
|
|
# etcd 集群服务地址列表, **根据实际 etcd 集群成员设置**
|
|
|
|
|
ETCD_ENDPOINTS="https://192.168.1.1:2379"
|
|
|
|
|
|
|
|
|
|
# 集群basic auth 使用的用户名和密码
|
|
|
|
|
BASIC_AUTH_USER="admin"
|
|
|
|
|
BASIC_AUTH_PASS="test1234"
|
|
|
|
|
|
|
|
|
|
# ---------附加参数--------------------
|
|
|
|
|
#默认二进制文件目录
|
|
|
|
|
bin_dir="/root/local/bin"
|
|
|
|
|
|
|
|
|
|
#证书目录
|
|
|
|
|
ca_dir="/etc/kubernetes/ssl"
|
|
|
|
|
|
|
|
|
|
#部署目录,即 ansible 工作目录
|
|
|
|
|
base_dir="/etc/ansible"
|
|
|
|
|
|
|
|
|
|
#私有仓库 harbor服务器 (域名或者IP)
|
2017-12-25 15:05:21 +08:00
|
|
|
|
#HARBOR_IP="192.168.1.8"
|
|
|
|
|
#HARBOR_DOMAIN="harbor.yourdomain.com"
|