upgrade_control_plane.yml 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. ---
  2. #
  3. # Control Plane Upgrade Playbook
  4. #
  5. # Upgrades masters and Docker (only on standalone etcd hosts)
  6. #
  7. # This upgrade does not include:
  8. # - node service running on masters
  9. # - docker running on masters
  10. # - node service running on dedicated nodes
  11. #
  12. # You can run the upgrade_nodes.yml playbook after this to upgrade these components separately.
  13. #
  14. - import_playbook: ../init.yml
  15. vars:
  16. l_upgrade_no_switch_firewall_hosts: "oo_masters_to_config:oo_etcd_to_config:oo_lb_to_config"
  17. l_init_fact_hosts: "oo_masters_to_config:oo_etcd_to_config:oo_lb_to_config"
  18. l_base_packages_hosts: "oo_masters_to_config:oo_etcd_to_config:oo_lb_to_config"
  19. l_upgrade_cert_check_hosts: "oo_masters_to_config:oo_etcd_to_config"
  20. - name: Configure the upgrade target for the common upgrade tasks 3.11
  21. hosts: oo_masters_to_config:oo_etcd_to_config:oo_lb_to_config
  22. tasks:
  23. - set_fact:
  24. openshift_upgrade_target: '3.11'
  25. openshift_upgrade_min: '3.10'
  26. openshift_release: '3.11'
  27. - import_playbook: ../pre/config.yml
  28. # These vars a meant to exclude oo_nodes from plays that would otherwise include
  29. # them by default.
  30. vars:
  31. l_openshift_version_set_hosts: "oo_etcd_to_config:oo_masters_to_config:!oo_first_master"
  32. l_upgrade_repo_hosts: "oo_masters_to_config:oo_etcd_to_config:oo_lb_to_config"
  33. l_upgrade_no_proxy_hosts: "oo_masters_to_config"
  34. l_upgrade_health_check_hosts: "oo_masters_to_config:oo_etcd_to_config:oo_lb_to_config"
  35. l_upgrade_verify_targets_hosts: "oo_masters_to_config"
  36. l_upgrade_docker_target_hosts: "oo_masters_to_config:oo_etcd_to_config"
  37. l_upgrade_excluder_hosts: "oo_masters_to_config"
  38. openshift_protect_installed_version: False
  39. # Need to run sanity checks after version has been run.
  40. - import_playbook: ../../../../init/sanity_checks.yml
  41. vars:
  42. # oo_lb_to_config might not be present; Can't use !oo_nodes because masters are nodes.
  43. l_sanity_check_hosts: "{{ groups['oo_etcd_to_config'] | union(groups['oo_masters_to_config']) | union(groups['oo_lb_to_config'] | default([]) ) }}"
  44. # Some change makes critical outage on current cluster.
  45. - name: Confirm upgrade will not make critical changes
  46. hosts: oo_first_master
  47. tasks:
  48. - name: Confirm Reconcile Security Context Constraints will not change current SCCs
  49. command: >
  50. {{ openshift_client_binary }} adm policy --config={{ openshift.common.config_base }}/master/admin.kubeconfig reconcile-sccs --additive-only=true -o name
  51. register: check_reconcile_scc_result
  52. when: openshift_reconcile_sccs_reject_change | default(true) | bool
  53. until: check_reconcile_scc_result.rc == 0
  54. retries: 3
  55. - fail:
  56. msg: >
  57. Changes to bootstrapped SCCs have been detected. Please review the changes by running
  58. "{{ openshift_client_binary }} adm policy --config={{ openshift.common.config_base }}/master/admin.kubeconfig reconcile-sccs --additive-only=true"
  59. After reviewing the changes please apply those changes by adding the '--confirm' flag.
  60. Do not modify the default SCCs. Customizing the default SCCs will cause this check to fail when upgrading.
  61. If you require non standard SCCs please refer to https://docs.okd.io/latest/admin_guide/manage_scc.html
  62. when:
  63. - openshift_reconcile_sccs_reject_change | default(true) | bool
  64. - check_reconcile_scc_result.stdout != '' or check_reconcile_scc_result.rc != 0
  65. # TODO: need to verify settings about the bootstrap configs
  66. # 1. Does network policy match the master config
  67. - name: Ensure metrics-server is installed before upgrading the controller-manager
  68. hosts: oo_first_master
  69. roles:
  70. - role: metrics_server
  71. # a default is set on the actual variable in the role, so no fancy logic is needed here
  72. when: openshift_metrics_server_install | default(true) | bool
  73. - name: Configure components that must be available prior to upgrade
  74. hosts: oo_first_master
  75. roles:
  76. - role: openshift_sdn
  77. when: openshift_use_openshift_sdn | default(True) | bool
  78. - import_playbook: ../upgrade_control_plane.yml
  79. vars:
  80. openshift_release: '3.11'
  81. - name: Update master nodes
  82. hosts: oo_masters
  83. serial: 1
  84. tasks:
  85. - import_role:
  86. name: openshift_node
  87. tasks_from: upgrade_pre
  88. - import_role:
  89. name: openshift_node
  90. tasks_from: upgrade
  91. - import_role:
  92. name: openshift_storage_glusterfs
  93. tasks_from: check_cluster_health.yml
  94. when: >
  95. ('glusterfs' in groups and inventory_hostname in groups['glusterfs'])
  96. or ('glusterfs_registry' in groups and inventory_hostname in groups['glusterfs_registry'])
  97. - import_playbook: ../post_control_plane.yml
  98. - hosts: oo_masters
  99. tasks:
  100. - import_role:
  101. name: openshift_web_console
  102. tasks_from: remove_old_asset_config
  103. # This is a one time migration. No need to save it in the 3.11.
  104. # https://bugzilla.redhat.com/show_bug.cgi?id=1565736
  105. - hosts: oo_first_master
  106. tasks:
  107. - import_role:
  108. name: openshift_hosted
  109. tasks_from: registry_service_account.yml
  110. when: openshift_hosted_manage_registry | default(True) | bool
  111. - import_role:
  112. name: openshift_hosted
  113. tasks_from: remove_legacy_env_variables.yml
  114. when: openshift_hosted_manage_registry | default(True) | bool