From cc3cdbd6474e574a20bc71b35cb6875e359875aa Mon Sep 17 00:00:00 2001 From: Kaustubh Dhokte Date: Mon, 13 Jun 2022 21:46:36 -0400 Subject: [PATCH] apply feature-gate update during upgrade-activate This change adds a method to apply 'update-k8s-feature-gates' puppet class on both controllers during platform upgrade activate phase. Depends-On: https://review.opendev.org/c/starlingx/stx-puppet/+/845651 Test Plan: (CentOS) On AIO-SX and AIO-DX: PASS: Full platform upgrade successful PASS: Check logs if puppet manifest is successfully applied on both the controllers. Story: 2009789 Task: 44765 Signed-off-by: Kaustubh Dhokte Change-Id: I9cb494a72b7ad62476378f3512cb55c94596eb1e --- .../sysinv/sysinv/sysinv/conductor/manager.py | 22 +++++++++++++++++++ tsconfig/tsconfig/tsconfig/tsconfig.py | 1 + 2 files changed, 23 insertions(+) diff --git a/sysinv/sysinv/sysinv/sysinv/conductor/manager.py b/sysinv/sysinv/sysinv/sysinv/conductor/manager.py index 707cdb298f..29321edaec 100644 --- a/sysinv/sysinv/sysinv/sysinv/conductor/manager.py +++ b/sysinv/sysinv/sysinv/sysinv/conductor/manager.py @@ -1727,6 +1727,25 @@ class ConductorManager(service.PeriodicService): self._config_apply_runtime_manifest( context, config_uuid=config_uuid, config_dict=config_dict) + def _update_kubeadm_feature_gates(self, context): + """Applies the runtime manifest to change kubernetes feature gates. + Applied on both the controllers + returns True if runtime manifests were applied + """ + personalities = [constants.CONTROLLER] + config_uuid = self._config_update_hosts( + context, personalities) + config_dict = { + "personalities": personalities, + "classes": ['platform::kubernetes::master::update_kubeadm_feature_gates'], + puppet_common.REPORT_STATUS_CFG: + puppet_common.REPORT_UPGRADE_ACTIONS + } + self._config_apply_runtime_manifest(context, + config_uuid=config_uuid, + config_dict=config_dict) + return True + def update_keystone_password(self, context): """This method calls a puppet class 'openstack::keystone::password::runtime' @@ -12006,6 +12025,9 @@ class ConductorManager(service.PeriodicService): # Make sure to remove v1 from address format after upgrade manifests_applied |= self._update_upgraded_ceph_monitors(context) + if from_version == tsc.SW_VERSION_21_12: + manifests_applied |= self._update_kubeadm_feature_gates(context) + if manifests_applied: LOG.info("Running upgrade activation manifests") self.dbapi.software_upgrade_update( diff --git a/tsconfig/tsconfig/tsconfig/tsconfig.py b/tsconfig/tsconfig/tsconfig/tsconfig.py index 5d048205f3..fcd14fff6d 100644 --- a/tsconfig/tsconfig/tsconfig/tsconfig.py +++ b/tsconfig/tsconfig/tsconfig/tsconfig.py @@ -14,6 +14,7 @@ from six.moves import configparser SW_VERSION = "" SW_VERSION_21_05 = "21.05" +SW_VERSION_21_12 = "21.12" nodetype = None subfunctions = []