Jelajahi Sumber

Cleanup upgrades - control plane + registry_auth

Control plane upgrade currently has a lot of logic leftover
from upgrades to static pods in 3.10.  This commit cleans
up that logic and ensures registry auth playbooks are
run at the proper time.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1620715
Michael Gugino 6 tahun lalu
induk
melakukan
7562d3d508

+ 0 - 13
playbooks/common/openshift-cluster/upgrades/v3_11/label_nodes.yml

@@ -1,13 +0,0 @@
----
-
-- name: Set node schedulability
-  hosts: oo_masters_to_config
-  roles:
-    - openshift_facts
-    - lib_openshift
-  tasks:
-    - import_role:
-        name: openshift_manage_node
-        tasks_from: config.yml
-      vars:
-        openshift_master_host: '{{ groups.oo_first_master.0 }}'

+ 4 - 33
playbooks/common/openshift-cluster/upgrades/v3_11/upgrade_control_plane.yml

@@ -68,25 +68,6 @@
     - openshift_reconcile_sccs_reject_change | default(true) | bool
     - check_reconcile_scc_result.stdout != '' or check_reconcile_scc_result.rc != 0
 
-- name: Flag pre-upgrade checks complete for hosts without errors
-  hosts: oo_masters_to_config:oo_etcd_to_config
-  tasks:
-  - set_fact:
-      pre_upgrade_complete: True
-
-- import_playbook: label_nodes.yml
-
-# To upgrade, we need masters to be capable of signing certificates
-- hosts: oo_masters
-  serial: 1
-  tasks:
-  - name: Enable core bootstrapping components
-    include_tasks: ../../../../openshift-master/private/tasks/enable_bootstrap.yml
-  - name: Place shim commands on the masters before we begin the upgrade
-    import_role:
-      name: openshift_control_plane
-      tasks_from: static_shim
-
 # TODO: need to verify settings about the bootstrap configs
 # 1. Does network policy match the master config
 
@@ -100,21 +81,14 @@
 
 - name: Configure components that must be available prior to upgrade
   hosts: oo_first_master
-  pre_tasks:
-  - name: Enable core bootstrapping components
-    include_tasks: ../../../../openshift-master/private/tasks/enable_bootstrap_config.yml
-  - name: Ensure the master bootstrap config has bootstrapping config
-    import_role:
-      name: openshift_node_group
-      tasks_from: upgrade
-  - name: Enable node configuration reconciliation
-    import_role:
-      name: openshift_node_group
-      tasks_from: sync
   roles:
   - role: openshift_sdn
     when: openshift_use_openshift_sdn | default(True) | bool
 
+- import_playbook: ../upgrade_control_plane.yml
+  vars:
+    openshift_release: '3.11'
+
 - name: Update master nodes
   hosts: oo_masters
   serial: 1
@@ -132,9 +106,6 @@
           ('glusterfs' in groups and inventory_hostname in groups['glusterfs'])
           or ('glusterfs_registry' in groups and inventory_hostname in groups['glusterfs_registry'])
 
-- import_playbook: ../upgrade_control_plane.yml
-  vars:
-    openshift_release: '3.11'
 
 - import_playbook: ../post_control_plane.yml
 

+ 0 - 6
playbooks/common/openshift-cluster/upgrades/v3_11/upgrade_nodes.yml

@@ -29,12 +29,6 @@
 # Need to run sanity checks after version has been run.
 - import_playbook: ../../../../init/sanity_checks.yml
 
-- name: Flag pre-upgrade checks complete for hosts without errors
-  hosts: oo_masters_to_config:oo_nodes_to_upgrade:oo_etcd_to_config
-  tasks:
-  - set_fact:
-      pre_upgrade_complete: True
-
 # Pre-upgrade completed
 
 - import_playbook: ../upgrade_nodes.yml

+ 4 - 0
playbooks/openshift-master/private/registry_auth.yml

@@ -7,3 +7,7 @@
   - import_role:
       name: openshift_control_plane
       tasks_from: registry_auth.yml
+
+- import_playbook: restart.yml
+  vars:
+    openshift_rolling_restart_mode: 'services'

+ 2 - 0
roles/openshift_control_plane/tasks/main.yml

@@ -40,6 +40,8 @@
     owner: root
     group: root
 
+- import_tasks: registry_auth.yml
+
 - name: Create config parent directory if it does not exist
   file:
     path: "/etc/origin/master"

+ 0 - 1
roles/openshift_control_plane/tasks/registry_auth.yml

@@ -15,7 +15,6 @@
   when:
   - oreg_auth_user is defined
   register: master_oreg_auth_credentials_create
-  notify: restart master
   retries: 3
   delay: 5
   until: master_oreg_auth_credentials_create is succeeded

+ 2 - 0
roles/openshift_control_plane/tasks/upgrade.yml

@@ -1,4 +1,6 @@
 ---
+- import_tasks: registry_auth.yml
+
 - import_tasks: static_shim.yml
 
 - import_tasks: upgrade/upgrade_scheduler.yml