Browse Source
Forcefully delete pods when necessary (#4328)
Pods on down/unresponsive nodes can't be deleted without
--force --grace-period=0.
Fixes #4314
pull/4350/head
Matthew Mosesohn
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
2 additions and
2 deletions
-
roles/kubernetes-apps/rotate_tokens/tasks/main.yml
-
roles/kubernetes/kubeadm/tasks/main.yml
|
@ -44,5 +44,5 @@ |
|
|
when: needs_rotation |
|
|
when: needs_rotation |
|
|
|
|
|
|
|
|
- name: Rotate Tokens | Delete pods in system namespace |
|
|
- name: Rotate Tokens | Delete pods in system namespace |
|
|
command: "{{ bin_dir }}/kubectl --kubeconfig /etc/kubernetes/admin.conf delete pods -n kube-system --all" |
|
|
|
|
|
|
|
|
command: "{{ bin_dir }}/kubectl --kubeconfig /etc/kubernetes/admin.conf delete pods -n kube-system --all --grace-period=0 --force" |
|
|
when: needs_rotation |
|
|
when: needs_rotation |
|
@ -133,7 +133,7 @@ |
|
|
- kube-proxy |
|
|
- kube-proxy |
|
|
|
|
|
|
|
|
- name: Restart all kube-proxy pods to ensure that they load the new configmap |
|
|
- name: Restart all kube-proxy pods to ensure that they load the new configmap |
|
|
shell: "{{ bin_dir }}/kubectl --kubeconfig {{ kube_config_dir }}/admin.conf delete pod -n kube-system -l k8s-app=kube-proxy" |
|
|
|
|
|
|
|
|
shell: "{{ bin_dir }}/kubectl --kubeconfig {{ kube_config_dir }}/admin.conf delete pod -n kube-system -l k8s-app=kube-proxy --force --grace-period=0" |
|
|
delegate_to: "{{groups['kube-master']|first}}" |
|
|
delegate_to: "{{groups['kube-master']|first}}" |
|
|
run_once: true |
|
|
run_once: true |
|
|
when: |
|
|
when: |
|
|