Kubernetes Cluster — Reladraw template

K8s 集群拓扑. Copy the source, paste into the official playground, done. No coordinates — every position is stated relative to something else.

Preview

kubectl kube-apiserver Ingress CoreDNS pod pod Service api

Source (.reladraw)

node kubectl "kubectl"
node api "kube-apiserver"  below kubectl
node ingress "Ingress"  below api  level with coredns
node coredns "CoreDNS"  right of ingress
node pod1 "pod"  below-left of ingress
node pod2 "pod"  below-right of ingress
node svc "Service"  below pod2
edge kubectl -> api "api"
edge api -> ingress
edge ingress -> svc
edge svc -> pod1
edge svc -> pod2

How to use

  1. Open the Reladraw playground
  2. Paste the source above — the diagram re-solves live
  3. Export SVG from the playground, or render locally: npx reladraw kubernetes-cluster.reladraw -o out.svg

When to use this template

Use this when explaining your cluster to someone who does not live in it: new teammates, a security reviewer, or a runbook. It shows the control-plane path (kubectl → apiserver) and how Ingress routes traffic down to pods through a Service.

It also works as the “before” picture in an incident post-mortem.

How to customize

  1. Split namespaces. Give pod nodes namespaced ids: node app.pod1 "pod" — compound ids render as grouped containers.
  2. Add an ingress controller detail. Insert node nginx "nginx-ingress" below ingress and rewire edge ingress -> nginx, edge nginx -> svc.
  3. Show external traffic. Add node user "End user" above kubectl and edge user -> ingress "https" from: top.

FAQ

How do I diagram a Kubernetes cluster?

Model each component — apiserver, Ingress, Services, pods — as a node, then place them along the request path: what a request hits first goes on top. This template follows that convention and renders in one paste.

How do I show pods in different namespaces?

Use dotted node ids like app.web and infra.jobs. Reladraw treats the prefix as a container, so each namespace becomes a visual box without extra syntax.

Can Reladraw show scaling, like 6 replicas?

Draw two or three pod nodes to suggest a replica set and label them pod-1, pod-2 — or one node labeled “pods ×6”. Explicit layout works best when the count is part of the label, not the topology.

About this page

Maintained by the Reladraw Templates gallery — an independent, free community resource. Sources are verified against the official Reladraw repository before publishing. Found an issue? Report it and it gets fixed.

GitOps variant

The cluster seen from the delivery side: a developer push lands in a GitOps repo, Argo CD syncs it through kube-apiserver into two namespaces.

Developer GitOps Repo Argo CD kube-apiserver ns: frontend ns: backend deploy deploy push sync apply
node dev "Developer"
node git "GitOps Repo"  below dev
node argo "Argo CD"  below git
node api "kube-apiserver"  below argo
node ns1 "ns: frontend"  below-left of api
node ns2 "ns: backend"  below-right of api
node f1 "deploy"  below ns1
node b1 "deploy"  below ns2
edge dev -> git  "push"
edge git -> argo  "sync"
edge argo -> api  "apply"
edge api -> f1
edge api -> b1

Reladraw vs Mermaid for Kubernetes diagrams

Mermaid renders a K8s topology fast, but it auto-assigns positions — a five-node cluster usually comes out legible, a twelve-node one comes out crossed. Here every placement is stated: ns: frontend sits below-left of kube-apiserver because you said so, and it stays there when you add a third namespace. Use Mermaid for quick inline sketches; use this template when the cluster layout itself carries meaning you need to keep stable across revisions.

Related templates

Network TopologyCI/CD PipelineUser Onboarding Flow