Browse Source

Correct master manifest cleanup logic (#1693)

Fixes #1666
pull/1696/merge
Matthew Mosesohn 7 years ago
committed by GitHub
parent
commit
a1cde03b20
1 changed files with 2 additions and 2 deletions
  1. 4
      roles/kubernetes/master/tasks/pre-upgrade.yml

4
roles/kubernetes/master/tasks/pre-upgrade.yml

@ -17,14 +17,14 @@
file: file:
path: "/etc/kubernetes/manifests/{{item}}.manifest" path: "/etc/kubernetes/manifests/{{item}}.manifest"
state: absent state: absent
with_nested:
with_items:
- ["kube-apiserver", "kube-controller-manager", "kube-scheduler"] - ["kube-apiserver", "kube-controller-manager", "kube-scheduler"]
register: kube_apiserver_manifest_replaced register: kube_apiserver_manifest_replaced
when: (secret_changed|default(false) or etcd_secret_changed|default(false)) when: (secret_changed|default(false) or etcd_secret_changed|default(false))
- name: "Pre-upgrade | Delete master containers forcefully" - name: "Pre-upgrade | Delete master containers forcefully"
shell: "docker ps -f name=k8s-{{item}}* -q | xargs --no-run-if-empty docker rm -f" shell: "docker ps -f name=k8s-{{item}}* -q | xargs --no-run-if-empty docker rm -f"
with_nested:
with_items:
- ["kube-apiserver", "kube-controller-manager", "kube-scheduler"] - ["kube-apiserver", "kube-controller-manager", "kube-scheduler"]
when: kube_apiserver_manifest_replaced.changed when: kube_apiserver_manifest_replaced.changed
run_once: true run_once: true
Loading…
Cancel
Save