{"id":50784158,"url":"https://github.com/pallaprolus/kube-foresight","last_synced_at":"2026-06-12T06:06:08.026Z","repository":{"id":355350015,"uuid":"1171226503","full_name":"pallaprolus/kube-foresight","owner":"pallaprolus","description":"Predictive Resource Optimizer for Kubernetes — identifies over-provisioned deployments and generates right-sizing patches","archived":false,"fork":false,"pushed_at":"2026-05-03T06:02:52.000Z","size":158,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-03T07:27:29.118Z","etag":null,"topics":["aiops","cli","cloud-cost","cost-optimization","devops","finops","k8s","kubectl","kubernetes","observability","prometheus","python","resource-optimization","right-sizing","sre"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pallaprolus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-03T02:08:29.000Z","updated_at":"2026-05-03T06:02:56.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/pallaprolus/kube-foresight","commit_stats":null,"previous_names":["pallaprolus/kube-foresight"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/pallaprolus/kube-foresight","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pallaprolus%2Fkube-foresight","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pallaprolus%2Fkube-foresight/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pallaprolus%2Fkube-foresight/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pallaprolus%2Fkube-foresight/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pallaprolus","download_url":"https://codeload.github.com/pallaprolus/kube-foresight/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pallaprolus%2Fkube-foresight/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34231243,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-12T02:00:06.859Z","response_time":109,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aiops","cli","cloud-cost","cost-optimization","devops","finops","k8s","kubectl","kubernetes","observability","prometheus","python","resource-optimization","right-sizing","sre"],"created_at":"2026-06-12T06:06:03.406Z","updated_at":"2026-06-12T06:06:08.020Z","avatar_url":"https://github.com/pallaprolus.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# kube-foresight\n\n**Right-size your Kubernetes deployments, forecast resource trends, and see the multi-cloud cost impact — in one tool, with kubectl-ready patches.**\n\n[![CI](https://github.com/pallaprolus/kube-foresight/actions/workflows/ci.yml/badge.svg)](https://github.com/pallaprolus/kube-foresight/actions/workflows/ci.yml)\n[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](LICENSE)\n[![Python](https://img.shields.io/badge/python-3.10%2B-blue.svg)](https://www.python.org/)\n[![PyPI](https://img.shields.io/pypi/v/kube-foresight.svg)](https://pypi.org/project/kube-foresight/)\n[![Status](https://img.shields.io/badge/status-alpha-orange.svg)](#status)\n\n![Dashboard overview](docs/screenshots/overview.png)\n\n## Why kube-foresight?\n\nMost teams over-provision Kubernetes by 40–70% out of fear of outages. Existing tools each solve a piece of this problem — kube-foresight ties the pieces together:\n\n| Tool | Right-sizing recs | Patch output | Forecasting | Multi-cloud cost |\n|------|:-:|:-:|:-:|:-:|\n| **kube-foresight** | ✅ | ✅ kubectl YAML | ✅ breach prediction | ✅ AWS / GCP / Azure |\n| Goldilocks (Fairwinds) | ✅ | — VPA objects | — | — |\n| KRR (Robusta) | ✅ | — text suggestions | — | — |\n| VPA (native) | ✅ | — auto-applies | — | — |\n| Kubecost / OpenCost | partial | — | — | ✅ |\n\nIf you're already happy with KRR for recommendations and Kubecost for spend, you don't need this. **kube-foresight exists for the case where you want a single CLI / dashboard that says \"here's the patch, here's when you'll breach, and here's the dollar delta on AWS vs GCP vs Azure.\"**\n\n## Status\n\n**Alpha — actively developed, not yet battle-tested in production.** Reports, issues, and PRs welcome. See [CHANGELOG / releases](https://github.com/pallaprolus/kube-foresight/releases).\n\n## Try it in 30 seconds (no cluster needed)\n\n```bash\npip install \"kube-foresight[dashboard]\"\nkube-foresight demo                 # full pipeline against synthetic data\nkube-foresight dashboard --demo     # web UI at http://localhost:8080\n```\n\n![Recommendations view](docs/screenshots/recommendations.png)\n\n## Use it on a real cluster\n\n```bash\n# 1. Identify over-provisioned deployments (Metrics API or Prometheus)\nkube-foresight analyze   -n production --mode k8s\nkube-foresight recommend -n production --mode prometheus -p http://prometheus:9090\n\n# 2. Generate kubectl-ready patches\nkube-foresight patch -n production --mode k8s -o ./patches\nkubectl apply -f ./patches/api-gateway-patch.yaml\n\n# 3. Forecast when usage will breach current limits\nkube-foresight forecast -n production --mode k8s\n```\n\n## What's in the box\n\n- **Three collectors** — Kubernetes Metrics API, Prometheus, or mock (for demo / CI)\n- **Statistical right-sizing** — p95 / p99 / max strategies with IQR anomaly filtering and configurable headroom\n- **Forecasting** — linear regression on historical usage with breach-time prediction and risk classification\n- **Multi-cloud cost estimation** — AWS / GCP / Azure pricing side-by-side\n- **Patch generator** — strategic-merge YAML you can `kubectl apply`\n- **Web dashboard** — FastAPI + HTMX + Chart.js (executive summary, recommendations, costs)\n- **HPA conflict detection** — refuses to recommend changes that fight your autoscaler\n- **Production plumbing** — Dockerfile, Helm chart, health probes, structured JSON logs, optional Slack alerts\n\n## CLI reference\n\n| Command | Purpose |\n|---------|---------|\n| `demo` | Full pipeline with synthetic data — no cluster required |\n| `analyze` | Identify over-provisioned deployments |\n| `collect` | Snapshot metrics into SQLite for trend analysis |\n| `recommend` | Right-sizing recommendations + cost estimates |\n| `patch` | Generate kubectl-applyable YAML patches |\n| `forecast` | Predict resource trends and breach timelines |\n| `dashboard` | Launch the web UI |\n\nCommon flags: `--namespace/-n`, `--mode/-m {mock,k8s,prometheus}`, `--prometheus-url/-p`, `--strategy/-s {p95,p99,max}`, `--headroom 0.20`, `--top 10`, `--lookback 168`.\n\n## Deployment\n\n### Docker\n\n```bash\ndocker build -t kube-foresight .\ndocker run -p 8080:8080 kube-foresight dashboard --host 0.0.0.0 --port 8080 --demo\n```\n\n### Helm\n\n```bash\nhelm install kube-foresight charts/kube-foresight \\\n  --set collector.mode=k8s \\\n  --set collector.namespaces=production \\\n  --set scheduler.enabled=true\n```\n\nSee [`charts/kube-foresight/values.yaml`](charts/kube-foresight/values.yaml) for persistence, ingress, alerting, and authentication options.\n\n## Configuration\n\nAll settings are environment variables prefixed `KF_`:\n\n| Variable | Purpose | Default |\n|----------|---------|---------|\n| `KF_MODE` | Collector mode (`mock`, `k8s`, `prometheus`) | `k8s` |\n| `KF_NAMESPACES` | Comma-separated namespaces | `default` |\n| `KF_CLOUD_PROVIDER` | Pricing source: `aws`, `gcp`, `azure` | `aws` |\n| `KF_SCHEDULER_ENABLED` | Background collect/analyze loop | `false` |\n| `KF_COLLECT_INTERVAL` | Collection interval (seconds) | `300` |\n| `KF_ANALYSIS_INTERVAL` | Analysis interval (seconds) | `900` |\n| `KF_SLACK_WEBHOOK_URL` | Slack alerts for at-risk deployments | — |\n| `KF_LOG_FORMAT` | `text` or `json` | `text` |\n\nMulti-tenant dashboard authentication (Executive / Engineer / Admin API keys) is documented in [`docs/auth.md`](docs/auth.md). For single-user evaluation, no setup is required.\n\n## Development\n\n```bash\ngit clone https://github.com/pallaprolus/kube-foresight \u0026\u0026 cd kube-foresight\npip install -e \".[k8s,dashboard,dev]\"\npytest tests/ -v --tb=short        # 276 tests\nruff check .\nhelm lint charts/kube-foresight\n```\n\nFor codebase layout, conventions, and the data-flow diagram, see [`docs/architecture.md`](docs/architecture.md).\n\n## Contributing\n\nIssues and PRs are very welcome — particularly: real-world deployment reports, additional pricing providers, and validation of forecast accuracy on production traces. See [`CONTRIBUTING.md`](CONTRIBUTING.md) once filed.\n\n## License\n\nApache License 2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpallaprolus%2Fkube-foresight","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpallaprolus%2Fkube-foresight","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpallaprolus%2Fkube-foresight/lists"}