Browse Source
Upgrade to kubeadm (#1667)
Upgrade to kubeadm (#1667)
* Enable upgrade to kubeadm * fix kubedns upgrade * try upgrade route * use init/upgrade strategy for kubeadm and ignore kubedns svc * Use bin_dir for kubeadm * delete more secrets * fix waiting for terminating pods * Manually enforce kube-proxy for kubeadm deploy * remove proxy. update to kubeadm 1.8.0rc1pull/1681/merge
Matthew Mosesohn
7 years ago
committed by
GitHub
17 changed files with 210 additions and 42 deletions
Split View
Diff Options
-
35.gitlab-ci.yml
-
1cluster.yml
-
14docs/upgrades.md
-
6roles/download/defaults/main.yml
-
18roles/kubernetes-apps/ansible/tasks/main.yml
-
11roles/kubernetes-apps/network_plugin/weave/tasks/main.yml
-
20roles/kubernetes-apps/rotate_tokens/tasks/main.yml
-
2roles/kubernetes/kubeadm/tasks/main.yml
-
3roles/kubernetes/master/tasks/kubeadm-cleanup-old-certs.yml
-
12roles/kubernetes/master/tasks/kubeadm-migrate-certs.yml
-
93roles/kubernetes/master/tasks/kubeadm-setup.yml
-
3roles/kubernetes/master/templates/kubeadm-config.yaml.j2
-
10roles/kubernetes/node/tasks/install.yml
-
7roles/kubernetes/node/tasks/main.yml
-
1roles/reset/tasks/main.yml
-
14tests/testcases/030_check-network.yml
-
2upgrade-cluster.yml
@ -0,0 +1,20 @@ |
|||
--- |
|||
#FIXME(mattymo): Exclude built in secrets that were automatically rotated, |
|||
#instead of filtering manually |
|||
- name: Rotate Tokens | Get all serviceaccount tokens to expire |
|||
shell: >- |
|||
{{ bin_dir }}/kubectl get secrets --all-namespaces |
|||
-o 'jsonpath={range .items[*]}{"\n"}{.metadata.namespace}{" "}{.metadata.name}{" "}{.type}{end}' |
|||
| grep kubernetes.io/service-account-token |
|||
| egrep 'default-token|kube-proxy|kube-dns|dnsmasq|netchecker|weave|calico|canal|flannel|dashboard|cluster-proportional-autoscaler|efk|tiller' |
|||
register: tokens_to_delete |
|||
run_once: true |
|||
|
|||
- name: Rotate Tokens | Delete expired tokens |
|||
command: "{{ bin_dir }}/kubectl delete secrets -n {{ item.split(' ')[0] }} {{ item.split(' ')[1] }}" |
|||
with_items: "{{ tokens_to_delete.stdout_lines }}" |
|||
run_once: true |
|||
|
|||
- name: Rotate Tokens | Delete pods in system namespace |
|||
command: "{{ bin_dir }}/kubectl delete pods -n {{ system_namespace }} --all" |
|||
run_once: true |
@ -0,0 +1,3 @@ |
|||
--- |
|||
- name: kubeadm | Purge old certs |
|||
command: "rm -f {{kube_cert_dir }}/*.pem" |
@ -0,0 +1,12 @@ |
|||
--- |
|||
- name: Copy old certs to the kubeadm expected path |
|||
copy: |
|||
src: "{{ kube_cert_dir }}/{{ item.src }}" |
|||
dest: "{{ kube_cert_dir }}/{{ item.dest }}" |
|||
remote_src: yes |
|||
with_items: |
|||
- {src: apiserver.pem, dest: apiserver.crt} |
|||
- {src: apiserver.pem, dest: apiserver.key} |
|||
- {src: ca.pem, dest: ca.crt} |
|||
- {src: ca-key.pem, dest: ca.key} |
|||
register: kubeadm_copy_old_certs |
Write
Preview
Loading…
Cancel
Save