Merge pull request #1006 from mattymo/fix_weave_upgrade
Enable weave upgrade from previous versions
This commit is contained in:
commit
9514f32135
4 changed files with 44 additions and 3 deletions
|
@ -30,8 +30,8 @@
|
||||||
return_content: yes
|
return_content: yes
|
||||||
run_once: true
|
run_once: true
|
||||||
register: weave_status
|
register: weave_status
|
||||||
retries: 10
|
retries: 12
|
||||||
delay: "{{ retry_stagger | random + 3 }}"
|
delay: 10
|
||||||
until: "{{ weave_status.status == 200 and
|
until: "{{ weave_status.status == 200 and
|
||||||
'Status: ready' in weave_status.content }}"
|
'Status: ready' in weave_status.content }}"
|
||||||
delegate_to: "{{groups['kube-master'][0]}}"
|
delegate_to: "{{groups['kube-master'][0]}}"
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
---
|
---
|
||||||
|
- include: pre-upgrade.yml
|
||||||
|
|
||||||
- name: Weave | Copy cni plugins from hyperkube
|
- name: Weave | Copy cni plugins from hyperkube
|
||||||
command: "{{ docker_bin_dir }}/docker run --rm -v /opt/cni/bin:/cnibindir {{ hyperkube_image_repo }}:{{ hyperkube_image_tag }} /bin/cp -r /opt/cni/bin/. /cnibindir/"
|
command: "{{ docker_bin_dir }}/docker run --rm -v /opt/cni/bin:/cnibindir {{ hyperkube_image_repo }}:{{ hyperkube_image_tag }} /bin/cp -r /opt/cni/bin/. /cnibindir/"
|
||||||
register: cni_task_result
|
register: cni_task_result
|
||||||
|
|
39
roles/network_plugin/weave/tasks/pre-upgrade.yml
Normal file
39
roles/network_plugin/weave/tasks/pre-upgrade.yml
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
- name: Weave pre-upgrade | Stop legacy weave
|
||||||
|
command: weave stop
|
||||||
|
failed_when: false
|
||||||
|
|
||||||
|
- name: Weave pre-upgrade | Stop legacy systemd weave services
|
||||||
|
service:
|
||||||
|
name: "{{ item }}"
|
||||||
|
enabled: no
|
||||||
|
state: stopped
|
||||||
|
with_items:
|
||||||
|
- weaveexpose
|
||||||
|
- weaveproxy
|
||||||
|
- weave
|
||||||
|
failed_when: false
|
||||||
|
|
||||||
|
- name: Weave pre-upgrade | Purge legacy systemd weave systemd unit files
|
||||||
|
file:
|
||||||
|
path: "{{ item }}"
|
||||||
|
state: absent
|
||||||
|
register: purged_weave_systemd_units
|
||||||
|
with_items:
|
||||||
|
- "/etc/systemd/system/weaveexpose.service"
|
||||||
|
- "/etc/systemd/system/weaveproxy.service"
|
||||||
|
- "/etc/systemd/system/weave.service"
|
||||||
|
|
||||||
|
- name: Weave pre-upgrade | Reload systemd
|
||||||
|
command: systemctl daemon-reload
|
||||||
|
when: ansible_service_mgr == "systemd" and purged_weave_systemd_units.changed
|
||||||
|
|
||||||
|
- name: Weave pre-upgrade | Purge legacy weave configs and binary
|
||||||
|
file:
|
||||||
|
path: "{{ item }}"
|
||||||
|
state: absent
|
||||||
|
with_items:
|
||||||
|
- "{{ bin_dir }}/weave"
|
||||||
|
- "/etc/weave.env"
|
||||||
|
|
||||||
|
- name: Weave pre-upgrade | Purge legacy weave docker containers
|
||||||
|
shell: "docker ps -af 'name=^/weave.*' -q | xargs --no-run-if-empty docker rm -f"
|
|
@ -54,7 +54,7 @@ spec:
|
||||||
value: {{ weave_expose_ip }}
|
value: {{ weave_expose_ip }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
livenessProbe:
|
livenessProbe:
|
||||||
initialDelaySeconds: 30
|
initialDelaySeconds: 60
|
||||||
httpGet:
|
httpGet:
|
||||||
host: 127.0.0.1
|
host: 127.0.0.1
|
||||||
path: /status
|
path: /status
|
||||||
|
|
Loading…
Reference in a new issue