You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

88 lines
2.3 KiB

9 years ago
  1. ---
  2. - name: Master | restart kubelet
  3. command: /bin/true
  4. notify:
  5. - Master | reload systemd
  6. - Master | reload kubelet
  7. - Master | wait for master static pods
  8. - name: Master | wait for master static pods
  9. command: /bin/true
  10. notify:
  11. - Master | wait for the apiserver to be running
  12. - Master | wait for kube-scheduler
  13. - Master | wait for kube-controller-manager
  14. - name: Master | Restart apiserver
  15. command: /bin/true
  16. notify:
  17. - Master | Remove apiserver container
  18. - Master | wait for the apiserver to be running
  19. - name: Master | Restart kube-scheduler
  20. command: /bin/true
  21. notify:
  22. - Master | Remove scheduler container
  23. - Master | wait for kube-scheduler
  24. - name: Master | Restart kube-controller-manager
  25. command: /bin/true
  26. notify:
  27. - Master | Remove controller manager container
  28. - Master | wait for kube-controller-manager
  29. - name: Master | reload systemd
  30. command: systemctl daemon-reload
  31. - name: Master | reload kubelet
  32. service:
  33. name: kubelet
  34. state: restarted
  35. - name: Master | Remove apiserver container
  36. shell: "docker ps -af name=k8s_kube-apiserver* -q | xargs --no-run-if-empty docker rm -f"
  37. - name: Master | Remove scheduler container
  38. shell: "docker ps -af name=k8s_kube-scheduler* -q | xargs --no-run-if-empty docker rm -f"
  39. - name: Master | Remove controller manager container
  40. shell: "docker ps -af name=k8s_kube-controller-manager* -q | xargs --no-run-if-empty docker rm -f"
  41. - name: Master | wait for kube-scheduler
  42. uri:
  43. url: http://localhost:10251/healthz
  44. register: scheduler_result
  45. until: scheduler_result.status == 200
  46. retries: 60
  47. delay: 5
  48. - name: Master | wait for kube-controller-manager
  49. uri:
  50. url: http://localhost:10252/healthz
  51. register: controller_manager_result
  52. until: controller_manager_result.status == 200
  53. retries: 15
  54. delay: 5
  55. - name: Master | wait for the apiserver to be running
  56. uri:
  57. url: "{{ kube_apiserver_insecure_endpoint }}/healthz"
  58. register: result
  59. until: result.status == 200
  60. retries: 20
  61. delay: 6
  62. - name: Master | set secret_changed
  63. command: /bin/true
  64. notify:
  65. - Master | set secret_changed to true
  66. - Master | clear kubeconfig for root user
  67. - name: Master | set secret_changed to true
  68. set_fact:
  69. secret_changed: true
  70. - name: Master | clear kubeconfig for root user
  71. file:
  72. path: /root/.kube/config
  73. state: absent