forked from easzlab/kubeasz
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
95 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# 公有云上部署 kubeasz | ||
|
||
在公有云上使用`kubeasz`部署`k8s`集群需要注意以下几点: | ||
|
||
1. 注意虚机的安全组规则配置,一般集群内部节点之间端口放开即可; | ||
|
||
2. 部分`k8s`网络组件受限,一般可以选择 flannel (vxlan模式)、calico(开启ipinip); | ||
|
||
3. 无法自由创建`lb`节点,一般使用云负载均衡(内网)四层TCP负载模式; | ||
|
||
4. 部分云厂商负载均衡使用四层负载模式时不支持添加进后端云服务器池的 ECS 既作为 Real Server,又作为客户端向所在的 SLB 实例发送请求;因此注意不要在 master节点执行 kubectl,会出现时通时不通的情况; | ||
|
||
其他在公有云上的安装步骤与自有环境没有差异,节点规划可以参考 [example/hosts.cloud.example](../../example/hosts.cloud.example) | ||
|
||
具体某个云厂商的问题,后续发现了会及时更新。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
# 集群部署节点:一般为运行ansible 脚本的节点 | ||
# 变量 NTP_ENABLED (=yes/no) 设置集群是否安装 chrony 时间同步, 公有云上虚机不需要 | ||
[deploy] | ||
192.168.1.1 NTP_ENABLED=no | ||
|
||
# etcd集群请提供如下NODE_NAME,注意etcd集群必须是1,3,5,7...奇数个节点 | ||
[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 | ||
|
||
# 公有云上一般都有提供负载均衡产品,且不允许自己创建,lb 节点留空,仅保留组名 | ||
[lb] | ||
|
||
[kube-node] | ||
192.168.1.1 | ||
192.168.1.4 | ||
|
||
# 参数 NEW_INSTALL:yes表示新建,no表示使用已有harbor服务器 | ||
[harbor] | ||
#192.168.1.8 HARBOR_DOMAIN="harbor.yourdomain.com" NEW_INSTALL=no | ||
|
||
# 预留组,后续添加master节点使用 | ||
[new-master] | ||
#192.168.1.5 | ||
|
||
# 预留组,后续添加node节点使用 | ||
[new-node] | ||
#192.168.1.xx | ||
|
||
[all:vars] | ||
# ---------集群主要参数--------------- | ||
#集群部署模式:allinone, single-master, multi-master | ||
DEPLOY_MODE=multi-master | ||
|
||
#集群主版本号,目前支持: v1.8, v1.9, v1.10,v1.11 | ||
K8S_VER="v1.10" | ||
|
||
# 创建内网云负载均衡,然后配置:前端监听 tcp 8443,后端 tcp 6443,后端节点即 master 节点 | ||
MASTER_IP="192.168.1.10" # 即负载均衡内网地址 | ||
KUBE_APISERVER="https://{{ MASTER_IP }}:8443" | ||
|
||
# 集群网络插件,目前支持calico, flannel, kube-router, cilium | ||
CLUSTER_NETWORK="flannel" | ||
|
||
# 服务网段 (Service CIDR),注意不要与内网已有网段冲突 | ||
SERVICE_CIDR="10.68.0.0/16" | ||
|
||
# POD 网段 (Cluster CIDR),注意不要与内网已有网段冲突 | ||
CLUSTER_CIDR="172.20.0.0/16" | ||
|
||
# 服务端口范围 (NodePort Range) | ||
NODE_PORT_RANGE="20000-40000" | ||
|
||
# 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." | ||
|
||
# 集群basic auth 使用的用户名和密码 | ||
BASIC_AUTH_USER="admin" | ||
BASIC_AUTH_PASS="test1234" | ||
|
||
# ---------附加参数-------------------- | ||
#默认二进制文件目录 | ||
bin_dir="/opt/kube/bin" | ||
|
||
#证书目录 | ||
ca_dir="/etc/kubernetes/ssl" | ||
|
||
#部署目录,即 ansible 工作目录,建议不要修改 | ||
base_dir="/etc/ansible" |