Skip to content

feat: add optional OpenCost cost awareness#63

Open
juzigu40-ui wants to merge 1 commit intosyedazeez337:masterfrom
juzigu40-ui:codex/kuberift-opencost-cost-awareness
Open

feat: add optional OpenCost cost awareness#63
juzigu40-ui wants to merge 1 commit intosyedazeez337:masterfrom
juzigu40-ui:codex/kuberift-opencost-cost-awareness

Conversation

@juzigu40-ui
Copy link
Copy Markdown

Closes #49.

Summary

  • adds optional [cost] config and OpenCost / Kubecost endpoint discovery
  • queries allocation/compute and maps pod cost onto pods plus controller-backed resources
  • renders an inline cost column and namespace / cluster aggregate in the header
  • keeps cost supplemental: if discovery or fetch fails, the session falls back to normal resource rendering

What changed

  • src/config.rs: loads ~/.config/kuberift/config.toml
  • src/cost.rs: service discovery, allocation parsing, pod-owner/controller aggregation, formatting
  • src/items.rs: optional cost column + expensive-resource highlighting
  • src/k8s/resources.rs: applies a pre-fetched cost snapshot during initial render and live updates
  • README.md: documents config and runtime behavior

Notes

  • direct endpoint override works via cost.opencost_endpoint
  • auto-discovery prefers opencost / kubecost services and uses the Kubernetes service proxy path
  • the cost path is bounded by a short session prefetch timeout; if it misses that window, cost is disabled for the session instead of holding the UI open

Validation

  • cargo test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cost awareness via OpenCost API integration

1 participant