Command Palette

Search for a command to run...

UnylyUnyly
Весь каталог

K8scost

БесплатноНе проверен

Kubernetes cost and rightsizing advisor with no Prometheus dependency

GitHubEmbed

Описание

Kubernetes cost and rightsizing advisor with no Prometheus dependency

README

K8SCOST

K8SCOST

Kubernetes cost and rightsizing advisor with no Prometheus dependency

PyPI CI License: COCL 1.0 Suite

DevOps & Observability — status, synthetics, alerts, and cloud cost.

pip install cognis-k8scost
k8scost scan .            # → prioritized findings in seconds

🔎 Example output

Real, reproducible output from the tool — runs offline:

$ k8scost-emit --version
k8scost 0.1.0
$ k8scost-emit --help
usage: k8scost [-h] [--version] [--format {table,json}]
               [--cpu-price CPU_PRICE] [--mem-price MEM_PRICE]
               {analyze} ...

Kubernetes cost & rightsizing advisor (no Prometheus required).

positional arguments:
  {analyze}
    analyze             cost + rightsizing report for workloads

options:
  -h, --help            show this help message and exit
  --version             show program's version number and exit
  --format {table,json}
                        output format (default: table)
  --cpu-price CPU_PRICE
                        $ per vCPU-hour
  --mem-price MEM_PRICE
                        $ per GiB-hour

Blocks above are real k8scost output — reproduce them from a clone.

Sample result format (illustrative values — run on your own data for real findings):

{
"findings": [
    {
        "id": "1234567890",
        "title": "Potential Kubernetes Cluster Compromise",
        "description": "A suspicious pod was detected in a Kubernetes cluster.",
        "labels": ["kubernetes", "compromise"],
        "observables": [
            {"type": "ip", "value": "192.168.1.100"},
            {"type": "domain", "value": "example.com"}
        ]
    }
]
}

Usage — step by step

  1. Install (Python 3.8+, stdlib only):
    pip install k8scost
    
    Input is a workload JSON file (no Prometheus or cluster access required).
  2. Analyze workloads for cost and rightsizing recommendations:
    k8scost analyze workloads.json
    
  3. Override pricing and get detailed per-container advice:
    k8scost --cpu-price 0.031 --mem-price 0.004 analyze workloads.json --advise
    
  4. Read the output as JSON (or stream workloads via stdin with -):
    kubectl get deploy -A -o json | k8scost --format json analyze - | jq '.summary'
    
    JSON includes a summary (total/recommended cost, potential savings, savings_pct) and per-workload workloads[].
  5. Use in CI — surface monthly savings on every infra change:
    k8scost --format json analyze workloads.json | jq '.summary.potential_monthly_savings'
    

Contents

Why k8scost?

k8s FinOps

k8scost is single-purpose, scriptable, and self-hostable: point it at a target, get prioritized results in the format your workflow already speaks (table · JSON · SARIF), gate CI on it, and let agents drive it over MCP.

Features

  • ✅ Parse Cpu
  • ✅ Parse Mem
  • ✅ Parse Workloads
  • ✅ Analyze
  • ✅ Summarize
  • ✅ Runs on Linux/macOS/Windows · Docker · devcontainer
  • ✅ Ports in Python, JavaScript, Go, and Rust (ports/)

Quick start

pip install cognis-k8scost
k8scost --version
k8scost scan .                       # scan current project
k8scost scan . --format json         # machine-readable
k8scost scan . --fail-on high        # CI gate (non-zero exit)

Example

$ k8scost scan .
  [HIGH    ] K8S-001  example finding             (./src/app.py)
  [MEDIUM  ] K8S-002  another signal              (./config.yaml)

  2 findings · risk score 5 · 38ms

Architecture

flowchart LR
  IN[addresses + transactions] --> P[k8scost<br/>cluster + trace]
  P --> OUT[sanctions xref / report]

Use it from any AI stack

k8scost is interoperable with every popular way of using AI:

  • MCP serverk8scost mcp (Claude Desktop, Cursor, Cognis.Studio, uncensored-fleet)
  • OpenAI-compatible / JSON — pipe k8scost scan . --format json into any agent or LLM
  • LangChain · CrewAI · AutoGen · LlamaIndex — wrap the CLI/JSON as a tool in one line
  • CI / scripts — exit codes + SARIF for non-AI pipelines

How it compares

Cognis k8scost Kubecost 3.0
Self-hostable, no account varies
Single command, zero config ⚠️
JSON + SARIF for CI varies
MCP-native (AI agents)
Polyglot ports (JS/Go/Rust)
Open license ✅ COCL varies

Built in the spirit of Kubecost 3.0, re-framed the Cognis way. Missing a credit? Open a PR.

Integrations

Pipes into your stack: SARIF for code-scanning, JSON for anything, an MCP server (k8scost mcp) for AI agents, and a webhook forwarder for SIEM/Slack/Jira. See docs/INTEGRATIONS.md.

Install — every way, every platform

pip install "git+https://github.com/cognis-digital/k8scost.git"    # pip (works today)
pipx install "git+https://github.com/cognis-digital/k8scost.git"   # isolated CLI
uv tool install "git+https://github.com/cognis-digital/k8scost.git" # uv
pip install cognis-k8scost                                          # PyPI (when published)
docker run --rm ghcr.io/cognis-digital/k8scost:latest --help        # Docker
brew install cognis-digital/tap/k8scost                             # Homebrew tap
curl -fsSL https://raw.githubusercontent.com/cognis-digital/k8scost/main/install.sh | sh
Linux macOS Windows Docker Cloud
scripts/setup-linux.sh scripts/setup-macos.sh scripts/setup-windows.ps1 docker run ghcr.io/cognis-digital/k8scost DEPLOY.md (AWS/Azure/GCP/k8s)

Related Cognis tools

  • statuskit — Self-hosted status page with incident timeline and subscribers
  • probesite — Synthetic uptime and Playwright checks exported to Prometheus
  • alertmux — Alert dedup, correlation, and routing in front of Grafana / PagerDuty
  • cloudbill — Multi-cloud cost report, anomaly detection, and FOCUS export
  • otelbox — One-command OpenTelemetry collector + dashboards bundle

Explore the suite → 🗂️ all 170+ tools · ⭐ awesome-cognis · 🔗 cognis-sources · 🤖 uncensored-fleet · 🧠 engram

Contributing

PRs, new rules, and demo scenarios are welcome under the collaboration-pull model — see CONTRIBUTING.md and SECURITY.md.

⭐ If k8scost saved you time, star it — it genuinely helps others find it.

Interoperability

{} composes with the 300+ tool Cognis suite — JSON in/out and a shared OpenAI-compatible /v1 backbone. See INTEROP.md for the suite map, composition patterns, and reference stacks.

License

Source-available under the Cognis Open Collaboration License (COCL) v1.0 — free for personal, internal-evaluation, research, and educational use; commercial / production use requires a license ([email protected]). See LICENSE.


Cognis Digital · one of 170+ tools in the Cognis Neural Suite · Making Tomorrow Better Today

from github.com/cognis-digital/k8scost

Установить K8scost в Claude Desktop, Claude Code, Cursor

Рекомендуется · одна команда, все IDE
unyly install k8scost

Ставит в Claude Desktop, Claude Code, Cursor и VS Code — сам разбирается с npx, uvx и сборкой из исходников.

Впервые? Поставь CLI: curl -fsSL https://unyly.org/install | sh

Или настроить вручную

Выполни в терминале:

claude mcp add k8scost -- uvx --from git+https://github.com/cognis-digital/k8scost cognis-k8scost

Пошаговые гайды: как установить K8scost

FAQ

K8scost MCP бесплатный?

Да, K8scost MCP бесплатный — установка в пару кликов через Unyly без оплаты.

Нужен ли API-ключ для K8scost?

Нет, K8scost работает без API-ключей и переменных окружения.

K8scost — hosted или self-hosted?

Self-hosted: сервер запускается локально на твоей машине командой из раздела установки.

Как установить K8scost в Claude Desktop, Claude Code или Cursor?

Открой K8scost на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.

Похожие MCP

Compare K8scost with

Не уверен что выбрать?

Найди свой стек за 60 секунд

Автор?

Embed-бейдж для README

Похожее

Все в категории development