# madhuakula/kubernetes-goat architecture

> Architecture diagram of the GitHub repository madhuakula/kubernetes-goat, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/madhuakula/kubernetes-goat
- Repository: https://github.com/madhuakula/kubernetes-goat

## Overview

Kubernetes Goat is an intentionally vulnerable Kubernetes training environment. A learner provisions its workloads into a Kubernetes cluster, exposes the home interface locally, then uses the guide and scenarios to practice attacks, security analysis, and defenses. The graph groups scenarios into useful learning domains while retaining the main workload examples. Relationships are limited to the setup and access workflow documented in the README; sampled application code confirms selected workload behavior, but not how every scenario is wired.

Main entry points: [`guide/docs`](https://github.com/madhuakula/kubernetes-goat/tree/master/guide/docs) (Learning Guide), [`setup-kubernetes-goat.sh`](https://github.com/madhuakula/kubernetes-goat/blob/master/setup-kubernetes-goat.sh) (Setup Scripts), [`access-kubernetes-goat.sh`](https://github.com/madhuakula/kubernetes-goat/blob/master/access-kubernetes-goat.sh) (Access Scripts), [`scenarios`](https://github.com/madhuakula/kubernetes-goat/tree/master/scenarios) (Scenario Manifests)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_onboarding["Setup and Access"]
  node_setup["Setup Scripts"]
  node_access["Access Scripts"]
end

subgraph group_learning["Learning Guide"]
  node_guide["Learning Guide"]
end

subgraph group_scenarios["Scenario Exercises"]
  node_manifests["Scenario Manifests"]
  node_sensitive["Sensitive Keys"]
  node_container["Container Exploits"]
  node_ssrf["SSRF and Internal Access"]
  node_benchmarks["Security Benchmarks"]
  node_registry["Registry Attacks"]
  node_rbac["RBAC and Namespaces"]
  node_runtime["Runtime Security"]
  node_policies["Network and Policy"]
end

subgraph group_workloads["Vulnerable Workloads"]
  node_home["Scenario Home"]
  node_health["Ping Application<br/>[main.go]"]
  node_proxy["Internal API<br/>[server.js]"]
  node_metadata["Metadata Service<br/>[main.go]"]
  node_info["Info Application<br/>[app.py]"]
  node_users["Repository Lookup<br/>[app.py]"]
end

node_learner(("Learner"))
node_cluster{{"Kubernetes Cluster"}}
node_external{{"GitHub API"}}

node_learner -->|"runs setup"| node_setup
node_setup -->|"provisions resources"| node_cluster
node_learner -->|"runs access"| node_access
node_access -->|"exposes services"| node_cluster
node_learner -->|"opens interface"| node_home
node_learner -->|"studies"| node_guide
node_guide -->|"explains exercise"| node_sensitive
node_guide -->|"explains exercise"| node_container
node_guide -->|"explains exercise"| node_ssrf
node_guide -->|"explains exercise"| node_benchmarks
node_guide -->|"explains exercise"| node_registry
node_guide -->|"explains exercise"| node_rbac
node_guide -->|"explains exercise"| node_runtime
node_guide -->|"explains exercise"| node_policies
node_setup -->|"applies manifests"| node_manifests
node_manifests -->|"defines workloads"| node_cluster
node_info -.->|"references service"| node_metadata
node_users -->|"requests repositories"| node_external

click node_setup "https://github.com/madhuakula/kubernetes-goat/blob/master/setup-kubernetes-goat.sh"
click node_access "https://github.com/madhuakula/kubernetes-goat/blob/master/access-kubernetes-goat.sh"
click node_guide "https://github.com/madhuakula/kubernetes-goat/tree/master/guide/docs"
click node_home "https://github.com/madhuakula/kubernetes-goat/tree/master/infrastructure/goat-home"
click node_manifests "https://github.com/madhuakula/kubernetes-goat/tree/master/scenarios"
click node_sensitive "https://github.com/madhuakula/kubernetes-goat/tree/master/guide/docs/scenarios/scenario-1"
click node_container "https://github.com/madhuakula/kubernetes-goat/tree/master/guide/docs/scenarios/scenario-2"
click node_ssrf "https://github.com/madhuakula/kubernetes-goat/tree/master/guide/docs/scenarios/scenario-3"
click node_benchmarks "https://github.com/madhuakula/kubernetes-goat/tree/master/guide/docs/scenarios/scenario-5"
click node_registry "https://github.com/madhuakula/kubernetes-goat/tree/master/guide/docs/scenarios/scenario-7"
click node_rbac "https://github.com/madhuakula/kubernetes-goat/tree/master/guide/docs/scenarios/scenario-11"
click node_runtime "https://github.com/madhuakula/kubernetes-goat/tree/master/guide/docs/scenarios/scenario-18"
click node_policies "https://github.com/madhuakula/kubernetes-goat/tree/master/guide/docs/scenarios/scenario-20"
click node_health "https://github.com/madhuakula/kubernetes-goat/blob/master/infrastructure/health-check/main.go"
click node_proxy "https://github.com/madhuakula/kubernetes-goat/blob/master/infrastructure/internal-api/code/server.js"
click node_metadata "https://github.com/madhuakula/kubernetes-goat/blob/master/infrastructure/metadata-db/main.go"
click node_info "https://github.com/madhuakula/kubernetes-goat/blob/master/infrastructure/info-app/app.py"
click node_users "https://github.com/madhuakula/kubernetes-goat/blob/master/infrastructure/users-repo/app.py"

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_setup,node_access toneBlue
class node_guide toneAmber
class node_manifests,node_sensitive,node_container,node_ssrf,node_benchmarks,node_registry,node_rbac,node_runtime,node_policies,node_external toneMint
class node_home,node_health,node_proxy,node_metadata,node_info,node_users toneRose
class node_learner,node_cluster toneIndigo
```

## Components

### Setup and Access

- [Setup Scripts](https://github.com/madhuakula/kubernetes-goat/blob/master/setup-kubernetes-goat.sh): `setup-kubernetes-goat.sh`
- [Access Scripts](https://github.com/madhuakula/kubernetes-goat/blob/master/access-kubernetes-goat.sh): `access-kubernetes-goat.sh`

### Learning Guide

- [Learning Guide](https://github.com/madhuakula/kubernetes-goat/tree/master/guide/docs): `guide/docs`

### Scenario Exercises

- [Scenario Manifests](https://github.com/madhuakula/kubernetes-goat/tree/master/scenarios): `scenarios`
- [Sensitive Keys](https://github.com/madhuakula/kubernetes-goat/tree/master/guide/docs/scenarios/scenario-1): `guide/docs/scenarios/scenario-1`
- [Container Exploits](https://github.com/madhuakula/kubernetes-goat/tree/master/guide/docs/scenarios/scenario-2): `guide/docs/scenarios/scenario-2`
- [SSRF and Internal Access](https://github.com/madhuakula/kubernetes-goat/tree/master/guide/docs/scenarios/scenario-3): `guide/docs/scenarios/scenario-3`
- [Security Benchmarks](https://github.com/madhuakula/kubernetes-goat/tree/master/guide/docs/scenarios/scenario-5): `guide/docs/scenarios/scenario-5`
- [Registry Attacks](https://github.com/madhuakula/kubernetes-goat/tree/master/guide/docs/scenarios/scenario-7): `guide/docs/scenarios/scenario-7`
- [RBAC and Namespaces](https://github.com/madhuakula/kubernetes-goat/tree/master/guide/docs/scenarios/scenario-11): `guide/docs/scenarios/scenario-11`
- [Runtime Security](https://github.com/madhuakula/kubernetes-goat/tree/master/guide/docs/scenarios/scenario-18): `guide/docs/scenarios/scenario-18`
- [Network and Policy](https://github.com/madhuakula/kubernetes-goat/tree/master/guide/docs/scenarios/scenario-20): `guide/docs/scenarios/scenario-20`

### Vulnerable Workloads

- [Scenario Home](https://github.com/madhuakula/kubernetes-goat/tree/master/infrastructure/goat-home): `infrastructure/goat-home`
- [Ping Application](https://github.com/madhuakula/kubernetes-goat/blob/master/infrastructure/health-check/main.go): `infrastructure/health-check/main.go`
- [Internal API](https://github.com/madhuakula/kubernetes-goat/blob/master/infrastructure/internal-api/code/server.js): `infrastructure/internal-api/code/server.js`
- [Metadata Service](https://github.com/madhuakula/kubernetes-goat/blob/master/infrastructure/metadata-db/main.go): `infrastructure/metadata-db/main.go`
- [Info Application](https://github.com/madhuakula/kubernetes-goat/blob/master/infrastructure/info-app/app.py): `infrastructure/info-app/app.py`
- [Repository Lookup](https://github.com/madhuakula/kubernetes-goat/blob/master/infrastructure/users-repo/app.py): `infrastructure/users-repo/app.py`

### Other components

- **Learner**
- **Kubernetes Cluster**
- **GitHub API**

## Connections

- Learner → Setup Scripts: runs setup
- Setup Scripts → Kubernetes Cluster: provisions resources
- Learner → Access Scripts: runs access
- Access Scripts → Kubernetes Cluster: exposes services
- Learner → Scenario Home: opens interface
- Learner → Learning Guide: studies
- Learning Guide → Sensitive Keys: explains exercise
- Learning Guide → Container Exploits: explains exercise
- Learning Guide → SSRF and Internal Access: explains exercise
- Learning Guide → Security Benchmarks: explains exercise
- Learning Guide → Registry Attacks: explains exercise
- Learning Guide → RBAC and Namespaces: explains exercise
- Learning Guide → Runtime Security: explains exercise
- Learning Guide → Network and Policy: explains exercise
- Setup Scripts → Scenario Manifests: applies manifests
- Scenario Manifests → Kubernetes Cluster: defines workloads
- Info Application → Metadata Service: references service
- Repository Lookup → GitHub API: requests repositories
