Skip to content

Commit

Permalink
approve csr之前增加15s等待kubelet启动完成
Browse files Browse the repository at this point in the history
  • Loading branch information
jmgao1983 committed Nov 21, 2017
1 parent 22d95cd commit 5f65b4c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions example/hosts.m-masters.example
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
# 负载均衡至少两个节点,安装 haproxy+keepalived
# 根据master节点数量同步修改roles/lb/templates/haproxy.cfg.j2
[lb]
192.168.1.31 LB_IF="ens3" LB_ROLE=backup
192.168.1.61 LB_IF="ens3" LB_ROLE=master
192.168.1.31 LB_IF="eth0" LB_ROLE=backup
192.168.1.61 LB_IF="eth0" LB_ROLE=master
[lb:vars]
LB_EP1="192.168.1.34:6443" # api-server 实际成员地址端口
LB_EP2="192.168.1.35:6443" # api-server 实际成员地址端口
LB_EP3="192.168.1.63:6443" # api-server 实际成员地址端口
MASTER_IP="192.168.1.30" # api-server 虚地址
MASTER_PORT="6443" # api-server 服务端口
MASTER_PORT="8443" # api-server 服务端口

#确保node节点有变量NODE_ID=node1
[kube-node]
Expand All @@ -42,7 +42,7 @@ kube-master
# ---------集群主要参数---------------
#集群 MASTER IP, 需要外部负载均衡,一般为VIP地址
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 ' ' 生成
BOOTSTRAP_TOKEN="c30302226d4b810e08731702d3890f50"
Expand Down
2 changes: 1 addition & 1 deletion roles/kube-node/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
shell: systemctl restart kubelet

- 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"
ignore_errors: true

Expand Down

0 comments on commit 5f65b4c

Please sign in to comment.