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.

110 lines
4.0 KiB

  1. ---
  2. - hosts: localhost
  3. gather_facts: False
  4. roles:
  5. - { role: kubespray-defaults}
  6. - { role: bastion-ssh-config, tags: ["localhost", "bastion"]}
  7. - hosts: k8s-cluster:etcd:calico-rr
  8. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  9. gather_facts: false
  10. vars:
  11. # Need to disable pipelining for bootstrap-os as some systems have requiretty in sudoers set, which makes pipelining
  12. # fail. bootstrap-os fixes this on these systems, so in later plays it can be enabled.
  13. ansible_ssh_pipelining: false
  14. roles:
  15. - { role: kubespray-defaults}
  16. - { role: bootstrap-os, tags: bootstrap-os}
  17. - hosts: k8s-cluster:etcd:calico-rr
  18. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  19. vars:
  20. ansible_ssh_pipelining: true
  21. gather_facts: true
  22. - hosts: k8s-cluster:etcd:calico-rr
  23. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  24. roles:
  25. - { role: kubespray-defaults}
  26. - { role: kubernetes/preinstall, tags: preinstall }
  27. - { role: docker, tags: docker }
  28. - role: rkt
  29. tags: rkt
  30. when: "'rkt' in [etcd_deployment_type, kubelet_deployment_type, vault_deployment_type]"
  31. - hosts: etcd:k8s-cluster:vault
  32. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  33. roles:
  34. - { role: kubespray-defaults, when: "cert_management == 'vault'" }
  35. - { role: vault, tags: vault, vault_bootstrap: true, when: "cert_management == 'vault'" }
  36. - hosts: etcd
  37. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  38. roles:
  39. - { role: kubespray-defaults}
  40. - { role: etcd, tags: etcd, etcd_cluster_setup: true }
  41. - hosts: k8s-cluster
  42. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  43. roles:
  44. - { role: kubespray-defaults}
  45. - { role: etcd, tags: etcd, etcd_cluster_setup: false }
  46. - hosts: etcd:k8s-cluster:vault
  47. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  48. roles:
  49. - { role: kubespray-defaults, when: "cert_management == 'vault'"}
  50. - { role: vault, tags: vault, when: "cert_management == 'vault'"}
  51. #Handle upgrades to master components first to maintain backwards compat.
  52. - hosts: kube-master
  53. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  54. serial: 1
  55. roles:
  56. - { role: kubespray-defaults}
  57. - { role: upgrade/pre-upgrade, tags: pre-upgrade }
  58. - { role: kubernetes/node, tags: node }
  59. - { role: kubernetes/master, tags: master }
  60. - { role: network_plugin, tags: network }
  61. - { role: upgrade/post-upgrade, tags: post-upgrade }
  62. #Finally handle worker upgrades, based on given batch size
  63. - hosts: kube-node:!kube-master
  64. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  65. serial: "{{ serial | default('20%') }}"
  66. roles:
  67. - { role: kubespray-defaults}
  68. - { role: upgrade/pre-upgrade, tags: pre-upgrade }
  69. - { role: kubernetes/node, tags: node }
  70. - { role: network_plugin, tags: network }
  71. - { role: upgrade/post-upgrade, tags: post-upgrade }
  72. - { role: kubernetes/kubeadm, tags: kubeadm, when: "kubeadm_enabled" }
  73. - { role: kubespray-defaults}
  74. - hosts: kube-master
  75. any_errors_fatal: true
  76. roles:
  77. - { role: kubespray-defaults}
  78. - { role: kubernetes-apps/rotate_tokens, tags: rotate_tokens, when: "secret_changed|default(false)" }
  79. - { role: kubernetes-apps/network_plugin, tags: network }
  80. - { role: kubernetes-apps/policy_controller, tags: policy-controller }
  81. - { role: kubernetes/client, tags: client }
  82. - hosts: calico-rr
  83. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  84. roles:
  85. - { role: kubespray-defaults}
  86. - { role: network_plugin/calico/rr, tags: network }
  87. - hosts: k8s-cluster
  88. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  89. roles:
  90. - { role: kubespray-defaults}
  91. - { role: dnsmasq, when: "dns_mode == 'dnsmasq_kubedns'", tags: dnsmasq }
  92. - { role: kubernetes/preinstall, when: "dns_mode != 'none' and resolvconf_mode == 'host_resolvconf'", tags: resolvconf }
  93. - hosts: kube-master[0]
  94. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  95. roles:
  96. - { role: kubespray-defaults}
  97. - { role: kubernetes-apps, tags: apps }