# harshavarthan-t/ai-kubernetes-incident-triage architecture

> Architecture diagram of the GitHub repository harshavarthan-t/ai-kubernetes-incident-triage, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/harshavarthan-t/ai-kubernetes-incident-triage
- Repository: https://github.com/harshavarthan-t/ai-kubernetes-incident-triage

## Overview

This is a local Kubernetes incident-triage starter, not yet an automated remediation system. Today’s workflow is an Alertmanager-style webhook creating a JSON incident, followed by retrieval by ID and recording an approval or rejection. The README also describes a sample workload, monitoring setup, runbooks, and planned evidence collection, runbook search, model analysis, and approved recovery. Those planned stages are shown as unimplemented; the README says monitoring is not connected to the API, and approval does not execute cluster actions.

Main entry points: [`app/triage-api/triage/main.py`](https://github.com/harshavarthan-t/ai-kubernetes-incident-triage/blob/main/app/triage-api/triage/main.py) (Triage API), [`README.md`](https://github.com/harshavarthan-t/ai-kubernetes-incident-triage/blob/main/README.md) (Monitoring stack), [`runbooks`](https://github.com/harshavarthan-t/ai-kubernetes-incident-triage/tree/main/runbooks) (Troubleshooting runbooks)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Triage API"]
  node_api["Triage API<br/>[main.py]"]
  node_incident_json[("Incident JSON files<br/>[main.py]")]
end

subgraph group_cluster["Cluster Monitoring"]
  node_sample_workload["Sample workload<br/>[deployment.yaml]"]
  node_monitoring["Monitoring stack<br/>[README.md]"]
end

subgraph group_knowledge["Diagnosis and Recovery"]
  node_evidence["Evidence collection"]
  node_runbooks["Troubleshooting runbooks"]
  node_runbook_search["Runbook search"]
  node_model_analysis["Model analysis"]
  node_recovery["Approved recovery"]
end

node_alertmanager["Alertmanager"]
node_operator(("Local operator"))

node_alertmanager -->|"posts alert"| node_api
node_api -->|"writes incident"| node_incident_json
node_operator -->|"retrieves incident"| node_api
node_operator -->|"records approval"| node_api
node_api -->|"loads incident"| node_incident_json
node_monitoring -.->|"forwards alerts"| node_alertmanager
node_evidence -.->|"informs search"| node_runbook_search
node_runbook_search -.->|"searches"| node_runbooks
node_runbook_search -.->|"supplies context"| node_model_analysis
node_model_analysis -.->|"suggests action"| node_recovery
node_operator -.->|"approves action"| node_recovery

click node_api "https://github.com/harshavarthan-t/ai-kubernetes-incident-triage/blob/main/app/triage-api/triage/main.py"
click node_incident_json "https://github.com/harshavarthan-t/ai-kubernetes-incident-triage/blob/main/app/triage-api/triage/main.py"
click node_sample_workload "https://github.com/harshavarthan-t/ai-kubernetes-incident-triage/blob/main/k8s/sample-app/deployment.yaml"
click node_monitoring "https://github.com/harshavarthan-t/ai-kubernetes-incident-triage/blob/main/README.md"
click node_runbooks "https://github.com/harshavarthan-t/ai-kubernetes-incident-triage/tree/main/runbooks"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_api,node_incident_json toneBlue
class node_sample_workload,node_monitoring toneAmber
class node_evidence,node_runbooks,node_runbook_search,node_model_analysis,node_recovery toneMint
class node_alertmanager,node_operator toneIndigo
```

## Components

### Triage API

- [Triage API](https://github.com/harshavarthan-t/ai-kubernetes-incident-triage/blob/main/app/triage-api/triage/main.py): `app/triage-api/triage/main.py`
- [Incident JSON files](https://github.com/harshavarthan-t/ai-kubernetes-incident-triage/blob/main/app/triage-api/triage/main.py): `app/triage-api/triage/main.py`

### Cluster Monitoring

- [Sample workload](https://github.com/harshavarthan-t/ai-kubernetes-incident-triage/blob/main/k8s/sample-app/deployment.yaml): `k8s/sample-app/deployment.yaml`
- [Monitoring stack](https://github.com/harshavarthan-t/ai-kubernetes-incident-triage/blob/main/README.md): `README.md`

### Diagnosis and Recovery

- **Evidence collection**
- [Troubleshooting runbooks](https://github.com/harshavarthan-t/ai-kubernetes-incident-triage/tree/main/runbooks): `runbooks`
- **Runbook search**
- **Model analysis**
- **Approved recovery**

### Other components

- **Alertmanager**
- **Local operator**

## Connections

- Alertmanager → Triage API: posts alert (evidence: `README.md`)
- Triage API → Incident JSON files: writes incident (evidence: `app/triage-api/triage/main.py`)
- Local operator → Triage API: retrieves incident (evidence: `app/triage-api/triage/main.py`)
- Local operator → Triage API: records approval (evidence: `app/triage-api/triage/main.py`)
- Triage API → Incident JSON files: loads incident (evidence: `app/triage-api/triage/main.py`)
- Monitoring stack → Alertmanager: forwards alerts (evidence: `README.md`)
- Evidence collection → Runbook search: informs search
- Runbook search → Troubleshooting runbooks: searches
- Runbook search → Model analysis: supplies context
- Model analysis → Approved recovery: suggests action
- Local operator → Approved recovery: approves action
