Enable weave upgrade from previous versions

Raise readiness probe initial time to 60 (was 30)
This commit is contained in:
Matthew Mosesohn 2017-02-09 14:33:40 +03:00
parent b68afe7efa
commit e0cfea02bf
4 changed files with 44 additions and 3 deletions

View file

@ -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]}}"

View file

@ -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

View 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"

View file

@ -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