Skip to content

Commit

Permalink
clean services softlink (easzlab#253)
Browse files Browse the repository at this point in the history
  • Loading branch information
lusyoe authored and gjmzj committed Jul 5, 2018
1 parent e695c7c commit ec3bb00
Showing 1 changed file with 22 additions and 8 deletions.
30 changes: 22 additions & 8 deletions 99.clean.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@
- kube-node
- new-node
tasks:
- name: stop kube-node service
shell: "systemctl stop kubelet kube-proxy"
- name: stop and disable kube-node service
service: name={{ item }} state=stopped enabled=no
with_items:
- kubelet
- kube-proxy
ignore_errors: true

- name: umount kubelet 挂载的目录
Expand All @@ -30,8 +33,12 @@
- kube-master
- new-master
tasks:
- name: stop kube-master service
shell: "systemctl stop kube-apiserver kube-controller-manager kube-scheduler"
- name: stop and disable kube-master service
service: name={{ item }} state=stopped enabled=no
with_items:
- kube-apiserver
- kube-controller-manager
- kube-scheduler
ignore_errors: true

- name: 清理目录和文件
Expand All @@ -54,8 +61,11 @@
ignore_errors: true
when: "CLUSTER_NETWORK == 'kube-router'"

- name: stop docker service
shell: "systemctl stop docker"
- name: stop and disable docker service
service:
name: docker
state: stopped
enabled: no
ignore_errors: true

# 因为calico-kube-controller使用了host网络,相当于使用了docker -net=host,需要
Expand Down Expand Up @@ -83,6 +93,7 @@
- "/etc/systemd/system/docker.service"
- "/etc/systemd/system/docker.service.requires/"
- "/opt/kube/kube-system/"
- "/etc/bash_completion.d/docker"
ignore_errors: true

- name: 清理 iptables
Expand Down Expand Up @@ -111,8 +122,11 @@
# 清理etcd 集群相关
- hosts: etcd
tasks:
- name: stop etcd service
shell: systemctl stop etcd
- name: stop and disable etcd service
service:
name: etcd
state: stopped
enabled: no
ignore_errors: true

- name: 清理目录和文件
Expand Down

0 comments on commit ec3bb00

Please sign in to comment.