diff --git a/20.addnode.yml b/20.addnode.yml new file mode 100644 index 0000000..c02ddd9 --- /dev/null +++ b/20.addnode.yml @@ -0,0 +1,13 @@ +- hosts: new-node + roles: + - prepare + - kubectl + - docker + - calico + - kube-node + +- hosts: deploy + tasks: + - name: 批准新增node节点 + shell: "sleep 15 && {{ bin_dir }}/kubectl get csr|grep 'Pending' | awk 'NR>0{print $1}'| xargs {{ bin_dir }}/kubectl certificate approve" + ignore_errors: true diff --git a/example/hosts.m-masters.example b/example/hosts.m-masters.example index bd21c7c..fe84cc5 100644 --- a/example/hosts.m-masters.example +++ b/example/hosts.m-masters.example @@ -38,6 +38,11 @@ MASTER_PORT="8443" # api-server 服务端口 kube-node kube-master +# 预留组,后续添加node节点使用 +[new-node] +#192.168.1.xx NODE_ID=node6 NODE_IP="192.168.1.xx" +#192.168.1.xx NODE_ID=node7 NODE_IP="192.168.1.xx" + [all:vars] # ---------集群主要参数--------------- #集群 MASTER IP, 需要外部负载均衡,一般为VIP地址