KubeDiagrams
Generate Kubernetes architecture diagrams from Kubernetes manifest files, kustomization files, Helm charts, and actual cluster state.
There are several tools to generate Kubernetes architecture diagrams (see here). The main originality of KubeDiagrams is its configurability allowing for instance to deal with custom Kubernetes resources.
Examples
Architecture diagram for official Kubernetes WordPress tutorial manifests:

Architecture diagram for official Kubernetes ZooKeeper tutorial manifests:

Architecture diagram of a deployed Cassandra instance:

Architecture diagram for Train Ticket:A Benchmark Microservice System:

Architecture diagram of the Minikube Ingress Addon:

Architecture diagram for the Kube Prometheus Stack chart:

Architecture diagram for free5gc-k8s manifests:

Architecture diagram for open5gs-k8s manifests:

Architecture diagram for the Towards5GS-helm chart:

Architecture diagram for a deployed CronJob instance:

Architecture diagram for NetworkPolicy resources: 
Many other architecture diagrams are available into examples/.
All the examples are
- official Kubernetes WordPress tutorial
- official Kubernetes ZooKeeper tutorial
- official Kubernetes Cassandra tutorial
- Train Ticket
- minikube architecture diagrams
- k0s architecture diagrams
- Kube Prometheus Stack
- free5gc-k8s
- open5gs-k8s
- Towards5GS-helm
- OpenAirInterface 5G Core Network
- docker-open5gs
- Miscellaneous examples
- Some Helm charts
- LeaderWorkerSet API
Prerequisites
Following software must be installed:
Getting Started
Following command installs KubeDiagrams and all its Python dependencies, i.e., PyYAML and Diagrams.
# using pip (pip3)
pip install KubeDiagrams
Usage
KubeDiagrams provides two commands: kube-diagrams and helm-diagrams.
kube-diagrams
kube-diagrams generates a Kubernetes architecture diagram from one or several Kubernetes manifest files.
kube-diagrams -h
usage: kube-diagrams [-h] [-o OUTPUT] [-f FORMAT] [-c CONFIG] [-v] [--without-namespace] filename [filename ...]
Generate Kubernetes architecture diagrams from Kubernetes manifest files
positional arguments:
filename the Kubernetes manifest filename to process
options:
-h, --help show this help message and exit
-o OUTPUT, --output OUTPUT
output diagram filename
-f FORMAT, --format FORMAT
output format, allowed formats are png (default), jpg, svg, pdf, and dot
-c CONFIG, --config CONFIG
custom kube-diagrams configuration file
-v, --verbose verbosity, set to false by default
--without-namespace disable namespace cluster generation
Examples:
# generate a diagram from a manifest
kube-diagrams -o cassandra.png examples/cassandra/cassandra.yml
# generate a diagram from a kustomize folder
kubectl kustomize path_to_a_kustomize_folder | kube-diagrams - -o diagram.png
# generate a diagram from the actual default namespace state
kubectl get all -o yaml | kube-diagrams -o default-namespace.png -
# generate a diagram of all workload and service resources from all namespaces
kubectl get all --all-namespaces -o yaml | kube-diagrams -o all-namespaces.png -
helm-diagrams
helm-diagrams generates a Kubernetes architecture diagram from an Helm chart.
helm-diagrams takes only one argument - the URL of the Helm chart - but requires that the helm command was installed.
Examples:
# generate a diagram for the Helm chart 'cert-manager' available in HTTP repository 'charts.jetstack.io'
helm-diagrams https://charts.jetstack.io/cert-manager
# generate a diagram for the Helm chart 'argo-cd' available in OCI repository 'ghcr.io'
helm-diagrams oci://ghcr.io/argoproj/argo-helm/argo-cd
# generate a diagram for the Helm chart 'some-chart' available locally
helm-diagrams some-path/some-chart
With Docker/Podman
KubeDiagrams images are available in Docker Hub.
# For usage with Podman, replace 'docker' by 'podman' in the following lines.
# generate a diagram from a manifest
docker run -v "$(pwd)":/work philippemerle/kubediagrams kube-diagrams -o cassandra.png examples/cassandra/cassandra.yml
# generate a diagram from a kustomize folder
kubectl kustomize path_to_a_kustomize_folder | docker run -v "$(pwd)":/work -i philippemerle/kubediagrams kube-diagrams - -o diagram.png
# generate a diagram from the actual default namespace state
kubectl get all -o yaml | docker run -v "$(pwd)":/work -i philippemerle/kubediagrams kube-diagrams -o default-namespace.png -
# generate a diagram of all workload and service resources from all namespaces
kubectl get all --all-namespaces -o yaml | docker run -v "$(pwd)":/work -i philippemerle/kubediagrams kube-diagrams -o all-namespaces.png -
# generate a diagram for the Helm chart 'cert-manager' available in HTTP repository 'charts.jetstack.io'
docker run -v "$(pwd)":/work philippemerle/kubediagrams helm-diagrams https://charts.jetstack.io/cert-manager
# generate a diagram for the Helm chart 'argo-cd' available in OCI repository 'ghcr.io'
docker run -v "$(pwd)":/work philippemerle/kubediagrams helm-diagrams oci://ghcr.io/argoproj/argo-helm/argo-cd
Features
Kubernetes resources
KubeDiagrams supported the following 47 Kubernetes resource types:
Note: The mapping between these supported Kubernetes resources and architecture diagrams is defined into bin/kube-diagrams.yml.
Note: The mapping for any Kubernetes custom resources can be also defined into KubeDiagrams configuration files as illustrated in examples/k0s/KubeDiagrams.yml, examples/kube-prometheus-stack/KubeDiagrams.yml, and examples/lws/KubeDiagrams.yml.
Currently, there are 15 unsupported Kubernetes resource types:
| Kind | ApiGroup |
|---|---|
Binding |
|
ComponentStatus |
|
Event |
|
ControllerRevision |
apps |
TokenReview |
authentication.k8s.io |
LocalSubjectAccessReview |
authorization.k8s.io |
SelfSubjectAccessReview |
authorization.k8s.io |
SelfSubjectRulesReview |
authorization.k8s.io |
SubjectAccessReview |
authorization.k8s.io |
CertificateSigningRequest |
certificates.k8s.io |
Event |
events.k8s.io |
FlowSchema |
flowcontrol.apiserver.k8s.io |
PriorityLevelConfiguration |
flowcontrol.apiserver.k8s.io |
NodeMetrics |
metrics.k8s.io |
PodMetrics |
metrics.k8s.io |
Kubernetes resources clustering
With KubeDiagrams, Kubernetes resources can be clustered within the architecture diagrams automatically. KubeDiagrams uses the metadata.namespace resource field as first clustering criteria. Then, the metadata.labels keys can be used to define subclusters. Following table lists the predefined mappings between label keys and cluster titles as defined in the bin/kube-diagrams.yml file (see the clusters list).
| Label | Cluster Title |
|---|---|
app.kubernetes.io/instance |
K8s Instance |
release |
Release |
helm.sh/chart |
Helm Chart |
chart |
Chart |
app.kubernetes.io/name |
K8s Application |
app |
Application |
app.kubernetes.io/component |
K8s Component |
service |
Microservice |
tier |
Tier |
New mappings can be easily defined in custom configuration files (see examples/minikube/KubeDiagrams.yml, examples/k0s/KubeDiagrams.yml, examples/free5gc-k8s/KubeDiagrams.yml, examples/open5gs-k8s/KubeDiagrams.yml, examples/towards5gs-helm/KubeDiagrams.yml, and examples/lws/KubeDiagrams.yml)
and provided to KubeDiagrams via the --config command-line option.
Kubernetes resource relationships
With KubeDiagrams, each relationship between Kubernetes resources is represented by a visual edge between visual nodes.
Following table lists the predefined edges as defined in the bin/kube-diagrams.yml file (see the edges map).
| Edge Kind | Edge Style | Edge Color | Meaning |
|---|---|---|---|
REFERENCE |
solid |
black |
Used when a resource refers to another resource directly |
SELECTOR |
dashed |
black |
Used when a resource refers to other resources via a selector |
OWNER |
dotted |
black |
Used when a resource owns another resource |
COMMUNICATION |
solid |
brown |
Used to represent ingress and egress networking policies between pods |
New edges can be easily defined or redefined in custom configuration files, and provided to KubeDiagrams via the --config command-line option.
Following diagram illustrates all the visual nodes, edges, and clusters supported by default by KubeDiagrams.
Custom diagrams
By default, KubeDiagrams generates diagrams from data contained into Kubernetes manifest files, actual cluster state, kustomization files, or Helm charts automatically. But sometimes, users would like to customize generated diagrams by adding their own clusters, nodes and edges as illustrated in the following diagram:
This previous diagram contains three custom clusters labelled with Amazon Web Service, Account: Philippe Merle and My Elastic Kubernetes Cluster, three custom nodes labelled with Users, Elastic Kubernetes Services, and Philippe Merle, and two custom edges labelled with use and calls. The rest of this custom diagram is generated from actual cluster state for a deployed WordPress application automatically.
See examples/wordpress/custom_diagram.kd to define custom diagrams, clusters, nodes and edges declaratively.
GitHub Action
You can use Kube Diagrams (and Helm Diagrams) in your GitHub Action workflows.
name: "Your GitHub Action Name"
on:
workflow_dispatch: # add your specific triggers (https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows)
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: "Generate diagram from Helm chart"
uses: philippemerle/KubeDiagrams@main
with:
type: "helm"
args: 'https://charts.jetstack.io/cert-manager'
Architecture
Following figure shows the software architecture of KubeDiagrams.
What do they say about it?
Talks
- Visualizing cloud-native applications with KubeDiagrams, Philippe Merle, PEPR Cloud Taranis Project, February 17, 2025.
Blogs
-
KubeDiagrams, CSDN, April 10, 2025.
-
Generate Kubernetes Architecture Maps Directly from Your Cluster, Abhimanyu Saharan, March 29, 2025.
-
KubeDiagrams 0.2.0 Makes It Way Easier to Visualize Your Kubernetes Setup, Mr.PlanB, Medium, March 27, 2025.
-
Visualising SQL Server in Kubernetes, Andrew Pruski, February 6, 2025.
Social Networks
-
JReuben1's post on X, April 19, 2025.
-
Custom declarative diagrams with KubeDiagrams on Reddit, April 17, 2025.
-
DevOps Radar on LinkedIn, April 1, 2025.
-
Michael Cade's post on X, March 29, 2025.
-
Paco Xu's post on X, March 26, 2025.
-
KubeDiagrams 0.2.0 is out! on Reddit, March 25, 2025.
-
KubeDiagrams: Revolutionizing Cloud Cluster Management! on LinkedIn, March 18, 2025.
-
Anyone know of any repos/open source tools that can create k8 diagrams? on Reddit, March 13, 2025.
-
Automation of diagram creation for Kubernetes, DevSecOps, February/March 2025.
-
Facebook Kubernetes Users Group, February 6, 2025.
-
KubeDiagrams on Reddit, February 4, 2025.
Referencing
-
Tool of the day, TechOps Examples, February 11, 2025.
Star History
License
This project is licensed under the GPL-3.0 license - see the LICENSE file for details.




