Kubernetes · Kubernetes Ingress · Diagram as code
Kubernetes Ingress architecture diagram
Show how an Ingress routes to a Service that targets a Deployment, optionally with a HorizontalPodAutoscaler. ArchLex checks cluster/namespace containment and relationship endpoints.
Ingress to Service to Deployment.
The standard north-south path inside one namespace.
provider k8s
direction LR
cluster production {
namespace app {
edge: ingress["Public ingress"]
svc: service["API service"]
deploy: deployment["API pods"]
edge -[routes]-> svc
svc -[targets]-> deploy
}
}Ingress with autoscaled Deployment.
Add a HorizontalPodAutoscaler that scales the same Deployment.
provider k8s
direction LR
validation normal
cluster production {
namespace api {
edge: ingress["api.example.com"]
svc: service["API"]
deploy: deployment["API pods"]
hpa: horizontalpodautoscaler["Autoscaler"]
edge -[routes]-> svc
svc -[targets]-> deploy
hpa -[scales]-> deploy
}
}Pattern notes for Kubernetes Ingress.
Placement and relationship rules ArchLex enforces for this service.
- Placement. Namespaces belong inside clusters. Ingress, Service, Deployment and HPA belong inside a namespace. Wrong containment returns a Kubernetes diagnostic with a fix.
- Valid connections. ingress -[routes]-> service, service -[targets]-> deployment|pod|statefulset|daemonset, and horizontalpodautoscaler -[scales]-> deployment. Those three edges cover most public API diagrams.
- Bare pods. Prefer Deployment (or another controller) over a bare Pod for long-lived workloads. ArchLex flags common mistakes such as Services without workloads and Ingresses without Service routing.
Ask an agent to draw it.
Install the ArchLex skill or connect the free MCP server, then paste this prompt.
npx skills add baires/archlexDraw a Kubernetes Ingress architecture diagram with an Ingress routing to a Service that targets a Deployment, plus a HorizontalPodAutoscaler. Validate containment and give me a playground link.Prefer MCP? Follow the MCP server guide.
Related Kubernetes examples.
- Kubernetes MicroservicesIngress and Services routing to frontend and API Deployments inside a namespace
- Kubernetes Autoscaled Resilient APIService and Deployment protected by horizontal autoscaling and a disruption budget
- Kubernetes Stateful ApplicationService exposing a StatefulSet backed by a PersistentVolumeClaim and PersistentVolume
- Kubernetes Namespace RBACRoleBinding granting a namespaced Role to an application ServiceAccount
Kubernetes Ingress diagram questions.
How do I diagram Kubernetes Ingress with ArchLex?
Nest ingress, service and deployment inside cluster → namespace scopes. Connect with ingress -[routes]-> service and service -[targets]-> deployment.
Can I include a HorizontalPodAutoscaler?
Yes. horizontalpodautoscaler -[scales]-> deployment is a declared edge. Keep the HPA in the same namespace as the workload.
Does ArchLex read my cluster or manifests?
No. It validates the diagram source. Selectors, TLS secrets and ingress class configuration are not inferred.
Where is the Kubernetes reference?
See the https://docs.archlex.dev/specs/k8s-semantics/ for scopes, resources and relationship rules.
More Kubernetes service diagrams.
Open source · MIT licensed