mirror of https://github.com/easzlab/kubeasz.git
增加master和node服务重启tags
parent
dfff890926
commit
1fd8515711
|
@ -21,7 +21,5 @@ kubelet默认启动参数`--anonymous-auth=true`风险非常大,黑客可以
|
|||
``` bash
|
||||
$ cd /etc/ansible
|
||||
$ git pull origin master
|
||||
$ ansible-playbook -t upgrade_k8s 04.kube-master.yml
|
||||
$ ansible-playbook -t upgrade_k8s 05.kube-node.yml
|
||||
$ ansible-playbook 22.upgrade.yml -t restart_master,restart_node
|
||||
```
|
||||
|
||||
|
|
|
@ -32,15 +32,15 @@
|
|||
|
||||
- name: 创建kube-apiserver的systemd unit文件
|
||||
template: src=kube-apiserver.service.j2 dest=/etc/systemd/system/kube-apiserver.service
|
||||
tags: upgrade_k8s
|
||||
tags: upgrade_k8s, restart_master
|
||||
|
||||
- name: 创建kube-controller-manager的systemd unit文件
|
||||
template: src=kube-controller-manager.service.j2 dest=/etc/systemd/system/kube-controller-manager.service
|
||||
tags: upgrade_k8s
|
||||
tags: upgrade_k8s, restart_master
|
||||
|
||||
- name: 创建kube-scheduler的systemd unit文件
|
||||
template: src=kube-scheduler.service.j2 dest=/etc/systemd/system/kube-scheduler.service
|
||||
tags: upgrade_k8s
|
||||
tags: upgrade_k8s, restart_master
|
||||
|
||||
- name: enable master 服务
|
||||
shell: systemctl enable kube-apiserver kube-controller-manager kube-scheduler
|
||||
|
@ -49,7 +49,7 @@
|
|||
- name: 启动 master 服务
|
||||
shell: "systemctl daemon-reload && systemctl restart kube-apiserver && \
|
||||
systemctl restart kube-controller-manager && systemctl restart kube-scheduler"
|
||||
tags: upgrade_k8s
|
||||
tags: upgrade_k8s, restart_master
|
||||
|
||||
- name: 以轮询的方式等待master服务启动完成
|
||||
command: "{{ bin_dir }}/kubectl get node"
|
||||
|
@ -58,4 +58,4 @@
|
|||
retries: 5
|
||||
delay: 6
|
||||
run_once: True
|
||||
tags: upgrade_k8s
|
||||
tags: upgrade_k8s, restart_master
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
|
||||
- name: 创建kubelet的systemd unit文件
|
||||
template: src=kubelet.service.j2 dest=/etc/systemd/system/kubelet.service
|
||||
tags: upgrade_k8s
|
||||
tags: upgrade_k8s, restart_node
|
||||
|
||||
- name: 开机启用kubelet 服务
|
||||
shell: systemctl enable kubelet
|
||||
|
@ -46,14 +46,14 @@
|
|||
|
||||
- name: 开启kubelet 服务
|
||||
shell: systemctl daemon-reload && systemctl restart kubelet
|
||||
tags: upgrade_k8s
|
||||
tags: upgrade_k8s, restart_node
|
||||
|
||||
##-------kube-proxy部分----------------
|
||||
- name: 安装kube-proxy.kubeconfig配置文件
|
||||
copy: src=/etc/kubernetes/kube-proxy.kubeconfig dest=/etc/kubernetes/kube-proxy.kubeconfig
|
||||
|
||||
- name: 创建kube-proxy 服务文件
|
||||
tags: reload-kube-proxy, upgrade_k8s
|
||||
tags: reload-kube-proxy, upgrade_k8s, restart_node
|
||||
template: src=kube-proxy.service.j2 dest=/etc/systemd/system/kube-proxy.service
|
||||
|
||||
- name: 开机启用kube-proxy 服务
|
||||
|
@ -62,7 +62,7 @@
|
|||
|
||||
- name: 开启kube-proxy 服务
|
||||
shell: systemctl daemon-reload && systemctl restart kube-proxy
|
||||
tags: reload-kube-proxy, upgrade_k8s
|
||||
tags: reload-kube-proxy, upgrade_k8s, restart_node
|
||||
|
||||
# 批准 node 节点,首先轮询等待kubelet启动完成
|
||||
- name: 轮询等待kubelet启动
|
||||
|
@ -89,4 +89,4 @@
|
|||
until: node_status.stdout == "Ready" or node_status.stdout == "Ready,SchedulingDisabled"
|
||||
retries: 8
|
||||
delay: 5
|
||||
tags: upgrade_k8s
|
||||
tags: upgrade_k8s, restart_node
|
||||
|
|
Loading…
Reference in New Issue