Add Portworx + OpenShift Virtualization collector and policy checks#5
Merged
Conversation
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.
Summary
Introduces a new end-to-end collector (
portworx-kubevirt) that scans a cluster running Portworx Enterprise with OpenShift Virtualization (KubeVirt) and evaluates it against the Portworx Best Practices Guide for OpenShift Virtualization. Adds 24 policy checks covering storage configuration, component versions, cluster health, and VM disk configuration.What's new
Collector (
examples/collectors/portworx-kubevirt/)collect.py— in-cluster Python script that queries the Kubernetes API to snapshot:portworx.io/app=kubevirtpxctl status --jsonoutput via WebSocket exec into a running Portworx podmetadata.json— collector manifest with RBAC rules for all required API groupspolicy.rego— 24 OPA checks across 4 categories (77 tests, all passing):nodiscard=trueon default KubeVirt StorageClassFramework enhancements (
internal/)collector/rbac.go— dynamic ClusterRole/ClusterRoleBinding creation from collectormetadata.jsonrulescollector/script_configmap.go— ConfigMap-mounted scripts socollect.pyis not baked into the imagecollector/job_collector.go— scope-aware Job orchestration (once-per-cluster vs per-node)config/config.go— YAML config file support (~/.config/kvirtbp/config.yamlor./config.yaml), auto-generated on first run; supportsengine,output,timeout,exclude_checkschecks/filter.go—--check foo-trailing-dash syntax to exclude individual checks alongside the existing--check fooinclude syntaxcli/scan.go—--engineflag respects config file when not explicitly set on the command linereport/table.go— long message word-wrapping in table outputE2E lab scripts
scripts/e2e_kind_px_kubevirt.sh— kind-based lab: provisions a full PX + KubeVirt stack for local testingscripts/e2e_k3s_px_kubevirt.sh— k3d/k3s variantTesting
opa test examples/collectors/portworx-kubevirt/)go build ./...cleanChecklist
metadata.jsoncover all API groups accessed bycollect.py