扩展集群node
把需要添加的node 写入配置文件,然后执行ansible
以添加node4举例,只需将要添加的节点加入到kube-node
修改 inventory.cfg
[all]
node1 ansible_host=172.16.105.21 ip=172.16.105.21
node2 ansible_host=172.16.105.22 ip=172.16.105.22
node3 ansible_host=172.16.105.23 ip=172.16.105.23
node4 ansible_host=172.16.105.37 ip=172.16.105.37
[kube-master]
node1
node2
node3
[kube-node]
node4
[etcd]
node1
node2
node3
[k8s-cluster:children]
kube-node
kube-master
[calico-rr]
[vault]
node1
node2
node3
ansible-playbook -i inventory/inventory.cfg scale.yml -b -v \
--private-key=~/.ssh/private_key
后感
了解ansible,也就能自己随便搞kubespray,这个东西比较透明,不像kubeadm,封装很严,不知道具体流程,出问题也不知道怎么处理。