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.

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