diff options
author | Parth Inamdar <parth.inamdar1@gmail.com> | 2021-11-29 22:01:38 -0500 |
---|---|---|
committer | Parth Inamdar <parth.inamdar1@gmail.com> | 2021-11-30 05:25:24 +0000 |
commit | 52ba79c07aa517160698ee7e04797447448ebf3c (patch) | |
tree | 5a27ed50d5f75d21eaf789ae027ac7e899cb254d /sdv/docker/sdvstate/internal/validator/kuberef/helm_check.py | |
parent | bfd37762bdf91a7f89d4ebc259454ddb2f5e7b3d (diff) |
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 <parth.inamdar1@gmail.com>
Change-Id: I28dc8e687c14cba099230f2226b4add79a55a7ad
Diffstat (limited to 'sdv/docker/sdvstate/internal/validator/kuberef/helm_check.py')
-rw-r--r-- | sdv/docker/sdvstate/internal/validator/kuberef/helm_check.py | 35 |
1 files changed, 35 insertions, 0 deletions
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 |