mirror of https://github.com/easzlab/kubeasz.git
更新haproxy负载均衡算法配置
parent
6afcd95814
commit
870d51ec7e
|
@ -25,7 +25,7 @@
|
|||
#集群部署模式:allinone, single-master, multi-master
|
||||
DEPLOY_MODE=allinone
|
||||
|
||||
#集群主版本号,目前支持: v1.8, v1.9, v1.10
|
||||
#集群主版本号,目前支持: v1.8, v1.9, v1.10,v1.11
|
||||
K8S_VER="v1.10"
|
||||
|
||||
#集群 MASTER IP
|
||||
|
|
|
@ -12,8 +12,7 @@
|
|||
192.168.1.1
|
||||
192.168.1.2
|
||||
|
||||
# 负载均衡至少两个节点,安装 haproxy+keepalived
|
||||
# 如果是公有云环境请优先使用云上负载均衡,lb组留空
|
||||
# 负载均衡有且仅有两个节点,安装 haproxy+keepalived
|
||||
[lb]
|
||||
192.168.1.1 LB_IF="eth0" LB_ROLE=backup # 注意根据实际使用网卡设置 LB_IF变量
|
||||
192.168.1.2 LB_IF="eth0" LB_ROLE=master
|
||||
|
@ -39,7 +38,7 @@
|
|||
#集群部署模式:allinone, single-master, multi-master
|
||||
DEPLOY_MODE=multi-master
|
||||
|
||||
#集群主版本号,目前支持: v1.8, v1.9, v1.10
|
||||
#集群主版本号,目前支持: v1.8, v1.9, v1.10,v1.11
|
||||
K8S_VER="v1.10"
|
||||
|
||||
# 集群 MASTER IP即 LB节点VIP地址,为区别与默认apiserver端口,设置VIP监听的服务端口8443
|
||||
|
|
|
@ -5,8 +5,6 @@
|
|||
# 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.1
|
||||
|
@ -28,8 +26,8 @@
|
|||
#集群部署模式:allinone, single-master, multi-master
|
||||
DEPLOY_MODE=single-master
|
||||
|
||||
#集群主版本号,目前支持: v1.8, v1.9, v1.10
|
||||
K8S_VER="v1.10"
|
||||
#集群主版本号,目前支持: v1.8, v1.9, v1.10,v1.11
|
||||
K8S_VER="v1.11"
|
||||
|
||||
#集群 MASTER IP
|
||||
MASTER_IP="192.168.1.1"
|
||||
|
|
|
@ -1,5 +1,12 @@
|
|||
# 区分多个instance的VRRP组播,同网段不能重复,取值在0-255之间
|
||||
# 可以直接指定数字,如ROUTER_ID: 69
|
||||
# 可以直接指定数字,如ROUTER_ID: 111
|
||||
# 取100~200间的随机数
|
||||
#ROUTER_ID: "{{ 200 | random(100,1) }}"
|
||||
ROUTER_ID: 69
|
||||
#ROUTER_ID: "{{ 200 | random }}"
|
||||
ROUTER_ID: 111
|
||||
|
||||
# haproxy负载均衡算法,常见如下:
|
||||
# "roundrobin": 基于服务器权重的轮询
|
||||
# "leastconn": 基于服务器最小连接数
|
||||
# "source": 基于请求源IP地址
|
||||
# "uri": 基于请求的URI
|
||||
BALANCE_ALG: "roundrobin"
|
||||
|
|
|
@ -19,7 +19,7 @@ listen kube-master
|
|||
bind 0.0.0.0:{{ KUBE_APISERVER.split(':')[2] }}
|
||||
mode tcp
|
||||
option tcplog
|
||||
balance source
|
||||
balance {{ BALANCE_ALG }}
|
||||
{% for host in groups['kube-master'] %}
|
||||
server {{ host }} {{ host }}:6443 check inter 2000 fall 2 rise 2 weight 1
|
||||
{% endfor %}
|
||||
|
|
Loading…
Reference in New Issue