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.

119 lines
4.3 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. serial: "{{ serial | default('20%') }}"
  25. roles:
  26. - { role: kubespray-defaults}
  27. - { role: kubernetes/preinstall, tags: preinstall }
  28. - { role: docker, tags: docker }
  29. - role: rkt
  30. tags: rkt
  31. when: "'rkt' in [etcd_deployment_type, kubelet_deployment_type, vault_deployment_type]"
  32. - { role: download, tags: download, skip_downloads: false }
  33. - hosts: etcd:k8s-cluster:vault
  34. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  35. roles:
  36. - { role: kubespray-defaults, when: "cert_management == 'vault'" }
  37. - { role: vault, tags: vault, vault_bootstrap: true, when: "cert_management == 'vault'" }
  38. - hosts: etcd
  39. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  40. roles:
  41. - { role: kubespray-defaults}
  42. - { role: etcd, tags: etcd, etcd_cluster_setup: true }
  43. - hosts: k8s-cluster
  44. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  45. roles:
  46. - { role: kubespray-defaults}
  47. - { role: etcd, tags: etcd, etcd_cluster_setup: false }
  48. - hosts: etcd:k8s-cluster:vault
  49. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  50. roles:
  51. - { role: kubespray-defaults, when: "cert_management == 'vault'"}
  52. - { role: vault, tags: vault, when: "cert_management == 'vault'"}
  53. #Handle upgrades to master components first to maintain backwards compat.
  54. - hosts: kube-master
  55. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  56. serial: 1
  57. roles:
  58. - { role: kubespray-defaults}
  59. - { role: upgrade/pre-upgrade, tags: pre-upgrade }
  60. - { role: kubernetes/node, tags: node }
  61. - { role: kubernetes/master, tags: master }
  62. - { role: kubernetes/client, tags: client }
  63. - { role: kubernetes-apps/cluster_roles, tags: cluster-roles }
  64. - { role: network_plugin, tags: network }
  65. - { role: upgrade/post-upgrade, tags: post-upgrade }
  66. #Finally handle worker upgrades, based on given batch size
  67. - hosts: kube-node:!kube-master
  68. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  69. serial: "{{ serial | default('20%') }}"
  70. roles:
  71. - { role: kubespray-defaults}
  72. - { role: upgrade/pre-upgrade, tags: pre-upgrade }
  73. - { role: kubernetes/node, tags: node }
  74. - { role: network_plugin, tags: network }
  75. - { role: upgrade/post-upgrade, tags: post-upgrade }
  76. - { role: kubernetes/kubeadm, tags: kubeadm, when: "kubeadm_enabled" }
  77. - { role: kubespray-defaults}
  78. - hosts: kube-master[0]
  79. any_errors_fatal: true
  80. roles:
  81. - { role: kubespray-defaults}
  82. - { role: kubernetes-apps/rotate_tokens, tags: rotate_tokens, when: "secret_changed|default(false)" }
  83. - hosts: kube-master
  84. any_errors_fatal: true
  85. roles:
  86. - { role: kubespray-defaults}
  87. - { role: kubernetes-apps/network_plugin, tags: network }
  88. - { role: kubernetes-apps/policy_controller, tags: policy-controller }
  89. - { role: kubernetes/client, tags: client }
  90. - hosts: calico-rr
  91. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  92. roles:
  93. - { role: kubespray-defaults}
  94. - { role: network_plugin/calico/rr, tags: network }
  95. - hosts: k8s-cluster
  96. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  97. roles:
  98. - { role: kubespray-defaults}
  99. - { role: dnsmasq, when: "dns_mode == 'dnsmasq_kubedns'", tags: dnsmasq }
  100. - { role: kubernetes/preinstall, when: "dns_mode != 'none' and resolvconf_mode == 'host_resolvconf'", tags: resolvconf }
  101. - hosts: kube-master[0]
  102. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  103. roles:
  104. - { role: kubespray-defaults}
  105. - { role: kubernetes-apps, tags: apps }