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.

103 lines
2.7 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. register: remove_apiserver_container
  38. retries: 4
  39. until: remove_apiserver_container.rc == 0
  40. delay: 5
  41. - name: Master | Remove scheduler container
  42. shell: "docker ps -af name=k8s_kube-scheduler* -q | xargs --no-run-if-empty docker rm -f"
  43. register: remove_scheduler_container
  44. retries: 4
  45. until: remove_scheduler_container.rc == 0
  46. delay: 5
  47. - name: Master | Remove controller manager container
  48. shell: "docker ps -af name=k8s_kube-controller-manager* -q | xargs --no-run-if-empty docker rm -f"
  49. register: remove_cm_container
  50. retries: 4
  51. until: remove_cm_container.rc == 0
  52. delay: 5
  53. - name: Master | wait for kube-scheduler
  54. uri:
  55. url: http://localhost:10251/healthz
  56. register: scheduler_result
  57. until: scheduler_result.status == 200
  58. retries: 60
  59. delay: 5
  60. - name: Master | wait for kube-controller-manager
  61. uri:
  62. url: http://localhost:10252/healthz
  63. register: controller_manager_result
  64. until: controller_manager_result.status == 200
  65. retries: 15
  66. delay: 5
  67. - name: Master | wait for the apiserver to be running
  68. uri:
  69. url: "{{ kube_apiserver_endpoint }}/healthz"
  70. validate_certs: no
  71. client_cert: "{{ kube_apiserver_client_cert }}"
  72. client_key: "{{ kube_apiserver_client_key }}"
  73. register: result
  74. until: result.status == 200
  75. retries: 30
  76. delay: 10
  77. - name: Master | set secret_changed
  78. command: /bin/true
  79. notify:
  80. - Master | set secret_changed to true
  81. - Master | clear kubeconfig for root user
  82. - name: Master | set secret_changed to true
  83. set_fact:
  84. secret_changed: true
  85. - name: Master | clear kubeconfig for root user
  86. file:
  87. path: /root/.kube/config
  88. state: absent