增加重启master和node节点tags

closed
gjmzj 2018-05-20 21:53:40 +08:00
parent 38592869e3
commit e6a6509a65
2 changed files with 24 additions and 20 deletions

View File

@ -26,30 +26,24 @@
- name: 创建kube-apiserver的systemd unit文件
template: src=kube-apiserver.service.j2 dest=/etc/systemd/system/kube-apiserver.service
tags: restart_master
- name: 创建kube-controller-manager的systemd unit文件
template: src=kube-controller-manager.service.j2 dest=/etc/systemd/system/kube-controller-manager.service
tags: restart_master
- name: 创建kube-scheduler的systemd unit文件
template: src=kube-scheduler.service.j2 dest=/etc/systemd/system/kube-scheduler.service
tags: restart_master
- name: daemon-reload
shell: systemctl daemon-reload
tags: restart_master
- name: enable-kube-apiserver
shell: systemctl enable kube-apiserver
- name: 开机启用master服务
shell: systemctl enable kube-apiserver kube-controller-manager kube-scheduler
ignore_errors: true
- name: enable-kube-controller-manager
shell: systemctl enable kube-controller-manager
- name: enable-kube-scheduler
shell: systemctl enable kube-scheduler
- name: start-kube-apiserver
shell: systemctl restart kube-apiserver
- name: start-kube-controller-manager
shell: systemctl restart kube-controller-manager
- name: start-kube-scheduler
shell: systemctl restart kube-scheduler
- name: 开启master服务
shell: systemctl restart kube-apiserver && systemctl restart kube-controller-manager && systemctl restart kube-scheduler
tags: restart_master

View File

@ -41,9 +41,15 @@
- name: 创建kubelet的systemd unit文件
template: src=kubelet.service.j2 dest=/etc/systemd/system/kubelet.service
tags: restart_node
- name: 开机启用kubelet 服务
shell: systemctl enable kubelet
ignore_errors: true
- name: 开启kubelet 服务
shell: systemctl daemon-reload && systemctl enable kubelet && systemctl restart kubelet
shell: systemctl daemon-reload && systemctl restart kubelet
tags: restart_node
- name: approve-kubelet-csr
shell: "sleep 15 && {{ bin_dir }}/kubectl get csr|grep 'Pending' | awk 'NR>0{print $1}'| xargs {{ bin_dir }}/kubectl certificate approve"
@ -89,12 +95,16 @@
file: name=/var/lib/kube-proxy state=directory
- name: 创建kube-proxy 服务文件
tags: reload-kube-proxy
template: src=kube-proxy.service.j2 dest=/etc/systemd/system/kube-proxy.service
tags: restart_node
- name: 开机启用kube-proxy 服务
shell: systemctl enable kube-proxy
ignore_errors: true
- name: 开启kube-proxy 服务
tags: reload-kube-proxy
shell: systemctl daemon-reload && systemctl enable kube-proxy && systemctl restart kube-proxy
shell: systemctl daemon-reload && systemctl restart kube-proxy
tags: restart_node
##-------calico-kube-controllers部分----------------
#