From 2c808cbad78030879731ec9c292fb04a7b7d8c58 Mon Sep 17 00:00:00 2001 From: Latha Sivakumar Date: Tue, 8 Nov 2022 10:30:21 -0500 Subject: [PATCH 1/9] (#184) K8s minimum version check --- .../library/pre_install_check.py | 68 ++++++++++-------- .../library/utils/viya_constants.py | 3 - .../library/utils/viya_messages.py | 2 +- pre_install_report/pre_install_report.py | 12 +++- .../test/test_pre_install_report.py | 69 ++++++++++--------- .../viya_deployment_settings.ini | 5 +- 6 files changed, 88 insertions(+), 71 deletions(-) diff --git a/pre_install_report/library/pre_install_check.py b/pre_install_report/library/pre_install_check.py index 2cf15d5..5489956 100644 --- a/pre_install_report/library/pre_install_check.py +++ b/pre_install_report/library/pre_install_check.py @@ -55,7 +55,7 @@ class ViyaPreInstallCheck(): The gathered data can be written to disk as an HTML report and a JSON file containing the gathered data. """ - def __init__(self, sas_logger: ViyaARKLogger, viya_kubelet_version_min, + def __init__(self, sas_logger: ViyaARKLogger, viya_k8s_version_min, viya_min_aggregate_worker_CPU_cores, viya_min_aggregate_worker_memory): """ @@ -65,7 +65,8 @@ def __init__(self, sas_logger: ViyaARKLogger, viya_kubelet_version_min, self._kubectl: KubectlInterface = None self.sas_logger = sas_logger self.logger = self.sas_logger.get_logger() - self._viya_kubelet_version_min = viya_kubelet_version_min + self._viya_k8s_version_min = viya_k8s_version_min + self._validated_kubernetes_version_min = None self._viya_min_aggregate_worker_CPU_cores: Text = viya_min_aggregate_worker_CPU_cores self._viya_min_aggregate_worker_memory: Text = viya_min_aggregate_worker_memory self._calculated_aggregate_memory = None @@ -76,21 +77,26 @@ def __init__(self, sas_logger: ViyaARKLogger, viya_kubelet_version_min, def _parse_release_info(self, release_info): """ - This method checks that the format of the VIYA_KUBELET_VERSION_MIN specfied in the - user modifiable properies file is valid. + This method checks that the format of the VIYA_K8s_VERSION_MIN specified in the + user modifiable ini file is valid. - :param release_info: The minimum Kubelet version loaded from properties file. - :return tuple of major version, minor version, patch + :param release_info: The minimum K8s version loaded from ini file. + :return tuple of major version, minor version """ try: info = tuple(release_info.split(".")) - return info + if (len(info) == 2): + x = [int(i) for a, i in enumerate(info)] + self.logger.debug('release tuple to int {} '.format(x)) + k8s_min_rel_str = ''.join(release_info) + self._validated_kubernetes_version_min = k8s_min_rel_str + else: + print('****' + viya_messages.KUBELET_VERSION_ERROR) + sys.exit(viya_messages.BAD_OPT_RC_) + except ValueError: print(viya_messages.KUBELET_VERSION_ERROR) sys.exit(viya_messages.BAD_OPT_RC_) - if (len(info) != 3): - print(viya_messages.KUBELET_VERSION_ERROR) - sys.exit(viya_messages.BAD_OPT_RC_) def _validate_k8s_server_version(self, version): """ @@ -140,7 +146,10 @@ def _k8s_server_version_min(self): try: curr_version = semantic_version.Version(str(self._k8s_server_version)) - if(curr_version in semantic_version.SimpleSpec(viya_constants.MIN_K8S_SERVER_VERSION)): + self._parse_release_info(self._viya_k8s_version_min) + min_k8s_version = "<" + self._validated_kubernetes_version_min + + if(curr_version in semantic_version.SimpleSpec(min_k8s_version)): self.logger.error("This release of Kubernetes is not supported {}.{}.x" .format(str(curr_version.major), str(curr_version.minor))) @@ -683,26 +692,26 @@ def _check_memory_errors(self, global_data, total_capacity_memory, quantity_, ag global_data.append(aggregate_memory_data) return global_data - def _check_kubelet_errors(self, global_data, aggregate_kubelet_failures): + def _check_k8s_errors(self, global_data, aggregate_k8s_failures): """ - Check kubelet version against SAS kubelet version requirements + Check Server k8s version against SAS k8s version requirements global_data: list with global data about worker nodes retrieved - aggregate_kubelet_failures: count of kubelet version errors + aggregate_k8s_failures: count of k8s version errors return: updated global data about worker nodes retrieved """ - aggregate_kubelet_data = {} + aggregate_k8s_data = {} node_status_msg = "" if self._aggregate_nodeStatus_failures > 0: node_status_msg = " Check Node(s). All Nodes NOT in Ready Status." \ + ' Issues Found: ' + str(self._aggregate_nodeStatus_failures) - aggregate_kubelet_data.update({'aggregate_kubelet_failures': node_status_msg}) - if aggregate_kubelet_failures > 0: - aggregate_kubelet_data.update({'aggregate_kubelet_failures': - 'Check Kubelet Version on nodes.' + - ' Issues Found: ' + str(aggregate_kubelet_failures) + - '.' + node_status_msg}) - global_data.append(aggregate_kubelet_data) + aggregate_k8s_data.update({'aggregate_k8s_failures': node_status_msg}) + if aggregate_k8s_failures > 0: + aggregate_k8s_data.update({'aggregate_k8s_failures:': + 'Check K8s Version on nodes.' + + ' Issues Found: ' + str(aggregate_k8s_failures) + + '.' + node_status_msg}) + global_data.append(aggregate_k8s_data) return global_data @@ -795,7 +804,7 @@ def evaluate_nodes(self, nodes_data, global_data, cluster_info, quantity_): """ aggregate_cpu_failures = int(0) aggregate_memory_failures = int(0) - aggregate_kubelet_failures = int(0) + aggregate_k8s_failures = int(0) total_cpu_cores = float(0) total_capacity_memory = quantity_("0G") @@ -838,10 +847,10 @@ def evaluate_nodes(self, nodes_data, global_data, cluster_info, quantity_): else: self._set_status(1, node, 'kubeletversion') node['error']['kubeletversion'] = viya_constants.SET + ': ' + kubeletversion + ', ' + \ - str(viya_constants.EXPECTED) + ': ' + viya_constants.MIN_K8S_SERVER_VERSION[1:] + ' or later ' + str(viya_constants.EXPECTED) + ': ' + self._validated_kubernetes_version_min + ' or later ' - aggregate_kubelet_failures += 1 - self.logger.debug("aggregate_kubelet_failures {} ".format(str(aggregate_kubelet_failures))) + aggregate_k8s_failures += 1 + self.logger.debug("aggregate_k8s_failures {} ".format(str(aggregate_k8s_failures))) self.logger.debug("node kubeletversion{} ".format(pprint.pformat(node))) global_data = self._check_workers(global_data, nodes_data) @@ -850,7 +859,7 @@ def evaluate_nodes(self, nodes_data, global_data, cluster_info, quantity_): global_data = self._check_memory_errors(global_data, total_capacity_memory, quantity_, aggregate_memory_failures) - global_data = self._check_kubelet_errors(global_data, aggregate_kubelet_failures) + global_data = self._check_k8s_errors(global_data, aggregate_k8s_failures) global_data.append(nodes_data) global_data = self._update_k8s_version(global_data, self._k8s_server_version) @@ -876,7 +885,7 @@ def _get_cpu_units(self, node, key): def _set_status(self, status, node, key): """Set the status flag on dictionary object with node details - to indicate compliance with - cpu, memory kubelet version requirements + cpu, memory k8s version requirements status: status to be set on dict objectwith node details node: node dictionary object @@ -1055,6 +1064,9 @@ def get_calculated_aggregate_memory(self): def set_k8s_version(self, version: Text): self._k8s_server_version = version + def set_k8s_version_min(self, version: Text): + self._viya_k8s_version_min = version + def generate_report(self, global_data, master_data, diff --git a/pre_install_report/library/utils/viya_constants.py b/pre_install_report/library/utils/viya_constants.py index 74d8bfc..3643298 100644 --- a/pre_install_report/library/utils/viya_constants.py +++ b/pre_install_report/library/utils/viya_constants.py @@ -61,6 +61,3 @@ VIYA_PERCENTAGE_OF_INSTANCE = "85" MEMORY_WITHIN_RANGE = " Memory within Range" SERVER_K8S_VERSION = "Server_k8s_version" - -# Any versions below this minimum are not supported -MIN_K8S_SERVER_VERSION = '<1.20' diff --git a/pre_install_report/library/utils/viya_messages.py b/pre_install_report/library/utils/viya_messages.py index fae9e32..8cfe9b5 100644 --- a/pre_install_report/library/utils/viya_messages.py +++ b/pre_install_report/library/utils/viya_messages.py @@ -20,7 +20,7 @@ "to access the Kubernetes cluster." CHECK_NAMESPACE = ' ERROR: Check available permissions in namespace and if it is valid: ' LIMIT_ERROR = 'ERROR: The value in the viya_deployment_settings.ini file is not valid: {} = {}' -KUBELET_VERSION_ERROR = 'ERROR: Check the VIYA_KUBELET_VERSION_MIN value ' \ +KUBELET_VERSION_ERROR = 'ERROR: Check the VIYA_K8S_VERSION_MIN value ' \ 'specified in the pre_install_report/viya_deployment_settings.ini file' OPTION_ERROR = "ERROR: option {} not recognized" OPTION_VALUES_ERROR = "ERROR: Provide valid values for all required options. Check options -i, -p and -H." diff --git a/pre_install_report/pre_install_report.py b/pre_install_report/pre_install_report.py index f7467c7..2bbc752 100644 --- a/pre_install_report/pre_install_report.py +++ b/pre_install_report/pre_install_report.py @@ -252,10 +252,18 @@ def main(argv): check_limits = _read_config_file('viya_deployment_settings.ini') with LRPIndicator(enter_message="Gathering facts"): - sas_pre_check_report: ViyaPreInstallCheck = \ - ViyaPreInstallCheck(sas_logger, check_limits['items']['VIYA_KUBELET_VERSION_MIN'], + try: + sas_pre_check_report: ViyaPreInstallCheck = \ + ViyaPreInstallCheck(sas_logger, check_limits['items']['VIYA_K8S_VERSION_MIN'], check_limits['items']['VIYA_MIN_AGGREGATE_WORKER_CPU_CORES'], check_limits['items']['VIYA_MIN_AGGREGATE_WORKER_MEMORY']) + except KeyError as e: + print() + print(viya_messages.EXCEPTION_MESSAGE.format(e) + + ' Check for missing key/value in the viya_deployment_settings.ini') + print() + sys.exit(viya_messages.RUNTIME_ERROR_RC_) + # gather the details for the report try: print() diff --git a/pre_install_report/test/test_pre_install_report.py b/pre_install_report/test/test_pre_install_report.py index 415509d..0607515 100644 --- a/pre_install_report/test/test_pre_install_report.py +++ b/pre_install_report/test/test_pre_install_report.py @@ -38,7 +38,7 @@ _NAMESPACE_NOT_FOUND_RC_ = 6 _RUNTIME_ERROR_RC_ = 7 -viya_kubelet_version_min = 'v1.14.0' +viya_k8s_version_min = '1.14' viya_kubenetes_version = "1.22.4" viya_min_aggregate_worker_CPU_cores = '12' viya_min_aggregate_worker_memory = '56G' @@ -50,7 +50,7 @@ def test_get_storage_classes_json(): - vpc = createViyaPreInstallCheck(viya_kubelet_version_min, + vpc = createViyaPreInstallCheck(viya_k8s_version_min, viya_min_aggregate_worker_CPU_cores, viya_min_aggregate_worker_memory) @@ -69,7 +69,7 @@ def test_get_storage_classes_json(): def test_read_cluster_info_output(): - vpc = createViyaPreInstallCheck(viya_kubelet_version_min, + vpc = createViyaPreInstallCheck(viya_k8s_version_min, viya_min_aggregate_worker_CPU_cores, viya_min_aggregate_worker_memory) cluster_info = "Kubernetes master is running at https://0.0.0.0:6443\n" + \ @@ -81,7 +81,7 @@ def test_read_cluster_info_output(): def test_delete_temp_file(): - vpc = createViyaPreInstallCheck(viya_kubelet_version_min, + vpc = createViyaPreInstallCheck(viya_k8s_version_min, viya_min_aggregate_worker_CPU_cores, viya_min_aggregate_worker_memory) @@ -96,7 +96,7 @@ def test_delete_temp_file(): def test_get_master_nodes_json(): - vpc = createViyaPreInstallCheck(viya_kubelet_version_min, + vpc = createViyaPreInstallCheck(viya_k8s_version_min, viya_min_aggregate_worker_CPU_cores, viya_min_aggregate_worker_memory) @@ -110,7 +110,7 @@ def test_get_master_nodes_json(): def test_ranchersingle_get_master_nodes_json(): - vpc = createViyaPreInstallCheck(viya_kubelet_version_min, + vpc = createViyaPreInstallCheck(viya_k8s_version_min, viya_min_aggregate_worker_CPU_cores, viya_min_aggregate_worker_memory) @@ -129,7 +129,7 @@ def test_ranchersingle_get_master_nodes_json(): def test_ranchermulti_get_master_nodes_json(): - vpc = createViyaPreInstallCheck(viya_kubelet_version_min, + vpc = createViyaPreInstallCheck(viya_k8s_version_min, viya_min_aggregate_worker_CPU_cores, viya_min_aggregate_worker_memory) @@ -146,7 +146,7 @@ def test_ranchermulti_get_master_nodes_json(): def test_get_nested_nodes_info(): viya_min_aggregate_worker_CPU_cores = '20' - vpc = createViyaPreInstallCheck(viya_kubelet_version_min, + vpc = createViyaPreInstallCheck(viya_k8s_version_min, viya_min_aggregate_worker_CPU_cores, viya_min_aggregate_worker_memory) @@ -180,17 +180,17 @@ def test_get_nested_nodes_info(): total_aggregate_memoryG = vpc.get_calculated_aggregate_memory() # quantity_("62.3276481628418 Gi").to('G') assert str(round(total_aggregate_memoryG.to("G"), 2)) == '67.13 G' assert str(round(total_aggregate_memoryG.to("Gi"), 2)) == '62.52 Gi' - assert global_data[4]['aggregate_kubelet_failures'] in 'Check Kubelet Version on nodes. Issues Found: 3.' + assert global_data[4]['aggregate_k8s_failures'] in 'Check K8s Version on nodes. Issues Found: 3.' assert global_data[6]['k8sVersion'] in '1.16.1' template_render(global_data, configs_data, storage_data, 'nested_nodes_info.html') def test_get_nested_millicores_nodes_info(): - viya_kubelet_version_min = 'v1.14.0' + viya_k8s_version_min = '1.14' viya_min_aggregate_worker_CPU_cores = '20' viya_min_aggregate_worker_memory = '156G' - vpc = createViyaPreInstallCheck(viya_kubelet_version_min, + vpc = createViyaPreInstallCheck(viya_k8s_version_min, viya_min_aggregate_worker_CPU_cores, viya_min_aggregate_worker_memory) @@ -221,14 +221,14 @@ def test_get_nested_millicores_nodes_info(): ' Issues Found: 1' total_calc_memoryG = vpc.get_calculated_aggregate_memory() assert str(round(total_calc_memoryG.to("G"), 2)) == '68.16 G' # 68.16113098752 - assert global_data[4]['aggregate_kubelet_failures'] in 'Check Kubelet Version on nodes. Issues Found: 3.' + assert global_data[4]['aggregate_k8s_failures'] in 'Check K8s Version on nodes. Issues Found: 3.' assert global_data[6]['k8sVersion'] in '1.13.1' template_render(global_data, configs_data, storage_data, 'nested_millicores_nodes_info.html') def test_ranchersingle_get_nested_nodes_info(): - vpc = createViyaPreInstallCheck(viya_kubelet_version_min, + vpc = createViyaPreInstallCheck(viya_k8s_version_min, viya_min_aggregate_worker_CPU_cores, viya_min_aggregate_worker_memory) quantity_ = register_pint() @@ -254,13 +254,13 @@ def test_ranchersingle_get_nested_nodes_info(): ' Issues Found: 0' total_calc_memoryG = vpc.get_calculated_aggregate_memory() assert str(round(total_calc_memoryG.to("G"), 2)) == '67.39 G' - assert global_data[4]['aggregate_kubelet_failures'] in 'Check Kubelet Version on nodes. Issues Found: 0' + assert global_data[4]['aggregate_k8s_failures'] in 'Check Kubelet Version on nodes. Issues Found: 0' template_render(global_data, configs_data, storage_data, 'ranchersingle_nested_nodes_info.html') def test_ranchermulti_get_nested_nodes_info(): - vpc = createViyaPreInstallCheck(viya_kubelet_version_min, + vpc = createViyaPreInstallCheck(viya_k8s_version_min, viya_min_aggregate_worker_CPU_cores, viya_min_aggregate_worker_memory) quantity_ = register_pint() @@ -285,13 +285,13 @@ def test_ranchermulti_get_nested_nodes_info(): assert global_data[3]['aggregate_memory_failures'] in 'Expected: 56G, Calculated: 336.94 G,' \ ' Memory within Range,' \ ' Issues Found: 0' - assert global_data[4]['aggregate_kubelet_failures'] in 'Check Kubelet Version on nodes. Issues Found: 0' + assert global_data[4]['aggregate_k8s_failures'] in 'Check Kubelet Version on nodes. Issues Found: 0' template_render(global_data, configs_data, storage_data, 'ranchermulti_nested_nodes_info.html') def test_get_no_config_info(): - vpc = createViyaPreInstallCheck(viya_kubelet_version_min, + vpc = createViyaPreInstallCheck(viya_k8s_version_min, viya_min_aggregate_worker_CPU_cores, viya_min_aggregate_worker_memory) current_dir = os.path.dirname(os.path.abspath(__file__)) @@ -332,7 +332,7 @@ def test_check_route_host_port(): def test_get_config_info(): - vpc = createViyaPreInstallCheck(viya_kubelet_version_min, + vpc = createViyaPreInstallCheck(viya_k8s_version_min, viya_min_aggregate_worker_CPU_cores, viya_min_aggregate_worker_memory) current_dir = os.path.dirname(os.path.abspath(__file__)) @@ -365,7 +365,7 @@ def test_get_config_info(): def test_ranchersingle_test_get_config_info(): - vpc = createViyaPreInstallCheck(viya_kubelet_version_min, + vpc = createViyaPreInstallCheck(viya_k8s_version_min, viya_min_aggregate_worker_CPU_cores, viya_min_aggregate_worker_memory) current_dir = os.path.dirname(os.path.abspath(__file__)) @@ -389,7 +389,7 @@ def test_ranchersingle_test_get_config_info(): def test_ranchermulti_test_get_config_info(): - vpc = createViyaPreInstallCheck(viya_kubelet_version_min, + vpc = createViyaPreInstallCheck(viya_k8s_version_min, viya_min_aggregate_worker_CPU_cores, viya_min_aggregate_worker_memory) current_dir = os.path.dirname(os.path.abspath(__file__)) @@ -416,7 +416,7 @@ def test_ranchermulti_test_get_config_info(): def test_azure_terrform_multi_nodes_info(): - vpc = createViyaPreInstallCheck(viya_kubelet_version_min, + vpc = createViyaPreInstallCheck(viya_k8s_version_min, viya_min_aggregate_worker_CPU_cores, viya_min_aggregate_worker_memory) @@ -441,14 +441,14 @@ def test_azure_terrform_multi_nodes_info(): assert global_data[3]['aggregate_memory_failures'] in 'Expected: 56G, Calculated: 168.54 G,' \ ' Memory within Range,' \ ' Issues Found: 0' - assert global_data[4]['aggregate_kubelet_failures'] in 'Check Kubelet Version on nodes. Issues Found: 0' + assert global_data[4]['aggregate_k8s_failures'] in 'Check Kubelet Version on nodes. Issues Found: 0' template_render(global_data, configs_data, storage_data, 'azure_terrform_multi_nodes_info.html') def test_azure_multi_get_nested_nodes_info(): - vpc = createViyaPreInstallCheck(viya_kubelet_version_min, + vpc = createViyaPreInstallCheck(viya_k8s_version_min, viya_min_aggregate_worker_CPU_cores, viya_min_aggregate_worker_memory) @@ -476,14 +476,14 @@ def test_azure_multi_get_nested_nodes_info(): assert global_data[3]['aggregate_memory_failures'] in 'Expected: 56G, Calculated: 117.92 G,' \ ' Memory within Range,' \ ' Issues Found: 0' - assert global_data[4]['aggregate_kubelet_failures'] in '0, Check Kubelet Version on nodes.' + assert global_data[4]['aggregate_k8s_failures'] in '0, Check Kubelet Version on nodes.' template_render(global_data, configs_data, storage_data, 'azure_multi_nested_nodes_info.html') def test_azure_worker_nodes(): - viya_kubelet_version_min = 'v1.17.0' - vpc = createViyaPreInstallCheck(viya_kubelet_version_min, + viya_k8s_version_min = '1.17' + vpc = createViyaPreInstallCheck(viya_k8s_version_min, viya_min_aggregate_worker_CPU_cores, viya_min_aggregate_worker_memory) @@ -509,8 +509,8 @@ def test_azure_worker_nodes(): assert global_data[3]['aggregate_memory_failures'] in 'Expected: 56G, Calculated: 802.28 G,' \ ' Memory within Range,' \ ' Issues Found: 0' - assert global_data[4]['aggregate_kubelet_failures'] in ' Check Node(s). All Nodes NOT in Ready Status. ' \ - 'Issues Found: ' + str(issues_found) + assert global_data[4]['aggregate_k8s_failures'] in ' Check Node(s). All Nodes NOT in Ready Status. ' \ + 'Issues Found: ' + str(issues_found) assert global_data[6]['k8sVersion'] in '1.22.4' template_render(global_data, configs_data, storage_data, 'azure_nodes_no_master.html') @@ -539,12 +539,12 @@ def register_pint(): return quantity_ -def createViyaPreInstallCheck(viya_kubelet_version_min, +def createViyaPreInstallCheck(viya_k8s_version_min, viya_min_aggregate_worker_CPU_cores, viya_min_aggregate_worker_memory): sas_pre_check_report: ViyaPreInstallCheck = ViyaPreInstallCheck(sas_logger, - viya_kubelet_version_min, + viya_k8s_version_min, viya_min_aggregate_worker_CPU_cores, viya_min_aggregate_worker_memory) sas_pre_check_report.set_k8s_version(viya_kubenetes_version) @@ -554,7 +554,7 @@ def createViyaPreInstallCheck(viya_kubelet_version_min, def test_get_calculated_aggregate_memory(): - vpc = createViyaPreInstallCheck(viya_kubelet_version_min, + vpc = createViyaPreInstallCheck(viya_k8s_version_min, viya_min_aggregate_worker_CPU_cores, viya_min_aggregate_worker_memory) @@ -592,7 +592,7 @@ def test_kubconfig_file(): def test_validated_k8s_server_version(): - vpc = createViyaPreInstallCheck(viya_kubelet_version_min, + vpc = createViyaPreInstallCheck(viya_k8s_version_min, viya_min_aggregate_worker_CPU_cores, viya_min_aggregate_worker_memory) @@ -658,9 +658,10 @@ def test_get_k8s_version(): assert (curr_version in semantic_version.SimpleSpec('<1.20')) assert (curr_version in semantic_version.SimpleSpec('==1.19')) - # current version is less then 1.19 + # current version is less than 1.19 curr_version = semantic_version.Version(str(version_string)) - assert (curr_version in semantic_version.SimpleSpec(viya_constants.MIN_K8S_SERVER_VERSION)) + k8s_version = '<' + version_string2 + assert (curr_version in semantic_version.SimpleSpec(k8s_version)) def test_check_permissions(): diff --git a/pre_install_report/viya_deployment_settings.ini b/pre_install_report/viya_deployment_settings.ini index 4d2a972..ee86cf9 100644 --- a/pre_install_report/viya_deployment_settings.ini +++ b/pre_install_report/viya_deployment_settings.ini @@ -29,6 +29,5 @@ VIYA_MIN_AGGREGATE_WORKER_MEMORY=448G # TOTAL CPU of all worker Nodes in millicores. Sum of the vCPUs on all active nodes required to deploy an offering # Minimum allowed value = '.001'. VIYA_MIN_AGGREGATE_WORKER_CPU_CORES=56 -# Supported versions of Kubelet Version -# Expected format: vxx.xx.0 -VIYA_KUBELET_VERSION_MIN=v1.19.0 \ No newline at end of file +# Minimum Kubernetes Server Version supported. Format: major.minor +VIYA_K8S_VERSION_MIN=1.21 From 43329fca1df3706fffffe4510872b6706c97c30d Mon Sep 17 00:00:00 2001 From: Latha Sivakumar Date: Tue, 8 Nov 2022 10:33:46 -0500 Subject: [PATCH 2/9] (#184) K8s minimum version check --- pre_install_report/pre_install_report.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pre_install_report/pre_install_report.py b/pre_install_report/pre_install_report.py index 2bbc752..470d365 100644 --- a/pre_install_report/pre_install_report.py +++ b/pre_install_report/pre_install_report.py @@ -254,9 +254,9 @@ def main(argv): with LRPIndicator(enter_message="Gathering facts"): try: sas_pre_check_report: ViyaPreInstallCheck = \ - ViyaPreInstallCheck(sas_logger, check_limits['items']['VIYA_K8S_VERSION_MIN'], - check_limits['items']['VIYA_MIN_AGGREGATE_WORKER_CPU_CORES'], - check_limits['items']['VIYA_MIN_AGGREGATE_WORKER_MEMORY']) + ViyaPreInstallCheck(sas_logger, check_limits['items']['VIYA_K8S_VERSION_MIN'], + check_limits['items']['VIYA_MIN_AGGREGATE_WORKER_CPU_CORES'], + check_limits['items']['VIYA_MIN_AGGREGATE_WORKER_MEMORY']) except KeyError as e: print() print(viya_messages.EXCEPTION_MESSAGE.format(e) + From 52e0af4634060504ce9ee013fe7b845761b68827 Mon Sep 17 00:00:00 2001 From: Kevin Lingle <36995745+kevinlinglesas@users.noreply.github.com> Date: Tue, 8 Nov 2022 12:20:30 -0500 Subject: [PATCH 3/9] min k8s version check mentioned in Overview --- pre_install_report/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pre_install_report/README.md b/pre_install_report/README.md index 86fcb85..e6cd02d 100644 --- a/pre_install_report/README.md +++ b/pre_install_report/README.md @@ -10,7 +10,7 @@ Kubernetes may orchestrate once Viya is deployed. The report and the informatio be considered a snapshot in time. The Kubernetes cluster for a SAS Viya deployment must meet the requirements documented in [SAS® Viya® Operations](https://go.documentation.sas.com/doc/en/itopscdc/default/itopssr/titlepage.htm) -Ensure that the Kubernetes version is within the documented range for the selected cloud provider. +Ensure that the Kubernetes version is within the documented range for the selected cloud provider. If the Kubernetes server version is below a current default minimum, a warning will be included in the report. ### Memory and vCPU Check From bcda53b4878785f18f1376983ee3c04ea4a072f6 Mon Sep 17 00:00:00 2001 From: Kevin Lingle <36995745+kevinlinglesas@users.noreply.github.com> Date: Tue, 8 Nov 2022 12:35:50 -0500 Subject: [PATCH 4/9] Adding to the Modify Settings section --- pre_install_report/README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pre_install_report/README.md b/pre_install_report/README.md index e6cd02d..984f6fe 100644 --- a/pre_install_report/README.md +++ b/pre_install_report/README.md @@ -146,6 +146,10 @@ web-viewable, HTML format. You can modify the /viya4-ark/pre_install_report/viya_deployment_settings.ini file to alter the minimum and aggregate settings for CPU and memory on nodes. For more information, see the details in the file. +If you modify the VIYA_K8S_VERSION_MIN to a version less than the minimum Kubernetes version supported by this +release of the report tool, you are operatiing outside the supported capabilities of the report tool. It is better +to use a release of Viya 4 ARK tools matching the required minimum you may be working with. + ## Known Issues The following issue may impact the performance and expected results of this tool. From ff8b13248b80daa25f7f09d5dfff8b580edcd480 Mon Sep 17 00:00:00 2001 From: Kevin Lingle <36995745+kevinlinglesas@users.noreply.github.com> Date: Tue, 8 Nov 2022 12:40:04 -0500 Subject: [PATCH 5/9] Updated copyright --- pre_install_report/viya_deployment_settings.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pre_install_report/viya_deployment_settings.ini b/pre_install_report/viya_deployment_settings.ini index ee86cf9..7e10989 100644 --- a/pre_install_report/viya_deployment_settings.ini +++ b/pre_install_report/viya_deployment_settings.ini @@ -4,7 +4,7 @@ # ### Author: SAS Institute Inc. ### # ################################################################### # ### -# Copyright (c) 2021, SAS Institute Inc., Cary, NC, USA. ### +# Copyright (c) 2021-2022, SAS Institute Inc., Cary, NC, USA. ### # All Rights Reserved. ### # SPDX-License-Identifier: Apache-2.0 ### # ### From 5e1cbaffe2d79ee71f295f6cfe2446be230d01d4 Mon Sep 17 00:00:00 2001 From: Kevin Lingle <36995745+kevinlinglesas@users.noreply.github.com> Date: Tue, 8 Nov 2022 13:30:29 -0500 Subject: [PATCH 6/9] Update from review --- pre_install_report/README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pre_install_report/README.md b/pre_install_report/README.md index 984f6fe..d5738ea 100644 --- a/pre_install_report/README.md +++ b/pre_install_report/README.md @@ -10,7 +10,8 @@ Kubernetes may orchestrate once Viya is deployed. The report and the informatio be considered a snapshot in time. The Kubernetes cluster for a SAS Viya deployment must meet the requirements documented in [SAS® Viya® Operations](https://go.documentation.sas.com/doc/en/itopscdc/default/itopssr/titlepage.htm) -Ensure that the Kubernetes version is within the documented range for the selected cloud provider. If the Kubernetes server version is below a current default minimum, a warning will be included in the report. +Ensure that the Kubernetes version is within the documented range for the selected cloud provider. +If the Kubernetes server version is below the default minimum, a warning will be included in the report. ### Memory and vCPU Check @@ -147,7 +148,7 @@ You can modify the /viya4-ark/pre_install_report/viya_deploym minimum and aggregate settings for CPU and memory on nodes. For more information, see the details in the file. If you modify the VIYA_K8S_VERSION_MIN to a version less than the minimum Kubernetes version supported by this -release of the report tool, you are operatiing outside the supported capabilities of the report tool. It is better +release of the report tool, you are operating outside the supported capabilities of the report tool. It is better to use a release of Viya 4 ARK tools matching the required minimum you may be working with. ## Known Issues From 91c512589d668a33b83827de3486616c724f9963 Mon Sep 17 00:00:00 2001 From: Kevin Lingle <36995745+kevinlinglesas@users.noreply.github.com> Date: Tue, 8 Nov 2022 13:35:34 -0500 Subject: [PATCH 7/9] Update from review comments --- pre_install_report/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pre_install_report/README.md b/pre_install_report/README.md index d5738ea..422f64f 100644 --- a/pre_install_report/README.md +++ b/pre_install_report/README.md @@ -149,7 +149,7 @@ minimum and aggregate settings for CPU and memory on nodes. For more information If you modify the VIYA_K8S_VERSION_MIN to a version less than the minimum Kubernetes version supported by this release of the report tool, you are operating outside the supported capabilities of the report tool. It is better -to use a release of Viya 4 ARK tools matching the required minimum you may be working with. +to use a release of Viya 4 ARK tools matching the required minimum you are working with. ## Known Issues @@ -171,4 +171,4 @@ They will look similar to the resources shown below: kubectl -n delete replicaset.apps/hello-world-6665cf748b kubectl -n delete pod/hello-world-6665cf748b-5x2jq kubectl -n delete pod/hello-world-6665cf748b-tkq79 -``` +``` From 9ed0fc6af05ad25943ba257499634e35a3b34d16 Mon Sep 17 00:00:00 2001 From: Kevin Lingle <36995745+kevinlinglesas@users.noreply.github.com> Date: Tue, 8 Nov 2022 13:38:38 -0500 Subject: [PATCH 8/9] Update from review comments --- pre_install_report/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pre_install_report/README.md b/pre_install_report/README.md index 422f64f..c191d85 100644 --- a/pre_install_report/README.md +++ b/pre_install_report/README.md @@ -148,8 +148,8 @@ You can modify the /viya4-ark/pre_install_report/viya_deploym minimum and aggregate settings for CPU and memory on nodes. For more information, see the details in the file. If you modify the VIYA_K8S_VERSION_MIN to a version less than the minimum Kubernetes version supported by this -release of the report tool, you are operating outside the supported capabilities of the report tool. It is better -to use a release of Viya 4 ARK tools matching the required minimum you are working with. +release of the report tool, you are operating outside the supported capabilities of the report tool. SAS recommends +using a release of Viya 4 ARK tools that matches the required minimum you are working with. ## Known Issues From 6cea51460363798743ee60d1d291bcda4c1abaad Mon Sep 17 00:00:00 2001 From: Latha Sivakumar Date: Thu, 10 Nov 2022 14:17:24 -0500 Subject: [PATCH 9/9] (#184) K8s minimum version check --- pre_install_report/library/pre_install_check.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pre_install_report/library/pre_install_check.py b/pre_install_report/library/pre_install_check.py index 5489956..56d284e 100644 --- a/pre_install_report/library/pre_install_check.py +++ b/pre_install_report/library/pre_install_check.py @@ -77,7 +77,7 @@ def __init__(self, sas_logger: ViyaARKLogger, viya_k8s_version_min, def _parse_release_info(self, release_info): """ - This method checks that the format of the VIYA_K8s_VERSION_MIN specified in the + This method checks that the format of the VIYA_K8S_VERSION_MIN specified in the user modifiable ini file is valid. :param release_info: The minimum K8s version loaded from ini file.