From 7515816c74828f5d69d8a51c0f92b2cb59a9975b Mon Sep 17 00:00:00 2001 From: gjmzj Date: Tue, 27 Nov 2018 16:00:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0example=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- example/hosts.allinone.example | 43 ++++++++------- example/hosts.allinone.example.en | 70 +++++++++++++++++++++++++ example/hosts.cloud.example | 49 +++++++++-------- example/hosts.cloud.example.en | 81 ++++++++++++++++++++++++++++ example/hosts.m-masters.example | 49 +++++++++-------- example/hosts.m-masters.example.en | 84 ++++++++++++++++++++++++++++++ example/hosts.s-master.example | 43 ++++++++------- example/hosts.s-master.example.en | 71 +++++++++++++++++++++++++ 8 files changed, 396 insertions(+), 94 deletions(-) create mode 100644 example/hosts.allinone.example.en create mode 100644 example/hosts.cloud.example.en create mode 100644 example/hosts.m-masters.example.en create mode 100644 example/hosts.s-master.example.en diff --git a/example/hosts.allinone.example b/example/hosts.allinone.example index 63cbf12..14c0f62 100644 --- a/example/hosts.allinone.example +++ b/example/hosts.allinone.example @@ -1,10 +1,9 @@ -# 'deploy' node, which the ansible-playbooks usually run on -# variable 'NTP_ENABLED(=yes/no)' enables/disables the NTP server 'chrony' +# 集群部署节点:一般为运行ansible 脚本的节点 +# 变量 NTP_ENABLED (=yes/no) 设置集群是否安装 chrony 时间同步 [deploy] 192.168.1.1 NTP_ENABLED=no -# 'etcd' cluster must have odd member(s) (1,3,5,...) -# variable 'NODE_NAME' is the distinct name of a member in 'etcd' cluster +# etcd集群请提供如下NODE_NAME,注意etcd集群必须是1,3,5,7...奇数个节点 [etcd] 192.168.1.1 NODE_NAME=etcd1 @@ -14,57 +13,57 @@ [kube-node] 192.168.1.1 -# variable NEW_INSTALL: 'yes' to setup a new harbor server; 'no' to integrate with existed one +# 参数 NEW_INSTALL:yes表示新建,no表示使用已有harbor服务器 [harbor] #192.168.1.8 HARBOR_DOMAIN="harbor.yourdomain.com" NEW_INSTALL=no -# group reserved, add new 'kube-node' in it +# 预留组,后续添加node节点使用 [new-node] #192.168.1.xx [all:vars] -# --------- Main Variables --------------- -# Cluster Deployment Mode: allinone, single-master, multi-master +# ---------集群主要参数--------------- +#集群部署模式:allinone, single-master, multi-master DEPLOY_MODE=allinone -# Versions supported: v1.8, v1.9, v1.10, v1.11, v1.12 +#集群主版本号,目前支持: v1.8, v1.9, v1.10,v1.11, v1.12 K8S_VER="v1.10" -# Cluster's Master IP, auto generated +#集群 MASTER IP,自动生成 MASTER_IP="{{ groups['kube-master'][0] }}" KUBE_APISERVER="https://{{ MASTER_IP }}:6443" -# Network plugins supported: calico, flannel, kube-router, cilium +# 集群网络插件,目前支持calico, flannel, kube-router, cilium CLUSTER_NETWORK="flannel" -# K8S Service CIDR, not overlap with node(host) networking +# 服务网段 (Service CIDR),注意不要与内网已有网段冲突 SERVICE_CIDR="10.68.0.0/16" -# Cluster CIDR (Pod CIDR), not overlap with node(host) networking +# POD 网段 (Cluster CIDR),注意不要与内网已有网段冲突 CLUSTER_CIDR="172.20.0.0/16" -# NodePort Range +# 服务端口范围 (NodePort Range) NODE_PORT_RANGE="20000-40000" -# Kubernetes SVC IP (usually assigned with the first available IP of 'SERVICE_CIDR') +# kubernetes 服务 IP (预分配,一般是 SERVICE_CIDR 中第一个IP) CLUSTER_KUBERNETES_SVC_IP="10.68.0.1" -# Cluster DNS Server's IP (assigned with an available IP of 'SERVICE_CIDR') +# 集群 DNS 服务 IP (从 SERVICE_CIDR 中预分配) CLUSTER_DNS_SVC_IP="10.68.0.2" -# Cluster DNS Domain +# 集群 DNS 域名 CLUSTER_DNS_DOMAIN="cluster.local." -# Basic auth for apiserver +# 集群basic auth 使用的用户名和密码 BASIC_AUTH_USER="admin" BASIC_AUTH_PASS="test1234" -# -------- Additional Variables -------------------- -# Binaries Directory +# ---------附加参数-------------------- +#默认二进制文件目录 bin_dir="/opt/kube/bin" -# CA and other components cert/key Directory +#证书目录 ca_dir="/etc/kubernetes/ssl" -# Deploy Directory (kubeasz workspace), don't change the default value right now +#部署目录,即 ansible 工作目录 base_dir="/etc/ansible" diff --git a/example/hosts.allinone.example.en b/example/hosts.allinone.example.en new file mode 100644 index 0000000..63cbf12 --- /dev/null +++ b/example/hosts.allinone.example.en @@ -0,0 +1,70 @@ +# 'deploy' node, which the ansible-playbooks usually run on +# variable 'NTP_ENABLED(=yes/no)' enables/disables the NTP server 'chrony' +[deploy] +192.168.1.1 NTP_ENABLED=no + +# 'etcd' cluster must have odd member(s) (1,3,5,...) +# variable 'NODE_NAME' is the distinct name of a member in 'etcd' cluster +[etcd] +192.168.1.1 NODE_NAME=etcd1 + +[kube-master] +192.168.1.1 + +[kube-node] +192.168.1.1 + +# variable NEW_INSTALL: 'yes' to setup a new harbor server; 'no' to integrate with existed one +[harbor] +#192.168.1.8 HARBOR_DOMAIN="harbor.yourdomain.com" NEW_INSTALL=no + +# group reserved, add new 'kube-node' in it +[new-node] +#192.168.1.xx + +[all:vars] +# --------- Main Variables --------------- +# Cluster Deployment Mode: allinone, single-master, multi-master +DEPLOY_MODE=allinone + +# Versions supported: v1.8, v1.9, v1.10, v1.11, v1.12 +K8S_VER="v1.10" + +# Cluster's Master IP, auto generated +MASTER_IP="{{ groups['kube-master'][0] }}" +KUBE_APISERVER="https://{{ MASTER_IP }}:6443" + +# Network plugins supported: calico, flannel, kube-router, cilium +CLUSTER_NETWORK="flannel" + +# K8S Service CIDR, not overlap with node(host) networking +SERVICE_CIDR="10.68.0.0/16" + +# Cluster CIDR (Pod CIDR), not overlap with node(host) networking +CLUSTER_CIDR="172.20.0.0/16" + +# NodePort Range +NODE_PORT_RANGE="20000-40000" + +# Kubernetes SVC IP (usually assigned with the first available IP of 'SERVICE_CIDR') +CLUSTER_KUBERNETES_SVC_IP="10.68.0.1" + +# Cluster DNS Server's IP (assigned with an available IP of 'SERVICE_CIDR') +CLUSTER_DNS_SVC_IP="10.68.0.2" + +# Cluster DNS Domain +CLUSTER_DNS_DOMAIN="cluster.local." + +# Basic auth for apiserver +BASIC_AUTH_USER="admin" +BASIC_AUTH_PASS="test1234" + +# -------- Additional Variables -------------------- +# Binaries Directory +bin_dir="/opt/kube/bin" + +# CA and other components cert/key Directory +ca_dir="/etc/kubernetes/ssl" + +# Deploy Directory (kubeasz workspace), don't change the default value right now +base_dir="/etc/ansible" diff --git a/example/hosts.cloud.example b/example/hosts.cloud.example index 742cb18..4de3fd6 100644 --- a/example/hosts.cloud.example +++ b/example/hosts.cloud.example @@ -1,10 +1,9 @@ -# 'deploy' node, which the ansible-playbooks usually run on -# variable 'NTP_ENABLED(=yes/no)' enables/disables the NTP server 'chrony' +# 集群部署节点:一般为运行ansible 脚本的节点 +# 变量 NTP_ENABLED (=yes/no) 设置集群是否安装 chrony 时间同步, 公有云上虚机不需要 [deploy] 192.168.1.1 NTP_ENABLED=no -# 'etcd' cluster must have odd member(s) (1,3,5,...) -# variable 'NODE_NAME' is the distinct name of a member in 'etcd' cluster +# etcd集群请提供如下NODE_NAME,注意etcd集群必须是1,3,5,7...奇数个节点 [etcd] 192.168.1.1 NODE_NAME=etcd1 192.168.1.2 NODE_NAME=etcd2 @@ -14,68 +13,68 @@ 192.168.1.2 192.168.1.3 -# use loadballance service by the Cloud Providor, no 'lb' nodes needed +# 公有云上一般都有提供负载均衡产品,且不允许自己创建,lb 节点留空,仅保留组名 [lb] [kube-node] 192.168.1.1 192.168.1.4 -# variable NEW_INSTALL: 'yes' to setup a new harbor server; 'no' to integrate with existed one +# 参数 NEW_INSTALL:yes表示新建,no表示使用已有harbor服务器 [harbor] #192.168.1.8 HARBOR_DOMAIN="harbor.yourdomain.com" NEW_INSTALL=no -# group reserved, add new 'kube-master' in it +# 预留组,后续添加master节点使用 [new-master] #192.168.1.5 -# group reserved, add new 'kube-node' in it +# 预留组,后续添加node节点使用 [new-node] #192.168.1.xx [all:vars] -# --------- Main Variables --------------- -# Cluster Deployment Mode: allinone, single-master, multi-master +# ---------集群主要参数--------------- +#集群部署模式:allinone, single-master, multi-master DEPLOY_MODE=multi-master -# Versions supported: v1.8, v1.9, v1.10, v1.11, v1.12 +#集群主版本号,目前支持: v1.8, v1.9, v1.10,v1.11, v1.12 K8S_VER="v1.10" -# cloud loadballance service: listen on tcp 8443, with kube-masters(apiservers) as backend servers -MASTER_IP="192.168.1.10" +# 创建内网云负载均衡,然后配置:前端监听 tcp 8443,后端 tcp 6443,后端节点即 master 节点 +MASTER_IP="192.168.1.10" # 即负载均衡内网地址 KUBE_APISERVER="https://{{ MASTER_IP }}:8443" -# Network plugins supported: calico, flannel +# 集群网络插件,目前支持calico, flannel, kube-router, cilium CLUSTER_NETWORK="flannel" -# K8S Service CIDR, not overlap with node(host) networking +# 服务网段 (Service CIDR),注意不要与内网已有网段冲突 SERVICE_CIDR="10.68.0.0/16" -# Cluster CIDR (Pod CIDR), not overlap with node(host) networking +# POD 网段 (Cluster CIDR),注意不要与内网已有网段冲突 CLUSTER_CIDR="172.20.0.0/16" -# NodePort Range +# 服务端口范围 (NodePort Range) NODE_PORT_RANGE="20000-40000" -# Kubernetes SVC IP (usually assigned with the first available IP of 'SERVICE_CIDR') +# kubernetes 服务 IP (预分配,一般是 SERVICE_CIDR 中第一个IP) CLUSTER_KUBERNETES_SVC_IP="10.68.0.1" -# Cluster DNS Server's IP (assigned with an available IP of 'SERVICE_CIDR') +# 集群 DNS 服务 IP (从 SERVICE_CIDR 中预分配) CLUSTER_DNS_SVC_IP="10.68.0.2" -# Cluster DNS Domain +# 集群 DNS 域名 CLUSTER_DNS_DOMAIN="cluster.local." -# Basic auth for apiserver +# 集群basic auth 使用的用户名和密码 BASIC_AUTH_USER="admin" BASIC_AUTH_PASS="test1234" -# -------- Additional Variables -------------------- -# Binaries Directory +# ---------附加参数-------------------- +#默认二进制文件目录 bin_dir="/opt/kube/bin" -# CA and other components cert/key Directory +#证书目录 ca_dir="/etc/kubernetes/ssl" -# Deploy Directory (kubeasz workspace), don't change the default value right now +#部署目录,即 ansible 工作目录,建议不要修改 base_dir="/etc/ansible" diff --git a/example/hosts.cloud.example.en b/example/hosts.cloud.example.en new file mode 100644 index 0000000..742cb18 --- /dev/null +++ b/example/hosts.cloud.example.en @@ -0,0 +1,81 @@ +# 'deploy' node, which the ansible-playbooks usually run on +# variable 'NTP_ENABLED(=yes/no)' enables/disables the NTP server 'chrony' +[deploy] +192.168.1.1 NTP_ENABLED=no + +# 'etcd' cluster must have odd member(s) (1,3,5,...) +# variable 'NODE_NAME' is the distinct name of a member in 'etcd' cluster +[etcd] +192.168.1.1 NODE_NAME=etcd1 +192.168.1.2 NODE_NAME=etcd2 +192.168.1.3 NODE_NAME=etcd3 + +[kube-master] +192.168.1.2 +192.168.1.3 + +# use loadballance service by the Cloud Providor, no 'lb' nodes needed +[lb] + +[kube-node] +192.168.1.1 +192.168.1.4 + +# variable NEW_INSTALL: 'yes' to setup a new harbor server; 'no' to integrate with existed one +[harbor] +#192.168.1.8 HARBOR_DOMAIN="harbor.yourdomain.com" NEW_INSTALL=no + +# group reserved, add new 'kube-master' in it +[new-master] +#192.168.1.5 + +# group reserved, add new 'kube-node' in it +[new-node] +#192.168.1.xx + +[all:vars] +# --------- Main Variables --------------- +# Cluster Deployment Mode: allinone, single-master, multi-master +DEPLOY_MODE=multi-master + +# Versions supported: v1.8, v1.9, v1.10, v1.11, v1.12 +K8S_VER="v1.10" + +# cloud loadballance service: listen on tcp 8443, with kube-masters(apiservers) as backend servers +MASTER_IP="192.168.1.10" +KUBE_APISERVER="https://{{ MASTER_IP }}:8443" + +# Network plugins supported: calico, flannel +CLUSTER_NETWORK="flannel" + +# K8S Service CIDR, not overlap with node(host) networking +SERVICE_CIDR="10.68.0.0/16" + +# Cluster CIDR (Pod CIDR), not overlap with node(host) networking +CLUSTER_CIDR="172.20.0.0/16" + +# NodePort Range +NODE_PORT_RANGE="20000-40000" + +# Kubernetes SVC IP (usually assigned with the first available IP of 'SERVICE_CIDR') +CLUSTER_KUBERNETES_SVC_IP="10.68.0.1" + +# Cluster DNS Server's IP (assigned with an available IP of 'SERVICE_CIDR') +CLUSTER_DNS_SVC_IP="10.68.0.2" + +# Cluster DNS Domain +CLUSTER_DNS_DOMAIN="cluster.local." + +# Basic auth for apiserver +BASIC_AUTH_USER="admin" +BASIC_AUTH_PASS="test1234" + +# -------- Additional Variables -------------------- +# Binaries Directory +bin_dir="/opt/kube/bin" + +# CA and other components cert/key Directory +ca_dir="/etc/kubernetes/ssl" + +# Deploy Directory (kubeasz workspace), don't change the default value right now +base_dir="/etc/ansible" diff --git a/example/hosts.m-masters.example b/example/hosts.m-masters.example index 8fe6ae3..df6a07f 100644 --- a/example/hosts.m-masters.example +++ b/example/hosts.m-masters.example @@ -1,10 +1,9 @@ -# 'deploy' node, which the ansible-playbooks usually run on -# variable 'NTP_ENABLED(=yes/no)' enables/disables the NTP server 'chrony' +# 集群部署节点:一般为运行ansible 脚本的节点 +# 变量 NTP_ENABLED (=yes/no) 设置集群是否安装 chrony 时间同步 [deploy] 192.168.1.1 NTP_ENABLED=no -# 'etcd' cluster must have odd member(s) (1,3,5,...) -# variable 'NODE_NAME' is the distinct name of a member in 'etcd' cluster +# etcd集群请提供如下NODE_NAME,注意etcd集群必须是1,3,5,7...奇数个节点 [etcd] 192.168.1.1 NODE_NAME=etcd1 192.168.1.2 NODE_NAME=etcd2 @@ -14,7 +13,7 @@ 192.168.1.1 192.168.1.2 -# 'loadbalance' node, with 'haproxy+keepalived' installed +# 负载均衡(目前已支持多于2节点,一般2节点就够了) 安装 haproxy+keepalived [lb] 192.168.1.1 LB_ROLE=backup 192.168.1.2 LB_ROLE=master @@ -23,62 +22,62 @@ 192.168.1.3 192.168.1.4 -# variable NEW_INSTALL: 'yes' to setup a new harbor server; 'no' to integrate with existed one +# 参数 NEW_INSTALL:yes表示新建,no表示使用已有harbor服务器 [harbor] #192.168.1.8 HARBOR_DOMAIN="harbor.yourdomain.com" NEW_INSTALL=no -# group reserved, add new 'kube-master' in it +# 预留组,后续添加master节点使用 [new-master] #192.168.1.5 -# group reserved, add new 'kube-node' in it +# 预留组,后续添加node节点使用 [new-node] #192.168.1.xx [all:vars] -# --------- Main Variables --------------- -# Cluster Deployment Mode: allinone, single-master, multi-master +# ---------集群主要参数--------------- +#集群部署模式:allinone, single-master, multi-master DEPLOY_MODE=multi-master -# Versions supported: v1.8, v1.9, v1.10, v1.11, v1.12 +#集群主版本号,目前支持: v1.8, v1.9, v1.10,v1.11, v1.12 K8S_VER="v1.10" -# Cluster's Master IP, generated by 'keepalived' daemon on a 'lb' node here -# 'haproxy' daemon listens on port 8443, directs requests to real apiservers on port 6443 +# 集群 MASTER IP即 LB节点VIP地址,为区别与默认apiserver端口,设置VIP监听的服务端口8443 +# 公有云上请使用云负载均衡内网地址和监听端口 MASTER_IP="192.168.1.10" KUBE_APISERVER="https://{{ MASTER_IP }}:8443" -# Network plugins supported: calico, flannel, kube-router, cilium +# 集群网络插件,目前支持calico, flannel, kube-router, cilium CLUSTER_NETWORK="flannel" -# K8S Service CIDR, not overlap with node(host) networking +# 服务网段 (Service CIDR),注意不要与内网已有网段冲突 SERVICE_CIDR="10.68.0.0/16" -# Cluster CIDR (Pod CIDR), not overlap with node(host) networking +# POD 网段 (Cluster CIDR),注意不要与内网已有网段冲突 CLUSTER_CIDR="172.20.0.0/16" -# NodePort Range +# 服务端口范围 (NodePort Range) NODE_PORT_RANGE="20000-40000" -# Kubernetes SVC IP (usually assigned with the first available IP of 'SERVICE_CIDR') +# kubernetes 服务 IP (预分配,一般是 SERVICE_CIDR 中第一个IP) CLUSTER_KUBERNETES_SVC_IP="10.68.0.1" -# Cluster DNS Server's IP (assigned with an available IP of 'SERVICE_CIDR') +# 集群 DNS 服务 IP (从 SERVICE_CIDR 中预分配) CLUSTER_DNS_SVC_IP="10.68.0.2" -# Cluster DNS Domain +# 集群 DNS 域名 CLUSTER_DNS_DOMAIN="cluster.local." -# Basic auth for apiserver +# 集群basic auth 使用的用户名和密码 BASIC_AUTH_USER="admin" BASIC_AUTH_PASS="test1234" -# -------- Additional Variables -------------------- -# Binaries Directory +# ---------附加参数-------------------- +#默认二进制文件目录 bin_dir="/opt/kube/bin" -# CA and other components cert/key Directory +#证书目录 ca_dir="/etc/kubernetes/ssl" -# Deploy Directory (kubeasz workspace), don't change the default value right now +#部署目录,即 ansible 工作目录,建议不要修改 base_dir="/etc/ansible" diff --git a/example/hosts.m-masters.example.en b/example/hosts.m-masters.example.en new file mode 100644 index 0000000..8fe6ae3 --- /dev/null +++ b/example/hosts.m-masters.example.en @@ -0,0 +1,84 @@ +# 'deploy' node, which the ansible-playbooks usually run on +# variable 'NTP_ENABLED(=yes/no)' enables/disables the NTP server 'chrony' +[deploy] +192.168.1.1 NTP_ENABLED=no + +# 'etcd' cluster must have odd member(s) (1,3,5,...) +# variable 'NODE_NAME' is the distinct name of a member in 'etcd' cluster +[etcd] +192.168.1.1 NODE_NAME=etcd1 +192.168.1.2 NODE_NAME=etcd2 +192.168.1.3 NODE_NAME=etcd3 + +[kube-master] +192.168.1.1 +192.168.1.2 + +# 'loadbalance' node, with 'haproxy+keepalived' installed +[lb] +192.168.1.1 LB_ROLE=backup +192.168.1.2 LB_ROLE=master + +[kube-node] +192.168.1.3 +192.168.1.4 + +# variable NEW_INSTALL: 'yes' to setup a new harbor server; 'no' to integrate with existed one +[harbor] +#192.168.1.8 HARBOR_DOMAIN="harbor.yourdomain.com" NEW_INSTALL=no + +# group reserved, add new 'kube-master' in it +[new-master] +#192.168.1.5 + +# group reserved, add new 'kube-node' in it +[new-node] +#192.168.1.xx + +[all:vars] +# --------- Main Variables --------------- +# Cluster Deployment Mode: allinone, single-master, multi-master +DEPLOY_MODE=multi-master + +# Versions supported: v1.8, v1.9, v1.10, v1.11, v1.12 +K8S_VER="v1.10" + +# Cluster's Master IP, generated by 'keepalived' daemon on a 'lb' node here +# 'haproxy' daemon listens on port 8443, directs requests to real apiservers on port 6443 +MASTER_IP="192.168.1.10" +KUBE_APISERVER="https://{{ MASTER_IP }}:8443" + +# Network plugins supported: calico, flannel, kube-router, cilium +CLUSTER_NETWORK="flannel" + +# K8S Service CIDR, not overlap with node(host) networking +SERVICE_CIDR="10.68.0.0/16" + +# Cluster CIDR (Pod CIDR), not overlap with node(host) networking +CLUSTER_CIDR="172.20.0.0/16" + +# NodePort Range +NODE_PORT_RANGE="20000-40000" + +# Kubernetes SVC IP (usually assigned with the first available IP of 'SERVICE_CIDR') +CLUSTER_KUBERNETES_SVC_IP="10.68.0.1" + +# Cluster DNS Server's IP (assigned with an available IP of 'SERVICE_CIDR') +CLUSTER_DNS_SVC_IP="10.68.0.2" + +# Cluster DNS Domain +CLUSTER_DNS_DOMAIN="cluster.local." + +# Basic auth for apiserver +BASIC_AUTH_USER="admin" +BASIC_AUTH_PASS="test1234" + +# -------- Additional Variables -------------------- +# Binaries Directory +bin_dir="/opt/kube/bin" + +# CA and other components cert/key Directory +ca_dir="/etc/kubernetes/ssl" + +# Deploy Directory (kubeasz workspace), don't change the default value right now +base_dir="/etc/ansible" diff --git a/example/hosts.s-master.example b/example/hosts.s-master.example index 52f8060..8d4146b 100644 --- a/example/hosts.s-master.example +++ b/example/hosts.s-master.example @@ -1,10 +1,9 @@ -# 'deploy' node, which the ansible-playbooks usually run on -# variable 'NTP_ENABLED(=yes/no)' enables/disables the NTP server 'chrony' +# 集群部署节点:一般为运行ansible 脚本的节点 +# 变量 NTP_ENABLED (=yes/no) 设置集群是否安装 chrony 时间同步 [deploy] 192.168.1.1 NTP_ENABLED=no -# 'etcd' cluster must have odd member(s) (1,3,5,...) -# variable 'NODE_NAME' is the distinct name of a member in 'etcd' cluster +# etcd集群请提供如下NODE_NAME,请注意etcd集群必须是1,3,5,7...奇数个节点 [etcd] 192.168.1.1 NODE_NAME=etcd1 @@ -15,57 +14,57 @@ 192.168.1.2 192.168.1.3 -# variable NEW_INSTALL: 'yes' to setup a new harbor server; 'no' to integrate with existed one +# 参数 NEW_INSTALL:yes表示新建,no表示使用已有harbor服务器 [harbor] #192.168.1.8 HARBOR_DOMAIN="harbor.yourdomain.com" NEW_INSTALL=no -# group reserved, add new 'kube-node' in it +# 预留组,后续添加node节点使用 [new-node] #192.168.1.xx [all:vars] -# --------- Main Variables --------------- -# Cluster Deployment Mode: allinone, single-master, multi-master +# ---------集群主要参数--------------- +#集群部署模式:allinone, single-master, multi-master DEPLOY_MODE=single-master -# Versions supported: v1.8, v1.9, v1.10, v1.11, v1.12 +#集群主版本号,目前支持: v1.8, v1.9, v1.10,v1.11, v1.12 K8S_VER="v1.11" -# Cluster's Master IP, auto generated +#集群 MASTER IP,自动生成 MASTER_IP="{{ groups['kube-master'][0] }}" KUBE_APISERVER="https://{{ MASTER_IP }}:6443" -# Network plugins supported: calico, flannel, kube-router, cilium +# 集群网络插件,目前支持calico, flannel, kube-router, cilium CLUSTER_NETWORK="flannel" -# K8S Service CIDR, not overlap with node(host) networking +# 服务网段 (Service CIDR),注意不要与内网已有网段冲突 SERVICE_CIDR="10.68.0.0/16" -# Cluster CIDR (Pod CIDR), not overlap with node(host) networking +# POD 网段 (Cluster CIDR),注意不要与内网已有网段冲突 CLUSTER_CIDR="172.20.0.0/16" -# NodePort Range +# 服务端口范围 (NodePort Range) NODE_PORT_RANGE="20000-40000" -# Kubernetes SVC IP (usually assigned with the first available IP of 'SERVICE_CIDR') +# kubernetes 服务 IP (预分配,一般是 SERVICE_CIDR 中第一个IP) CLUSTER_KUBERNETES_SVC_IP="10.68.0.1" -# Cluster DNS Server's IP (assigned with an available IP of 'SERVICE_CIDR') +# 集群 DNS 服务 IP (从 SERVICE_CIDR 中预分配) CLUSTER_DNS_SVC_IP="10.68.0.2" -# Cluster DNS Domain +# 集群 DNS 域名 CLUSTER_DNS_DOMAIN="cluster.local." -# Basic auth for apiserver +# 集群basic auth 使用的用户名和密码 BASIC_AUTH_USER="admin" BASIC_AUTH_PASS="test1234" -# -------- Additional Variables -------------------- -# Binaries Directory +# ---------附加参数-------------------- +#默认二进制文件目录 bin_dir="/opt/kube/bin" -# CA and other components cert/key Directory +#证书目录 ca_dir="/etc/kubernetes/ssl" -# Deploy Directory (kubeasz workspace), don't change the default value right now +#部署目录,即 ansible 工作目录 base_dir="/etc/ansible" diff --git a/example/hosts.s-master.example.en b/example/hosts.s-master.example.en new file mode 100644 index 0000000..52f8060 --- /dev/null +++ b/example/hosts.s-master.example.en @@ -0,0 +1,71 @@ +# 'deploy' node, which the ansible-playbooks usually run on +# variable 'NTP_ENABLED(=yes/no)' enables/disables the NTP server 'chrony' +[deploy] +192.168.1.1 NTP_ENABLED=no + +# 'etcd' cluster must have odd member(s) (1,3,5,...) +# variable 'NODE_NAME' is the distinct name of a member in 'etcd' cluster +[etcd] +192.168.1.1 NODE_NAME=etcd1 + +[kube-master] +192.168.1.1 + +[kube-node] +192.168.1.2 +192.168.1.3 + +# variable NEW_INSTALL: 'yes' to setup a new harbor server; 'no' to integrate with existed one +[harbor] +#192.168.1.8 HARBOR_DOMAIN="harbor.yourdomain.com" NEW_INSTALL=no + +# group reserved, add new 'kube-node' in it +[new-node] +#192.168.1.xx + +[all:vars] +# --------- Main Variables --------------- +# Cluster Deployment Mode: allinone, single-master, multi-master +DEPLOY_MODE=single-master + +# Versions supported: v1.8, v1.9, v1.10, v1.11, v1.12 +K8S_VER="v1.11" + +# Cluster's Master IP, auto generated +MASTER_IP="{{ groups['kube-master'][0] }}" +KUBE_APISERVER="https://{{ MASTER_IP }}:6443" + +# Network plugins supported: calico, flannel, kube-router, cilium +CLUSTER_NETWORK="flannel" + +# K8S Service CIDR, not overlap with node(host) networking +SERVICE_CIDR="10.68.0.0/16" + +# Cluster CIDR (Pod CIDR), not overlap with node(host) networking +CLUSTER_CIDR="172.20.0.0/16" + +# NodePort Range +NODE_PORT_RANGE="20000-40000" + +# Kubernetes SVC IP (usually assigned with the first available IP of 'SERVICE_CIDR') +CLUSTER_KUBERNETES_SVC_IP="10.68.0.1" + +# Cluster DNS Server's IP (assigned with an available IP of 'SERVICE_CIDR') +CLUSTER_DNS_SVC_IP="10.68.0.2" + +# Cluster DNS Domain +CLUSTER_DNS_DOMAIN="cluster.local." + +# Basic auth for apiserver +BASIC_AUTH_USER="admin" +BASIC_AUTH_PASS="test1234" + +# -------- Additional Variables -------------------- +# Binaries Directory +bin_dir="/opt/kube/bin" + +# CA and other components cert/key Directory +ca_dir="/etc/kubernetes/ssl" + +# Deploy Directory (kubeasz workspace), don't change the default value right now +base_dir="/etc/ansible"