Package: unctl
unctlTable of ContentsAbout The ProjectHealth ChecksList of ChecksBuilt WithGetting StartedPrerequisitesInstallationDevelopmentTestingReleaseUsageRoadmapContactAbout The Projectunctlis a versatile command-line tool designed to perform a wide range of checks and inspections on various components of your infrastructure. It provides a unified interface to assess the health and performance of different services and platforms, and goes beyond mere diagnosis.(back to top)Health ChecksThis tools runs the health checks and provides a report.
In order to get access to automated AI based diagnostics and remediations for these problems, go tohttps://unskript.com/.(back to top)List of ChecksProviderChecksk8s31mysql1k8s checksCheckServiceCategorySeverityDescriptionCheck if a k8s PVC is in Pending state.pvcHealthCriticalAlerts on pending PVCs, highlighting potential delays in provisioning persistent volume claims for all the namespacesCheck if the k8s node is in Ready state.nodeHealthCriticalEnsure node health by examining readiness conditions, signaling failures if any issues are detected in the node's statusDeployment has insufficient replicas.deploymentHealthCriticalValidate Deployments for the correct number of available replicas, highlighting any discrepancies between desired and available countsPod has a high restart count.podHealthCriticalIdentify pods for all the namespaces where certain containers have restarted more than 10 times, indicating potential instability concernsPod is in CrashLoopBackOff state.podHealthCriticalIdentify pods with containers stuck in a CrashLoopBackOff state, highlighting potential issues impacting pod stability for all the namespacesService has endpoints that are NotReady.serviceHealthSevereHighlights when services have NotReady endpoints, indicating potential disruptions to service reliability for all the namespacesService has no endpoints.serviceHealthSevereIdentify services with no associated endpoints, highlighting potential misconfigurations impacting service connectivityAnalyzing HPAs, checking if scale targets exist and have resourcespodHPAHighAnalyze optimal Horizontal Pod Autoscaler (HPA) configurations by ensuring associated resources (Deployments, ReplicationControllers, ReplicaSets, StatefulSets) have defined resource limits for effective auto-scalingCheck for the existence of Ingress class, service and secrets for all the namespacesingressIngressHighEnsure proper Ingress configurations by validating associated services, secrets, and ingress classes, flagging issues if there are missing elements or misconfigured settings for all the namespacesCheck the existence of secret in DaemonsetdaemonsetDaemonset, SecretHighEnsure the presence of referenced Secrets in Daemonset volumes, reporting failures for any missing Secret within all the namespacesCheck the existence of secret in DeploymentsecretDeploymentHighEnsure the presence of referenced Secrets in Deployment volumes, reporting failures for any missing Secret for all the namespacesExcessive Pods on NodenodeResource LimitsHighAssesses nodes for excessive pod counts, flagging potential issues if pods near capacity thresholds based on CPU and memory resourcesFind Deployments with missing configmapconfigmapDeploymentHighEnsure the presence of referenced ConfigMaps in Deployment volumes, reporting failures for any missing ConfigMap for all the namespacesFind Pending PodspodHealthHighEnsure that Pods are not in a Pending state due to scheduling issues or container creation failures, and report relevant details for diagnosticsFind Pods with missing configmappodPod, ConfigMapHighEnsure the presence of referenced ConfigMaps in Pod containers and volumes, reporting failures for any missing ConfigMap for all the namespacesFind Pods with missing secretspodPod, SecretHighEnsure the presence of referenced Secrets in Pod containers, reporting failures for any missing Secret for all the namespacesInsufficient PIDs on NodenodePerformanceHighCheck if the nodes have remaining PIDs less than a set thresholdKubernetes Node Out-of-Memory ChecknodePerformanceHighChecks if any Kubernetes node is using more than 85% of its memory capacity.Validate configmap existence in StatefulsetstatefulsetStatefulSetHighEnsure the existence of referenced ConfigMaps in StatefulSet volume claims and template volumes, reporting failures for any missing ConfigMap for all the namespacesValidate cronjob starting deadlinecronjobCronJobHighEnsure CronJobs have a non-negative starting deadline, reporting failures for negative values for all the namespacesValidate existence of configmaps in daemonsetsdaemonsetDaemonSet, ConfigMapHighEnsure the presence of referenced ConfigMaps in Daemonset volumes, reporting failures for any missing ConfigMap for all the namespacesVerify StatefulSet has valid servicestatefulsetStatefulSetHighVerify StatefulSet's service reference, ensuring it points to an existing service in all the namespaces, reporting failures for non-existent servicesVerify StatefulSet has valid storageClassstatefulsetStatefulSetHighValidate StatefulSet's storage class, ensuring it references existing storage classes in the namespace, reporting failures for non-existent onesZero Scale Deployment CheckdeploymentAvailabilityHighVerify that Deployments have a non-zero replica count, preventing unintentional scaling down to zeroCheck if Kubernetes services have matching pod labelsserviceConfigurationMediumThis check validates if Kubernetes service selectors match pod labels. This ensures proper routing & discovery of pods.Pod template validation in DaemonSetdaemonsetResource ManagementMediumChecks that the Pod template within a DaemonSet is configured correctly according to certain threshold values.Services Target Port MatchserviceDiagnosticMediumThis check identifies service ports that do not match their target portsValidate that network policies are in place and configured correctlynetworkpolicyNetwork SecurityMediumVerify Network Policy configurations, highlighting issues if policies allow traffic to all pods or if not applied to any specific podsZero scale detected in statefulsetstatefulsetAvailabilityMediumCheck to ensure that no StatefulSets are scaled to zero as it might hamper availability.Find unused DaemonSetdaemonsetDaemonSet, Cost, Resource OptimizationLowAny DaemonSet that has been created but has no associated pods and remained unused for over 30 days.Validate cronjobs schedule and statecronjobCronJobLowEnsure CronJobs have valid schedules and are not suspended, reporting failures for any invalid schedules or suspended jobs for all the namespacesmysql checksCheckServiceCategorySeverityDescriptionChecks max used connectionsglobalConnection, ThreadHighChecks max used connections reaching max count(back to top)Built With(back to top)Getting StartedPrerequisitesPython >= 3.10InstallationGet distibution on your machine:Runpipcommand to installunctlfromPyPIpipinstallunctlKubernetes(optional) SetKUBECONFIGvariable to specific location other than default:exportKUBECONFIG=<pathtokubeconfigfile>Run unctl command to see list of options:unctlk8s-hMySQLunctl is using~/.my.cnfasconfig path.Run unctl command to see list of options:unctlmysql-h(back to top)DevelopmentInstallpoetry:pipinstallpoetryEnter virtual env:poetryshellInstall dependencies:poetryinstallRun tool:pythonunctl.py-hFormat all files before commit changes:black.(back to top)TestingSee the testing documentationhere.(back to top)ReleaseFor the release this repo is usingSemantic Realeseas automated process. To be able to generate changelogs we should keep usingConventional Commitspractice. When PR merged tomasterit usessquash and mergewith PR title for the commit message. This requiresPR titleto be conventional:feat(EN-4444): Add Button component
^    ^          ^
|    |          |__ Subject
|    |_______ Scope
|____________ TypeWhen release job is running it will automatically bump up version depends on the changes:BREAKING CHANGE: <message>- creates new major versionfeat: <message>- creates new minor versionfix or perf: <message>- creates new patch versionAll other tagswill not create new release(back to top)Usageunctl%unctl-h
usage:unctl[-h][-v]{k8s,mysql}...WelcometounSkriptCLIInterfaceoptions:-h,--helpshowthishelpmessageandexit-v,--versionshowprogram'sversionnumberandexitunctlavailableproviders:{k8s,mysql}Toseethedifferentavailableoptionsonaspecificprovider,run:unctl{provider}-h|--helpProvider%unctl{provider}-h
usage:unctl{provider}[-h][-f][-cCHECKS[CHECKS...]][--sort-by{object,check}][--categoriesCATEGORIES[CATEGORIES...]][--servicesSERVICES[SERVICES...]][-l][--list-categories][--list-services][-e|--explain|--no-explain][-r|--remediate|--no-remediate]options:-h,--helpshowthishelpmessageandexit-f,--failing-onlyShowonlyfailingchecks-cCHECKS[CHECKS...],--checksCHECKS[CHECKS...]FilterchecksbyIDs--sort-by{object,check}Sortresultsby'object'(default)or'check'--categoriesCATEGORIES[CATEGORIES...]Filterchecksbycategory--servicesSERVICES[SERVICES...]Filterchecksbyservices-l,--list-checksListavailablechecks--list-categoriesListavailablecategories--list-servicesListavailableservices

Licensedfeatures:Thesefeaturesavailableonlyinalicensedversion.-e,--explain,--no-explainExplainfailures-r,--remediate,--no-remediateCreateremediationplan(back to top)RoadmapK8s checks - in progressMySQL checks - in progressElasticSearch checksAWS checksGCP checks(back to top)ContactAbhishek Saxena:abhishek@unskript.comOfficial website:https://unskript.com/(back to top)