From 52ba79c07aa517160698ee7e04797447448ebf3c Mon Sep 17 00:00:00 2001 From: Parth Inamdar Date: Mon, 29 Nov 2021 22:01:38 -0500 Subject: Added Security, Policy, Observability & Plugin Checks Security Checks: Checking for security config on the cluster, consisting of capability, privilege, host network, host path and connectivity checks Policy Checks: Validating CPU Manager and Topology Manager policies against the settings from PDF Observability Checks Checking existence and health of prometheus, node-exporter and collectd pods Plugin checks Checking for the existence of multi-interface pod (multus) and validating the list of CNI against the PDF Also added usage information and pdf field information to userguide.rst file in the docs section. For reference, I have added a PDF.json in sdv/docker/sdvstate/settings section file to look at necessary configuration required for the kuberef validation. Signed-off-by: Parth V Inamdar Change-Id: I28dc8e687c14cba099230f2226b4add79a55a7ad --- .../internal/validator/kuberef/helm_check.py | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 sdv/docker/sdvstate/internal/validator/kuberef/helm_check.py (limited to 'sdv/docker/sdvstate/internal/validator/kuberef/helm_check.py') diff --git a/sdv/docker/sdvstate/internal/validator/kuberef/helm_check.py b/sdv/docker/sdvstate/internal/validator/kuberef/helm_check.py new file mode 100644 index 0000000..55f4052 --- /dev/null +++ b/sdv/docker/sdvstate/internal/validator/kuberef/helm_check.py @@ -0,0 +1,35 @@ +""" +Helm 2 disabled check + +Checks if the helm v2 is supported in the cluster +""" + +import logging +from tools.kube_utils import kube_api +from tools.conf import settings +from internal.store_result import store_result + +def helmv2_disabled_check(): + """ + Checks for helm v2 support + """ + result = {'category': 'platform', + 'case_name': 'helmv2_disabled_check', + 'criteria': 'pass', + 'details': [] + } + kube = kube_api() + logger = logging.getLogger(__name__) + res = False + pod_details = kube.list_pod_for_all_namespaces() + pods = pod_details.items + version_support = settings.getValue('pdf_file')['vim_functional']['legacy_helm_support'] + if 'YES' in version_support: + for pod in pods: + if 'tiller' in pod.metadata.name: + res = True + result['details'].append(pod) + if res is False: + result['criteria'] = 'fail' + store_result(logger, result) + return result -- cgit 1.2.3-korg