OpsCart-K8s-Watcher
Your Kubernetes cluster is hiding things. This finds them.

Production-grade Kubernetes intelligence β security posture, cloud costs, waste detection, and network policy analysis. Built from real Fortune 500 AKS cluster experience.
π What's New in v0.8.0 β Live FinOps Dashboard
OpsCart moves from CLI scanner to always-on in-cluster daemon.
# Deploy the live dashboard to your cluster
kubectl apply -f https://raw.githubusercontent.com/opscart/opscart-k8s-watcher/main/deploy/dashboard.yaml
# Access it
kubectl port-forward -n opscart-system svc/opscart-dashboard 8080:80
open http://localhost:8080

The dashboard gives you:
- π° Real-time cost tracking β Node pool costs from actual VM SKUs, updated every 60 seconds
- π Namespace cost allocation β See exactly which teams are spending what
- π Confidence scoring β 100% SKU match confidence with embedded Azure pricing catalog
- π Multi-cluster selector β Switch between clusters in the sidebar
- β‘ Live refresh β Auto-refreshes every 60s with "last updated" badge
Or run it locally:
./opscart-dashboard --cluster my-cluster --port 8080
π¦ Installation
git clone https://github.com/opscart/opscart-k8s-watcher.git
cd opscart-k8s-watcher
go build -o opscart-scan cmd/opscart-scan/main.go
./opscart-scan config init
β‘ Quick Start
# βοΈ Cloud costs β real pricing from node labels, no API keys needed
./opscart-scan cloud-costs --cluster prod
./opscart-scan cloud-costs --cluster prod --format html
# π Security posture β CIS Benchmark scoring
./opscart-scan security --cluster prod
./opscart-scan security --cluster prod --format html
# ποΈ Waste detection β find orphaned, idle, and zombie resources
./opscart-scan waste --cluster prod
./opscart-scan waste --cluster prod --format html
# π Network policy gaps β unprotected namespaces
./opscart-scan network --cluster prod
# π¨ War room β what's broken right now
./opscart-scan emergency --cluster prod
# π All clusters at once
./opscart-scan cloud-costs --all-clusters
./opscart-scan security --all-clusters
π‘ Corporate AKS clusters: Append 2>/dev/null to suppress harmless klog warnings.
π§ What It Detects
βοΈ Cloud Costs
Reads Kubernetes node labels β looks up Azure retail pricing β allocates costs to namespaces proportionally. No Azure credentials, no API calls β fully offline.
- 40+ VM SKUs (B/D/E/F/L series), Spot and On-Demand
- Reserved Instance savings potential (1yr/3yr)
- Per-deployment cost breakdown with
--breakdown deployment
- 15+ Azure region multipliers
π Security Posture
CIS Kubernetes Benchmark v1.8 scoring with environment-aware analysis.
- Separates actionable issues from expected infrastructure configs
- Privileged container whitelist β distinguishes CNI/CSI/monitoring from unexpected
- 50+ infrastructure namespace patterns (calico, tigera, ama-logs, gatekeeper, etc.)
ποΈ Waste & Drift
9 resource types β never modifies the cluster, suggestions only.
| Type |
What It Catches |
| Abandoned Namespaces |
No running pods for N days |
| Zombie Pods |
CrashLoopBackOff, OOMKilled lingering |
| Orphaned PVCs |
Unbound or pod-less storage still charging |
| Stale Jobs |
Completed jobs not cleaned up |
| Zero-Replica Workloads |
Deployments scaled to 0 |
| Broken Ingresses |
Backends pointing to missing services |
| Misconfigured HPAs |
Stuck at minReplicas, scaling disabled |
π Network Policies
Which namespaces have zero network isolation β before an attacker finds out first.
π Commands
| Command |
Description |
cloud-costs |
Real-time Azure cost analysis from node labels |
security |
CIS Benchmark security posture scoring |
waste |
Orphaned, idle, and zombie resource detection |
network |
Network policy gap analysis |
emergency |
War room β crash loops, pending pods, pull failures |
costs |
Resource-share cost allocation (manual monthly cost) |
report |
Comprehensive cluster health report |
resources |
Cluster resource inventory |
config |
Multi-cluster configuration management |
Common flags:
--cluster CLUSTER # Target cluster context
--all-clusters # Scan all configured clusters
--cluster-group GROUP # Scan a named group
--format html|json|table # Output format
--namespace NS # Scope to single namespace
ποΈ Architecture
opscart-k8s-watcher/
βββ cmd/
β βββ opscart-scan/ β CLI scanner binary
β βββ opscart-dashboard/ β Live dashboard server (v0.8)
βββ pkg/
βββ analyzer/ β Detection engines
βββ models/ β Data structures
βββ report/ β HTML report generators
βββ scanner/ β Multi-cluster orchestration
Dashboard deployment:
opscart-system namespace
βββ opscart-dashboard pod
βββ ClusterRole: read-only (nodes, pods, deployments)
βββ Polls cluster every 60 seconds
βββ REST API: /api/overview, /api/report
βββ Scratch image (~15MB), non-root (UID 65534)
π
Version History
| Version |
Date |
Highlights |
| v0.8.0 |
Jun 2026 |
Live in-cluster FinOps dashboard, 60s background polling, multi-cluster UI |
| v0.7.0 |
Jun 2026 |
cloud-costs command, embedded Azure pricing catalog, enterprise HTML dashboard |
| v0.6.0 |
May 2026 |
costs command, resource-share allocation, FinOps-grade output |
| v0.5.x |
Feb 2026 |
Waste detection (9 types), HTML reports, bug fixes |
| v0.4.0 |
Feb 2026 |
Network policy gap analysis, infrastructure filtering |
| v0.3.0 |
Feb 2026 |
HTML report generation, CIS scoring improvements |
| v0.2.0 |
Feb 2026 |
Multi-cluster support, cluster groups, comparison |
| v0.1.0 |
Jan 2026 |
Initial release β security auditing, CIS Benchmark |
πΊοΈ Roadmap
- v0.9 β SQLite cost history, trend charts, security + waste tabs in dashboard
- v1.0 β Helm chart, AWS/GCP pricing, Slack/Teams alerts, Prometheus integration
β οΈ Disclaimer
Security awareness tool β not for compliance auditing. Use kube-bench for official CIS compliance. Cost estimates based on Azure public retail pricing β actual costs vary with EA/MACC agreements.
π€ Contributing
Issues, PRs, and feature requests welcome. Built for the Kubernetes community.
Author: Shamsher Khan β IEEE Senior Member Β· opscart.com Β· DZone Core Member
License: MIT