mirror of https://github.com/easzlab/kubeasz.git
增加等待kube-apiserver/kubelet启动延迟
parent
25c49c9cf4
commit
e8291088ed
|
@ -1,5 +1,7 @@
|
|||
# 利用Ansible部署kubernetes集群
|
||||
|
||||
![docker](./pics/docker.jpg) ![kube](./pics/kube.jpg) ![ansible](./pics/ansible.jpg)
|
||||
|
||||
本文档记录自己实践部署高可用k8s集群的过程,利用ansible-playbook简化二进制方式部署过程。
|
||||
|
||||
网上有很多类似shell脚本和ansible部署版本,要不看得太复杂,或者久未更新,所以这里自己造轮子吧。
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 8.6 KiB |
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
Binary file not shown.
After Width: | Height: | Size: 7.0 KiB |
|
@ -7,8 +7,9 @@
|
|||
|
||||
# kubelet 启动时向 kube-apiserver 发送 TLS bootstrapping 请求,需要绑定该角色
|
||||
# 只需单节点执行一次,重复执行的报错可以忽略
|
||||
# 增加15s等待kube-apiserver正常工作
|
||||
- name: kubelet-bootstrap-setting
|
||||
shell: "{{ bin_dir }}/kubectl create clusterrolebinding kubelet-bootstrap \
|
||||
shell: "sleep 15 && {{ bin_dir }}/kubectl create clusterrolebinding kubelet-bootstrap \
|
||||
--clusterrole=system:node-bootstrapper --user=kubelet-bootstrap"
|
||||
when: NODE_ID is defined and NODE_ID == "node1"
|
||||
ignore_errors: true
|
||||
|
@ -120,9 +121,10 @@
|
|||
template: src=calico-kube-controllers.yaml.j2 dest=/root/local/kube-system/calico/calico-kube-controllers.yaml
|
||||
|
||||
# 只需单节点执行一次,重复执行的报错可以忽略
|
||||
# 增加15s等待node ready
|
||||
- name: 运行calico-kube-controllers
|
||||
tags: calico-controller
|
||||
shell: "{{ bin_dir }}/kubectl create -f /root/local/kube-system/calico/rbac.yaml && \
|
||||
shell: "sleep 15 && {{ bin_dir }}/kubectl create -f /root/local/kube-system/calico/rbac.yaml && \
|
||||
{{ bin_dir }}/kubectl create -f /root/local/kube-system/calico/calico-kube-controllers.yaml"
|
||||
when: NODE_ID is defined and NODE_ID == "node1"
|
||||
ignore_errors: true
|
||||
|
|
Loading…
Reference in New Issue