feat(tools/k8s-discovery): complete resource discovery coverage, multi-container workload preservation, and generic cluster support - #2288
Open
utkarsh-devops wants to merge 6 commits into
Conversation
Updated k8s_resources.py for k8s-discovery
Updated common.py for k8s-discovery
Updated eks_discovery.py for k8s-discovery
Update generic_discovery.py for k8s-discovery
Update main.py for k8s-discovery
Update README.md for k8s-discovery
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Title
feat(tools/k8s-discovery): complete resource discovery coverage, multi-container workload preservation, and generic cluster supportPR Description
Summary of Changes
This Pull Request enhances
tools/k8s-discoveryto eliminate data truncation, expand Kubernetes resource inventory coverage, and add generic cluster support across AWS EKS, Azure AKS, Google GKE, and local/on-premise environments.Key Enhancements:
Expanded Resource Inventory (
k8s_resources.py):get_storageclass_details()to collect provisioners, reclaim policies, volume binding modes, expansion flags, parameters, and annotations.get_cluster_role_details()andget_cluster_role_binding_details()for cluster-scoped access review.get_crd_details()andget_custom_resource_details()to automatically inspect installed CRDs (e.g., Karpenter, cert-manager, Istio, AWS LB Controller) and list custom resource instances.metadata.annotationson ServiceAccounts (enabling EKS IRSAeks.amazonaws.com/role-arntracking), Services (AWS Load Balancer controller annotations), Namespaces, and RBAC roles.privilegedflags, podservice_account_name,host_network, andowner_references.volume_handle,ebs_volume_id,csi_driver,volume_mode, andnode_affinity.Data Preservation & Relational CSV Export (
common.py):_flatten_workloads()to iterate over 100% of workload containers, preventing multi-container pod specs from being truncated.desired_scheduled/current_scheduledmetrics when standardreplicascount is unpopulated.DEFAULT_CSV_HEADERSmapping to ensure all 26 CSV exports write complete header rows even when resource counts are zero.Cloud & Generic Cluster Enhancements (
eks_discovery.py,generic_discovery.py,main.py):_get_addons()to inspect EKS add-ons, versions, health status, and IAM roles.kubeconfigscanning viapython main.py genericfor MicroK8s, Minikube, K3s, Rancher, and on-prem clusters.Testing & Documentation (
test_k8s_discovery.py,README.md):README.mdwith complete documentation for all 26 CSV export files, setup prerequisites, and CLI sub-commands (aws,azure,gke,generic).Verification & Testing
python3 -m py_compile).PR Checklist
README.mdupdated with full usage instructions and output schema tables.