Autonomous FinOps for Kubernetes · June 2026

KUBERNETES
ON AUTOPILOT

AFIE is an autonomous FinOps intelligence engine that right-sizes your Kubernetes workloads with reinforcement learning, guards every action behind a policy engine, and explains itself in plain English.

0
dim state vector
0
discrete actions
0
PCL safety rules
0h
eval windows
PPOSHAP XAIPrometheusGrafanaKINDArgo CDFlux CDASP.NET CoreKubernetes OperatorGitHub PR rolloutsTerraformAzure Event HubCosmos DBPPOSHAP XAIPrometheusGrafanaKINDArgo CDFlux CDASP.NET CoreKubernetes OperatorGitHub PR rolloutsTerraformAzure Event HubCosmos DBPPOSHAP XAIPrometheusGrafanaKINDArgo CDFlux CDASP.NET CoreKubernetes OperatorGitHub PR rolloutsTerraformAzure Event HubCosmos DB
The Project

Kubernetes
wastes money.
Quietly.

Most Kubernetes clusters run on requests set by engineers who guessed once, six months ago. The gap between what pods request and what they actually use is where cloud bills quietly grow — a problem too tedious for humans to solve continuously and too high-stakes to leave to naive autoscalers.

AFIE closes that loop. A PPO agent trained on the Azure Public Dataset proposes CPU and memory adjustments every 15 seconds. A Policy Constraint Language engine validates every proposal against safety rules. Approved changes ship as GitHub pull requests with SHAP explanations attached — humans stay in the loop for critical decisions, but the paperwork disappears.

Project
AFIE
Focus
FinOps · Kubernetes · RL
Target
June 2026 · IEEE TCC
Duration
36 weeks · 9 phases
The System

Four pieces.
One autonomous loop.

01Component

RL that learned from real clusters

PPO from Stable-Baselines3, pre-trained on 2.66M VM traces from the Azure Public Dataset, then fine-tuned online with a 70/30 live-to-offline replay buffer.

02Component

Policy constraints, not blind trust

Every recommendation flows through a Policy Constraint Language engine. Four rules cover magnitude, headroom, deploy conflicts, and cooldown. The RL model never touches production directly.

03Component

Explanations on every decision

SHAP KernelExplainer surfaces the top features driving each action. A template layer turns the vector into a sentence a human can read at 2 a.m. during an incident.

04Component

GitOps-native rollouts

Approved actions ship as Helm patches via GitHub PRs, synced by Argo CD or Flux. A health checker watches P99 and error rate — SLO regressions revert the commit automatically.

In Motion

Workloads shuffle.
Config lands.
Repeat.

Every 15 seconds telemetry lands, features rebuild, the RL agent proposes an action, the PCL engine checks the rules, and the operator opens a pull request. The stack never stops moving.

  • Telemetry → features → action → PR
  • Rollbacks fire automatically on SLO drift
  • Every commit carries an explanation
The Stack

Every tool,
named and versioned.

AFIE is built from mature, open-source pieces. Nothing exotic — each choice is one an SRE team could operate on day one.

01 · Layer

Backend & Data

The C# services that scrape, transform, and reconcile.

.NET 8
ASP.NET Core
Python 3.11
PostgreSQL
02 · Layer

ML & Intelligence

The reinforcement-learning brain and its explanations.

PyTorch
Stable-Baselines3
SHAP
NumPy
pandas
Gymnasium
03 · Layer

Kubernetes & Ops

The cluster, observability, and GitOps controllers.

Kubernetes
Docker
Helm
KIND
Prometheus
Grafana
Argo CD
Flux CD
Terraform
GitHub Actions
04 · Layer

Frontend

The dashboard for cost, actions, SLO, and human overrides.

Next.js
TypeScript
Vite
Tailwind CSS
shadcn/ui
Recharts
05 · Layer

Azure Cloud (Prod)

Provisioned only in Phase 8.

Azure
Event Hub
Cosmos DB
Key Vault
Static Web Apps
Azure ML
The Timeline

36 weeks.
Two stages.

Phases 1–7 run entirely on a laptop with KIND. Nothing is committed to Azure until every service works locally. Phases 8–9 provision cloud infrastructure and run the formal evaluation.

DEV · Local · $0PROD · Azure
Stage 01 · Development

On your laptop.

Everything runs locally on KIND. Prometheus, Grafana, the operator, and every service behave exactly as they will on Azure — you just don't pay for it yet.

DEVWeeks 1 – 23
  1. 01
    DEVWeeks 1–2$0 · Local

    Environment Setup & Accounts

    Install every tool, create every account, scaffold the monorepo. Nothing else can start until this is done.

    • Azure Student credit reserved for Phase 8
    • Public GitHub repo with monorepo structure
    • 13 tools installed and version-verified
    • AFIE.sln committed at repo root
  2. 02
    DEVWeeks 3–4$0 · Local

    Local Kubernetes + Observability

    KIND cluster on the laptop, Prometheus and Grafana via Helm, Argo CD or Flux as the pluggable GitOps controller.

    • KIND cluster with 6 namespaces
    • Prometheus scraping cluster metrics
    • Grafana dashboards live at localhost:3000
    • GitOps controller running (Argo CD default)
  3. 03
    DEVWeeks 5–7$0 · Local

    Telemetry Pipeline (ASP.NET Core)

    The data backbone. Scrapes Prometheus every 15 seconds and publishes enriched metric events every other component depends on.

    • AFIE.Telemetry running as a pod on KIND
    • /health endpoint returning 200
    • Local JSONL publisher active for dev
    • Event Hub publisher coded, gated behind config
  4. 04
    DEVWeeks 8–10$0 · Local

    Feature Engineering — 47-dim State Vector

    Transform raw metrics into the 47-dimensional state the RL agent needs. The most mathematically careful phase in the project.

    • Sliding-window state store with P50/P95/P99
    • State vectors persisting to PostgreSQL
    • All 8 feature-group unit tests passing
    • Every dimension confirmed in [-1.0, 1.0]
  5. 05
    DEVWeeks 11–15$0 · Local

    Reinforcement Learning Agent (Python)

    The brain. PPO from Stable-Baselines3 trained on the Azure Public Dataset, with a Gymnasium environment and SHAP explanations.

    • PPO trained for 1M timesteps
    • Mean reward > 0.5 in TensorBoard
    • Local Flask inference server on :5001
    • SHAP producing human-readable explanations
  6. 06
    DEVWeeks 16–19$0 · Local

    Kubernetes Operator + PCL Engine (C#)

    The most novel engineering piece. A C# operator validates every RL recommendation against Policy Constraint Language rules, then opens a GitHub PR.

    • Operator watching ResourceRecommendation CRDs
    • PCL engine rejecting unsafe recommendations
    • Auto PRs with Helm patches and XAI notes
    • Health checker triggering rollback on SLO drop
  7. 07
    DEVWeeks 20–23$0 · Local

    React / TypeScript Dashboard

    The face of the system. Real-time savings, action history with SHAP, SLO heatmaps, and one-click human override.

    • BFF API with all endpoints responding
    • Dashboard at localhost:5173 with live data
    • SHAP + XAI drawers on every action
    • SLO heatmap and RL training monitor
  8. Stage 02 · Production

    Ship it to Azure.

    Every service flips from local mode to cloud mode via one config switch. Terraform provisions Event Hub, Cosmos DB, Key Vault, and Static Web Apps. Formal experiments start here.

    PRODWeeks 24 – 36
    08
    PRODWeeks 24–25Azure credits

    Azure Services, CI/CD & GitOps Hardening

    Provision Event Hub, Cosmos DB, Key Vault, and Static Web Apps. Flip services from local mode to cloud mode via a single config switch.

    • Terraform IaC for every provisioned service
    • CI pipelines for .NET, Python, React
    • Docker images publishing on merge to main
    • Dashboard live on Azure Static Web Apps
  9. 09
    PRODWeeks 26–36Azure credits

    Evaluation, IEEE Paper & Publication

    72-hour experiments across four baselines, Mann–Whitney significance testing, XAI human study, and submission to arXiv + IEEE TCC.

    • 12 experiment runs (3 seeds × 4 baselines × 72h)
    • Statistical significance at p < 0.05
    • 4 publication-quality figures at 300dpi
    • arXiv preprint + IEEE TCC submission

What we are measuring.

Every claim in the paper is backed by 12 experiment runs — three seeds across four configurations, each 72 hours long, with Mann–Whitney U tests and Cohen's d effect sizes.

1M
PPO training timesteps
2.66M
VM traces in the training set
8
workload archetypes evaluated
4
baselines benchmarked against
n = 10
raters in the XAI human study
p < 0.05
statistical significance target
Coming to arXiv + IEEE TCC

A Kubernetes cluster
that runs itself.

Follow the build in the open — every commit, every experiment run, every figure that ends up in the paper.