# KodeKloud: Courses Building Kubernetes FinOps AI Agent ## Building Kubernetes FinOps AI Agent ### Introduction - [Course: Building Kubernetes FinOps AI Agent](https://notes.kodekloud.com/docs/Building-Kubernetes-FinOps-AI-Agent/index.md): Course teaching how to build a Kubernetes FinOps AI agent that audits tagging and resource usage, enforces policies, and automates ticketing to reduce cloud spend. - [Introduction](https://notes.kodekloud.com/docs/Building-Kubernetes-FinOps-AI-Agent/Introduction/Introduction/page.md): Course teaching how to build a Kubernetes FinOps AI agent that audits tagging and resource usage, enforces policies, and automates ticketing to reduce cloud spend. ### The Problem Statement - [SkyLine Air Kubernetes Implementation](https://notes.kodekloud.com/docs/Building-Kubernetes-FinOps-AI-Agent/The-Problem-Statement/SkyLine-Air-Kubernetes-Implementation/page.md): Framing a FinOps AI agent to automate cloud cost management, correlate billing and Kubernetes telemetry, and guide SREs deploying and operating the agent on AWS EKS - [2 AM Incident](https://notes.kodekloud.com/docs/Building-Kubernetes-FinOps-AI-Agent/The-Problem-Statement/2-AM-Incident/page.md): A new on-call engineer triages a 2 AM payment gateway Kubernetes outage, encountering unexpected kubectl behavior and following a checklist of diagnostic commands to resolve the incident. - [Demo Debugging a Production Incident in Skyline Air](https://notes.kodekloud.com/docs/Building-Kubernetes-FinOps-AI-Agent/The-Problem-Statement/Demo-Debugging-a-Production-Incident-in-Skyline-Air/page.md): Walkthrough diagnosing a production payment service incident on Kubernetes, covering namespace checks, pods, services, logs, probes, endpoints, and debugging commands - [Demo Verifying the PaymentUI](https://notes.kodekloud.com/docs/Building-Kubernetes-FinOps-AI-Agent/The-Problem-Statement/Demo-Verifying-the-PaymentUI/page.md): Verifying Payment UI reachability and diagnosing Kubernetes service failures causing frontend 503 errors by inspecting pods services endpoints readiness probes and logs in the payment namespace - [Demo Investigate the Namespace](https://notes.kodekloud.com/docs/Building-Kubernetes-FinOps-AI-Agent/The-Problem-Statement/Demo-Investigate-the-Namespace/page.md): Guides debugging a Kubernetes payment namespace to find why the gateway API is down, revealing the API Deployment scaled to zero and steps to inspect and restore it. - [Demo Ownership Wall Fix and Validate](https://notes.kodekloud.com/docs/Building-Kubernetes-FinOps-AI-Agent/The-Problem-Statement/Demo-Ownership-Wall-Fix-and-Validate/page.md): Guide to using Kubernetes labels to find ownership, scale a failing payment deployment, validate service functionality, and make ownership fixes durable with repository and automation. - [Writing the Three Pointer Incident Report](https://notes.kodekloud.com/docs/Building-Kubernetes-FinOps-AI-Agent/The-Problem-Statement/Writing-the-Three-Pointer-Incident-Report/page.md): How to write concise incident reports using a three‑point check, identify missing ownership metadata, and use FinOps AI agents to enforce resource labeling and reduce MTTR and operational cost - [FinOps AI Agent for Kubernetes](https://notes.kodekloud.com/docs/Building-Kubernetes-FinOps-AI-Agent/The-Problem-Statement/FinOps-AI-Agent-for-Kubernetes/page.md): Building a FinOps AI agent on Kubernetes to automate cost optimization, incident remediation, and operational governance using LLMs, agents, and practical deployment workflows. - [Cost Associated Issue When Scaling With Kubernetes](https://notes.kodekloud.com/docs/Building-Kubernetes-FinOps-AI-Agent/The-Problem-Statement/Cost-Associated-Issue-When-Scaling-With-Kubernetes/page.md): Kubernetes scaling causes cloud cost leakage and offers FinOps practices to right-size resources, reduce node pool fragmentation, and attribute costs to teams - [Why This Isnt Just SkyLine Airs Problem](https://notes.kodekloud.com/docs/Building-Kubernetes-FinOps-AI-Agent/The-Problem-Statement/Why-This-Isnt-Just-SkyLine-Airs-Problem/page.md): Explains FinOps practices and automation to detect, attribute, assign ownership, and remediate cloud resource waste across teams to improve cost transparency and accountability. ### Introduction to FinOps - [Introduction to FinOps](https://notes.kodekloud.com/docs/Building-Kubernetes-FinOps-AI-Agent/Introduction-to-FinOps/Introduction-to-FinOps/page.md): Explains FinOps, managing cloud costs through visibility, allocation, and cross-functional collaboration to align spend with business value in Kubernetes and cloud environments. - [The Three Phases of FinOps](https://notes.kodekloud.com/docs/Building-Kubernetes-FinOps-AI-Agent/Introduction-to-FinOps/The-Three-Phases-of-FinOps/page.md): Guide to Kubernetes FinOps covering Inform, Optimize and Operate to improve visibility, assign ownership, cut waste, and automate continuous cost governance for cloud and AI workloads. - [FinOps for AI Why It Emerged Now](https://notes.kodekloud.com/docs/Building-Kubernetes-FinOps-AI-Agent/Introduction-to-FinOps/FinOps-for-AI-Why-It-Emerged-Now/page.md): Explains why FinOps for AI emerged, highlighting usage-driven costs, GPU scarcity, distributed ownership, and new governance practices like token accounting, quotas, and Kubernetes-based controls. - [Why YAML for Tagging Policy](https://notes.kodekloud.com/docs/Building-Kubernetes-FinOps-AI-Agent/Introduction-to-FinOps/Why-YAML-for-Tagging-Policy/page.md): Explains using YAML tagging policy for Kubernetes FinOps, showing tagging-rules.yaml examples, benefits over JSON or spreadsheets, and best practices for ownership and automation - [Tagging Rules at a Glance SkyLine Air](https://notes.kodekloud.com/docs/Building-Kubernetes-FinOps-AI-Agent/Introduction-to-FinOps/Tagging-Rules-at-a-Glance-SkyLine-Air/page.md): Explains a tagging-rules.yaml for Kubernetes governance with required labels, alternate label mappings, controlled vocabularies, resource kinds to scan, excluded namespaces, and an enforcement workflow. - [Why Tagging Policy as Code Not Spreadsheets Not Dashboards](https://notes.kodekloud.com/docs/Building-Kubernetes-FinOps-AI-Agent/Introduction-to-FinOps/Why-Tagging-Policy-as-Code-Not-Spreadsheets-Not-Dashboards/page.md): Advocates using YAML policy as code to enforce and automate resource tagging and cost governance across CI/CD and runtime, replacing error prone spreadsheets and reactive dashboards ### Setting Up SkyLine Air Kubernetes Services - [Overview of SkyLine Air Technical Architecture Part 1](https://notes.kodekloud.com/docs/Building-Kubernetes-FinOps-AI-Agent/Setting-Up-SkyLine-Air-Kubernetes-Services/Overview-of-SkyLine-Air-Technical-Architecture-Part-1/page.md): Deploying SkyLine Air microservices on Kubernetes and collecting runtime metadata for a FinOps AI agent, including namespaces, RBAC, storage, networking, and observability. - [Overview of SkyLine Air Technical Architecture Part 2](https://notes.kodekloud.com/docs/Building-Kubernetes-FinOps-AI-Agent/Setting-Up-SkyLine-Air-Kubernetes-Services/Overview-of-SkyLine-Air-Technical-Architecture-Part-2/page.md): Describes deploying SkyLine Air microservices on Kubernetes including repository layout, per-service manifests, namespaces, PVCs, and using Kustomize overlays with deployment and operational checklist. - [Demo Setting Up Namespaces for Different Units in the SkyLine Air Team](https://notes.kodekloud.com/docs/Building-Kubernetes-FinOps-AI-Agent/Setting-Up-SkyLine-Air-Kubernetes-Services/Demo-Setting-Up-Namespaces-for-Different-Units-in-the-SkyLine-Air-Team/page.md): Guide to create a local kind Kubernetes cluster and provision per-service namespaces for the SkyLine Air microservices, including prerequisites and verification commands. - [Demo Deploying All Apps Into Kubernetes Cluster](https://notes.kodekloud.com/docs/Building-Kubernetes-FinOps-AI-Agent/Setting-Up-SkyLine-Air-Kubernetes-Services/Demo-Deploying-All-Apps-Into-Kubernetes-Cluster/page.md): Deploying Skyline Air microservices into a Kubernetes cluster using per-service namespaces and a kustomize overlay, verifying rollouts and port-forwarding the booking UI for local testing. - [Demo Exploring the Labels in Our Cluster](https://notes.kodekloud.com/docs/Building-Kubernetes-FinOps-AI-Agent/Setting-Up-SkyLine-Air-Kubernetes-Services/Demo-Exploring-the-Labels-in-Our-Cluster/page.md): Demonstrates Kubernetes label inconsistencies across namespaces, explains impacts on operations and billing, and proposes a minimal labeling policy plus enforcement and remediation options. - [Demo Whiteboarding SkyLine Air Kubernetes Services](https://notes.kodekloud.com/docs/Building-Kubernetes-FinOps-AI-Agent/Setting-Up-SkyLine-Air-Kubernetes-Services/Demo-Whiteboarding-SkyLine-Air-Kubernetes-Services/page.md): Designing an MCP to collect, sanitize, and summarize Kubernetes metadata, integrating LLMs, RBAC, and auditing ### MCP Gateway for Kubernetes - [MCP in 90 Seconds What It Is and Why Agents Need It](https://notes.kodekloud.com/docs/Building-Kubernetes-FinOps-AI-Agent/MCP-Gateway-for-Kubernetes/MCP-in-90-Seconds-What-It-Is-and-Why-Agents-Need-It/page.md): Explains the Model Context Protocol and how agents use JSON-RPC to connect to tools like kubectl, plus steps to set up an MCP server with Kubernetes - [Demo Start the MCP Gateway](https://notes.kodekloud.com/docs/Building-Kubernetes-FinOps-AI-Agent/MCP-Gateway-for-Kubernetes/Demo-Start-the-MCP-Gateway/page.md): Guide to start a local MCP gateway that runs an MCP server in Docker and exposes a streamable HTTP endpoint using npx supergateway, with kubeconfig and health checks. - [Demo Validate the MCP to Kubernetes Connection](https://notes.kodekloud.com/docs/Building-Kubernetes-FinOps-AI-Agent/MCP-Gateway-for-Kubernetes/Demo-Validate-the-MCP-to-Kubernetes-Connection/page.md): Guide to validate a local Managed Control Plane connected to Kubernetes via Supergateway, including health check, JSON-RPC initialize handshake, and running a kubectl_get tool to list namespaces - [Demo Whiteboarding MCP Design](https://notes.kodekloud.com/docs/Building-Kubernetes-FinOps-AI-Agent/MCP-Gateway-for-Kubernetes/Demo-Whiteboarding-MCP-Design/page.md): Designing a Managed Control Plane connecting an LLM to Kubernetes to enable secure tool calls and API-driven cluster operations - [Why MCP and What Were Not Using Instead](https://notes.kodekloud.com/docs/Building-Kubernetes-FinOps-AI-Agent/MCP-Gateway-for-Kubernetes/Why-MCP-and-What-Were-Not-Using-Instead/page.md): Comparing adopting MCP versus custom Kubernetes API scripts for integrating AI agents, highlighting interoperability, maintenance trade offs, and authentication maturity considerations. ### LangChain MCP Agents - [Standalone MCP vs Supergateway](https://notes.kodekloud.com/docs/Building-Kubernetes-FinOps-AI-Agent/LangChain-MCP-Agents/Standalone-MCP-vs-Supergateway/page.md): Compares using a Supergateway versus running a standalone MCP over HTTP, recommending direct agent connections to MCP in Docker for simpler production use and testing with curl. - [Demo Start and Validate MCP](https://notes.kodekloud.com/docs/Building-Kubernetes-FinOps-AI-Agent/LangChain-MCP-Agents/Demo-Start-and-Validate-MCP/page.md): Walkthrough to run an MCP server in Docker, configure container-accessible kubeconfig for a kind cluster, pull and run the image, and validate connectivity. - [LangChain Agent Shared Wiring](https://notes.kodekloud.com/docs/Building-Kubernetes-FinOps-AI-Agent/LangChain-MCP-Agents/LangChain-Agent-Shared-Wiring/page.md): Guide to shared Python module wiring for LangChain agents using MCP tools, covering discovery, LLM setup, agent creation, invocation, and cleanup - [env File Exploration](https://notes.kodekloud.com/docs/Building-Kubernetes-FinOps-AI-Agent/LangChain-MCP-Agents/env-File-Exploration/page.md): Guide explaining .env file usage, example variables, .gitignore patterns, and best practices to avoid committing secrets and manage environment configuration for local development. - [Demo Your First LangChain MCP Agent](https://notes.kodekloud.com/docs/Building-Kubernetes-FinOps-AI-Agent/LangChain-MCP-Agents/Demo-Your-First-LangChain-MCP-Agent/page.md): Demo showing a LangChain-driven agent using an MCP server to run kubectl-like tools against a Kubernetes cluster and produce human friendly reports - [Demo Audit Kubernetes Labels via MCP Agent](https://notes.kodekloud.com/docs/Building-Kubernetes-FinOps-AI-Agent/LangChain-MCP-Agents/Demo-Audit-Kubernetes-Labels-via-MCP-Agent/page.md): Demonstrates a Python MCP agent that uses an LLM to audit Kubernetes resource labels, listing resources and flagging missing owner and cost-center governance labels with a human summary. - [Demo Whiteboarding Langchain MCP](https://notes.kodekloud.com/docs/Building-Kubernetes-FinOps-AI-Agent/LangChain-MCP-Agents/Demo-Whiteboarding-Langchain-MCP/page.md): Describes redesign centralizing Kubernetes tool interactions via an MCP server with a LangChain Python agent orchestrating LLM-driven tool calls and logging outputs. - [Why LangChain and When Youd Reach for Something Else](https://notes.kodekloud.com/docs/Building-Kubernetes-FinOps-AI-Agent/LangChain-MCP-Agents/Why-LangChain-and-When-Youd-Reach-for-Something-Else/page.md): Comparison of LangChain, LlamaIndex, and raw SDKs to guide tool choice based on prototyping speed, document retrieval needs, and latency or control requirements. ### LLM Policy-Aware Label Audit - [Demo Whiteboarding tagging rules Integration](https://notes.kodekloud.com/docs/Building-Kubernetes-FinOps-AI-Agent/LLM-Policy-Aware-Label-Audit/Demo-Whiteboarding-tagging-rules-Integration/page.md): Enforcing schema-driven tagging by integrating canonical tagging rules and a locked system prompt so LLM agents produce validated, machine-readable JSON outputs for automation and auditing - [Demo A Quick Relook Into tagging rulesyaml](https://notes.kodekloud.com/docs/Building-Kubernetes-FinOps-AI-Agent/LLM-Policy-Aware-Label-Audit/Demo-A-Quick-Relook-Into-tagging-rulesyaml/page.md): Overview of Kubernetes tagging rules YAML for an airline booking context covering required tags, label mappings, allowed values, resource types, and namespace exclusions for governance and automation. - [Demo Walk the Policy Auditor Agent and System Prompt](https://notes.kodekloud.com/docs/Building-Kubernetes-FinOps-AI-Agent/LLM-Policy-Aware-Label-Audit/Demo-Walk-the-Policy-Auditor-Agent-and-System-Prompt/page.md): Explains a Policy Auditor agent demo that separates user task prompts from system-level tagging rules, injects YAML policies, builds LLM tools, and prevents hallucinations during Kubernetes label audits - [Demo Run the Policy Auditor Agent](https://notes.kodekloud.com/docs/Building-Kubernetes-FinOps-AI-Agent/LLM-Policy-Aware-Label-Audit/Demo-Run-the-Policy-Auditor-Agent/page.md): Guide to running and comparing baseline and structured Kubernetes label auditing agents using MCP, demonstrating policy-aware LLM prompts for consistent, machine-friendly compliance reports. - [Demo Fix Truncated Audit Output](https://notes.kodekloud.com/docs/Building-Kubernetes-FinOps-AI-Agent/LLM-Policy-Aware-Label-Audit/Demo-Fix-Truncated-Audit-Output/page.md): Explains fixing truncated LLM audit output by increasing max_tokens in a Python auditor, showing code changes, token guidance, and alternatives to reduce output length. - [Demo Whiteboarding the Final Policy Aware Agent](https://notes.kodekloud.com/docs/Building-Kubernetes-FinOps-AI-Agent/LLM-Policy-Aware-Label-Audit/Demo-Whiteboarding-the-Final-Policy-Aware-Agent/page.md): Guides converting agent logs into structured, actionable Kubernetes policy findings with schema, remediation, prioritization, idempotency, and integrations for automated ticketing, alerts, and GitOps - [Why an LLM Judges Policy and Where That Can Bite You](https://notes.kodekloud.com/docs/Building-Kubernetes-FinOps-AI-Agent/LLM-Policy-Aware-Label-Audit/Why-an-LLM-Judges-Policy-and-Where-That-Can-Bite-You/page.md): Discusses using LLMs as policy auditors versus deterministic rule engines, outlining trade offs, hybrid patterns, mitigations, operational considerations, and deployment checklist ### From Findings to Actionable Tickets - [Issue Tracker Landscape](https://notes.kodekloud.com/docs/Building-Kubernetes-FinOps-AI-Agent/From-Findings-to-Actionable-Tickets/Issue-Tracker-Landscape/page.md): Guidance on converting raw alerts into structured, actionable issue tracker tickets with field mappings, priorities, ownership, cost estimates and automated creation to drive remediation - [Demo Whiteboarding the Issue Tracker Setup](https://notes.kodekloud.com/docs/Building-Kubernetes-FinOps-AI-Agent/From-Findings-to-Actionable-Tickets/Demo-Whiteboarding-the-Issue-Tracker-Setup/page.md): Designing an agent integration that converts findings into structured issue tracker tickets via a connector, handling authentication, payload formatting, idempotency, rate limits, and error handling - [Demo Launch the FinOps Issue Tracker](https://notes.kodekloud.com/docs/Building-Kubernetes-FinOps-AI-Agent/From-Findings-to-Actionable-Tickets/Demo-Launch-the-FinOps-Issue-Tracker/page.md): Demo of a FinOps issue tracker exposing an MCP server so agents programmatically create, list, retrieve, and update tickets, with example API, Kanban UI, and integration guidance - [Demo Test Tracker MCP](https://notes.kodekloud.com/docs/Building-Kubernetes-FinOps-AI-Agent/From-Findings-to-Actionable-Tickets/Demo-Test-Tracker-MCP/page.md): Demo Python script that discovers issue tracker MCP tools, converts them to LangChain tools, and uses an LLM prompt to list available tracker actions - [Demo Audit Tracker Update Code Review](https://notes.kodekloud.com/docs/Building-Kubernetes-FinOps-AI-Agent/From-Findings-to-Actionable-Tickets/Demo-Audit-Tracker-Update-Code-Review/page.md): Explains code changes that enable a FinOps agent to evaluate deployment labels, enforce tagging rules, restrict tools, create one tracker ticket per non compliant resource, and list issues. - [Demo Running the Audit Tracker Agent and Review the Tickets](https://notes.kodekloud.com/docs/Building-Kubernetes-FinOps-AI-Agent/From-Findings-to-Actionable-Tickets/Demo-Running-the-Audit-Tracker-Agent-and-Review-the-Tickets/page.md): Demonstrates running a FinOps audit agent that collects Kubernetes Deployments, evaluates tagging compliance, and creates issue tracker tickets for non compliant resources across namespaces - [Demo Whiteboarding Audit Tracker Flow](https://notes.kodekloud.com/docs/Building-Kubernetes-FinOps-AI-Agent/From-Findings-to-Actionable-Tickets/Demo-Whiteboarding-Audit-Tracker-Flow/page.md): Recap of building a pipeline that converts Kubernetes findings into enriched, prioritized issue tracker tickets using MCP endpoints, LLM enrichment, tagging rules, and LangChain orchestration. - [Fitting This Into Your Org Not Just This Course](https://notes.kodekloud.com/docs/Building-Kubernetes-FinOps-AI-Agent/From-Findings-to-Actionable-Tickets/Fitting-This-Into-Your-Org-Not-Just-This-Course/page.md): Describes a repeatable pattern to detect Kubernetes policy violations, explain findings, and create actionable tickets integrating audits, policies, reasoning, and issue tracking.