Skip to content
This repository has been archived by the owner on Nov 9, 2021. It is now read-only.

Commit

Permalink
upgrade playbook ready
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Short <[email protected]>
  • Loading branch information
chris-short committed Mar 13, 2018
1 parent 98b28d8 commit f4c9caf
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 74 deletions.
71 changes: 0 additions & 71 deletions roles/upgrade/tasks/main.yml

This file was deleted.

1 change: 0 additions & 1 deletion roles/upgrade/templates/kubernetes.list

This file was deleted.

58 changes: 56 additions & 2 deletions upgrade.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,57 @@
- hosts: master
tasks:
- name: apt-get update
apt:
update_cache: yes
autoclean: yes
autoremove: yes

- name: Upgrade kubeadm
apt:
name: "{{ item }}"
state: latest
with_items:
- kubeadm

- name: Determine latest stable version of Kubernetes
shell: curl -sSL https://dl.k8s.io/release/stable.txt
register: stable_ver

- name: Upgrade cluster with kubeadm
shell: "kubeadm upgrade apply -y {{ stable_ver.stdout }}"
async: 300
poll: 5

- name: Cordon Hosts
shell: "kubectl cordon {{ item }}"
with_items:
- "{{ groups['all'] }}"
tags: cordon

- name: Drain Hosts
shell: "kubectl drain {{ item }} --ignore-daemonsets"
with_items:
- "{{ groups['all'] }}"
ignore_errors: yes
tags: drain

- hosts: all
roles:
- upgrade
tasks:
- name: Upgrade Y'all
apt:
name: "{{ item }}"
state: latest
with_items:
- kubelet
- kubectl
tags:
- kubelet
- kubectl

- hosts: master
tasks:
- name: Uncordon Hosts
shell: "kubectl uncordon {{ item }}"
with_items:
- "{{ groups['all'] }}"
tags: uncordon

0 comments on commit f4c9caf

Please sign in to comment.