mirror of https://github.com/easzlab/kubeasz.git
approve csr之前增加15s等待kubelet启动完成
parent
22d95cd779
commit
5f65b4c7f5
|
@ -17,14 +17,14 @@
|
||||||
# 负载均衡至少两个节点,安装 haproxy+keepalived
|
# 负载均衡至少两个节点,安装 haproxy+keepalived
|
||||||
# 根据master节点数量同步修改roles/lb/templates/haproxy.cfg.j2
|
# 根据master节点数量同步修改roles/lb/templates/haproxy.cfg.j2
|
||||||
[lb]
|
[lb]
|
||||||
192.168.1.31 LB_IF="ens3" LB_ROLE=backup
|
192.168.1.31 LB_IF="eth0" LB_ROLE=backup
|
||||||
192.168.1.61 LB_IF="ens3" LB_ROLE=master
|
192.168.1.61 LB_IF="eth0" LB_ROLE=master
|
||||||
[lb:vars]
|
[lb:vars]
|
||||||
LB_EP1="192.168.1.34:6443" # api-server 实际成员地址端口
|
LB_EP1="192.168.1.34:6443" # api-server 实际成员地址端口
|
||||||
LB_EP2="192.168.1.35:6443" # api-server 实际成员地址端口
|
LB_EP2="192.168.1.35:6443" # api-server 实际成员地址端口
|
||||||
LB_EP3="192.168.1.63:6443" # api-server 实际成员地址端口
|
LB_EP3="192.168.1.63:6443" # api-server 实际成员地址端口
|
||||||
MASTER_IP="192.168.1.30" # api-server 虚地址
|
MASTER_IP="192.168.1.30" # api-server 虚地址
|
||||||
MASTER_PORT="6443" # api-server 服务端口
|
MASTER_PORT="8443" # api-server 服务端口
|
||||||
|
|
||||||
#确保node节点有变量NODE_ID=node1
|
#确保node节点有变量NODE_ID=node1
|
||||||
[kube-node]
|
[kube-node]
|
||||||
|
@ -42,7 +42,7 @@ kube-master
|
||||||
# ---------集群主要参数---------------
|
# ---------集群主要参数---------------
|
||||||
#集群 MASTER IP, 需要外部负载均衡,一般为VIP地址
|
#集群 MASTER IP, 需要外部负载均衡,一般为VIP地址
|
||||||
MASTER_IP="192.168.1.30"
|
MASTER_IP="192.168.1.30"
|
||||||
KUBE_APISERVER="https://192.168.1.30:6443"
|
KUBE_APISERVER="https://192.168.1.30:8443"
|
||||||
|
|
||||||
#TLS Bootstrapping 使用的 Token,使用 head -c 16 /dev/urandom | od -An -t x | tr -d ' ' 生成
|
#TLS Bootstrapping 使用的 Token,使用 head -c 16 /dev/urandom | od -An -t x | tr -d ' ' 生成
|
||||||
BOOTSTRAP_TOKEN="c30302226d4b810e08731702d3890f50"
|
BOOTSTRAP_TOKEN="c30302226d4b810e08731702d3890f50"
|
||||||
|
|
|
@ -51,7 +51,7 @@
|
||||||
shell: systemctl restart kubelet
|
shell: systemctl restart kubelet
|
||||||
|
|
||||||
- name: approve-kubelet-csr
|
- name: approve-kubelet-csr
|
||||||
shell: "{{ bin_dir }}/kubectl get csr|grep 'Pending' | awk 'NR>0{print $1}'| xargs {{ bin_dir }}/kubectl certificate approve"
|
shell: "sleep 15 && {{ bin_dir }}/kubectl get csr|grep 'Pending' | awk 'NR>0{print $1}'| xargs {{ bin_dir }}/kubectl certificate approve"
|
||||||
when: NODE_ID is defined and NODE_ID == "node1"
|
when: NODE_ID is defined and NODE_ID == "node1"
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue