Skip to content

Commit

Permalink
Fix safe upgrade
Browse files Browse the repository at this point in the history
Even though there it kubeadm_token_ttl=0 which means that kubeadm token never expires, it is not present in `kubeadm token list` after cluster is provisioned (at least after it is running for some time) and there is issue regarding this kubernetes/kubeadm#335, so we need to create a new temporary token during the cluster upgrade.
  • Loading branch information
mlushpenko authored Feb 5, 2018
1 parent 95b8ac5 commit ebc79aa
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions roles/kubernetes/kubeadm/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@
delegate_to: "{{ groups['kube-master'][0] }}"
run_once: true

- name: Create kubeadm token for joining nodes with 24h expiration (default)
command: "{{ bin_dir }}/kubeadm token create"
run_once: true
register: temp_token
delegate_to: "{{ groups['kube-master'][0] }}"

- name: Override predefined kubeadm_token that expires after 24h
set_fact:
kubeadm_token: "{{ temp_token.stdout }}"

- name: Create kubeadm client config
template:
src: kubeadm-client.conf.j2
Expand Down

0 comments on commit ebc79aa

Please sign in to comment.