2015-10-04 04:19:50 +08:00
|
|
|
---
|
2016-07-08 17:59:21 +08:00
|
|
|
- include: pre-upgrade.yml
|
2017-10-05 15:43:04 +08:00
|
|
|
tags:
|
|
|
|
- k8s-pre-upgrade
|
2015-12-17 06:49:01 +08:00
|
|
|
|
2017-09-16 05:28:15 +08:00
|
|
|
# upstream bug: https://github.com/kubernetes/kubeadm/issues/441
|
|
|
|
- name: Disable kube_basic_auth until kubeadm/441 is fixed
|
|
|
|
set_fact:
|
|
|
|
kube_basic_auth: false
|
|
|
|
when: kubeadm_enabled|bool|default(false)
|
|
|
|
|
2017-09-14 02:00:51 +08:00
|
|
|
- include: users-file.yml
|
|
|
|
when: kube_basic_auth|default(true)
|
|
|
|
|
2017-10-26 04:19:40 +08:00
|
|
|
- name: Compare host kubectl with hyperkube container
|
|
|
|
command: "{{ docker_bin_dir }}/docker run --rm -v {{ bin_dir }}:/systembindir {{ hyperkube_image_repo }}:{{ hyperkube_image_tag }} /usr/bin/cmp /hyperkube /systembindir/kubectl"
|
|
|
|
register: kubectl_task_compare_result
|
|
|
|
until: kubectl_task_compare_result.rc in [0,1,2]
|
|
|
|
retries: 4
|
|
|
|
delay: "{{ retry_stagger | random + 3 }}"
|
|
|
|
changed_when: false
|
|
|
|
failed_when: "kubectl_task_compare_result.rc not in [0,1,2]"
|
|
|
|
tags:
|
|
|
|
- hyperkube
|
|
|
|
- kubectl
|
|
|
|
- upgrade
|
|
|
|
|
2016-07-25 18:56:58 +08:00
|
|
|
- name: Copy kubectl from hyperkube container
|
2016-12-23 22:44:44 +08:00
|
|
|
command: "{{ docker_bin_dir }}/docker run --rm -v {{ bin_dir }}:/systembindir {{ hyperkube_image_repo }}:{{ hyperkube_image_tag }} /bin/cp /hyperkube /systembindir/kubectl"
|
2017-10-26 04:19:40 +08:00
|
|
|
when: kubectl_task_compare_result.rc != 0
|
|
|
|
register: kubectl_task_result
|
|
|
|
until: kubectl_task_result.rc == 0
|
2016-09-13 20:36:01 +08:00
|
|
|
retries: 4
|
2016-09-15 17:23:27 +08:00
|
|
|
delay: "{{ retry_stagger | random + 3 }}"
|
2016-01-22 23:37:07 +08:00
|
|
|
changed_when: false
|
2017-10-05 15:43:04 +08:00
|
|
|
tags:
|
|
|
|
- hyperkube
|
|
|
|
- kubectl
|
|
|
|
- upgrade
|
2015-12-11 18:52:20 +08:00
|
|
|
|
2017-01-18 01:36:58 +08:00
|
|
|
- name: Install kubectl bash completion
|
|
|
|
shell: "{{ bin_dir }}/kubectl completion bash >/etc/bash_completion.d/kubectl.sh"
|
2017-10-26 04:19:40 +08:00
|
|
|
when: kubectl_task_compare_result.rc != 0 and ansible_os_family in ["Debian","RedHat"]
|
2017-10-05 15:43:04 +08:00
|
|
|
tags:
|
|
|
|
- kubectl
|
2016-11-14 16:22:46 +08:00
|
|
|
|
2017-01-18 01:36:58 +08:00
|
|
|
- name: Set kubectl bash completion file
|
|
|
|
file:
|
|
|
|
path: /etc/bash_completion.d/kubectl.sh
|
2016-11-14 16:22:46 +08:00
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0755
|
2017-01-18 01:36:58 +08:00
|
|
|
when: ansible_os_family in ["Debian","RedHat"]
|
2017-10-05 15:43:04 +08:00
|
|
|
tags:
|
|
|
|
- kubectl
|
|
|
|
- upgrade
|
2016-11-14 16:22:46 +08:00
|
|
|
|
2017-10-20 15:25:57 +08:00
|
|
|
- name: Include kubeadm setup if enabled
|
2017-09-14 02:00:51 +08:00
|
|
|
include: kubeadm-setup.yml
|
|
|
|
when: kubeadm_enabled|bool|default(false)
|
2017-06-27 12:27:25 +08:00
|
|
|
|
2017-10-20 15:25:57 +08:00
|
|
|
- name: Include static pod setup if not using kubeadm
|
2017-09-14 02:00:51 +08:00
|
|
|
include: static-pod-setup.yml
|
|
|
|
when: not kubeadm_enabled|bool|default(false)
|