Bilal Ashraf Cooked up by Bilal Ashraf 👨‍💻

K8s Pizza Observability

Get Dominos when CPU is stressed 🔥

SYSTEM OVERVIEW ⚙️

helm install k8s-pizza helm/k8s-pizza-observability-chart

Core Concept

Kubernetes Pizza Observability serves up pizza orders when your cluster's CPU usage exceeds a threshold.

This project combines infrastructure monitoring with real-world actions, demonstrating a fun and practical application of observability principles.

Workflow

  1. Monitoring: Prometheus tracks CPU usage
  2. Alerting: AlertManager triggers when CPU > 80%
  3. Processing: Azure Function prepares order
  4. Confirmation: Slack app for approval
  5. Ordering: Places order with Domino's API
  6. Tracking: Order status in K8s resources

Technology Stack

  • Kubernetes: Orchestrates containers & hosts custom PizzaOrder CRD
  • Go: Powers the custom controller with concurrent order processing
  • Node.js: Drives Azure Function webhook & Slack interactive messages
  • Prometheus: Collects & alerts on CPU metrics with PromQL queries
  • Terraform: Provisions Azure resources with declarative IaC
  • Helm: Packages the entire solution for one-command deployment

Project Structure

Modular organization with clear separation of concerns:

/k8-pizza-observability
├── 📦 azure-function/    # Serverless function for order processing
├── 📄 docs/              # Documentation and website
├── ⚓ helm/              # Deployment charts
│   └── 📊 k8s-pizza-observability-chart/
├── 🛞 kubernetes/
│   ├── 🎮 controller/    # Go-based pizza controller
│   ├── 📝 crds/          # Custom Resource Definitions
│   └── 🧩 samples/       # Example PizzaOrder resources
├── 🔧 scripts/           # Utility scripts
├── 💬 slack/             # Slack app integration
└── 🏗️ terraform/         # Infrastructure as code
                        

Interactive Terminal 💻

kubectl commands

$ Welcome to K8s Pizza Terminal! Try some commands below:

$

Components 🧩

📊

Prometheus & Grafana

Monitors cluster metrics and visualizes CPU usage

Monitoring
🚨

AlertManager

Routes alerts to the Azure Function

Alerting

Azure Function

Processes alerts and creates pizza orders

Processing
🎮

Pizza Controller

Kubernetes controller that manages PizzaOrder custom resources

Controller
💬

Slack App

Provides a user interface for confirming pizza orders

UI

Documentation 📚

Setup Guide

Step-by-step instructions for deploying the system

Read Guide

Controller

Details on the Pizza Order Controller implementation

View Docs

Slack Integration

How to set up and use the Slack app

Learn More

Helm Charts

Configuration options for Helm deployment

Explore