How a stack fits together
A stack is your application plus every service it needs. Each connection between two parts is a typed link, and each link generates configuration on both sides of it. This page is the map: the layers, the links that join them, and what each one produces.
Read a stack from the middle
Every stack has the same shape, whatever it does:
- The application sits in the middle. It is your own code, built inside the cluster, or an image you already have.
- Who reaches it is on one side: the gateway route, the login, the web application firewall, private access through a VPN.
- What it needs is on the other side: databases, event streams, vector stores, caches, object storage, search, models.
- Around everything sit delivery, observability, security and operations. You do not configure them per application. They are generated from the same links.
Nothing in this picture is configured twice. A link from your application to a database gives the application its connection variables, gives the database its user, opens the network path between the two namespaces, and registers the relationship with the stack agent, which then tests it.
The layers and their links
The link type is always sourceType-targetType, and it is the contract: it decides which files
appear and which values travel. The table lists the link types an application uses most, by
layer. The full vocabulary is in Link types.
| Layer | Components | Links into this layer | What the link generates |
|---|---|---|---|
| Your application | External source code (your repository, built in the cluster) · Image base (an image you already have) · FastAPI (a scaffold) | — | The workload, its env Secret, the in-cluster build, the dev_tools/ kit — see Build and deploy |
| Relational and document data | CloudNativePG · MongoDB · MariaDB · Neo4j · ClickHouse | <app>-db, <app>-mongo_db, <app>-maria_db, <app>-neo4j_db (each to a database sub-component) | Connection variables in the shape your framework expects, the database and its user, the network path |
| Events | Kafka (topics, bridges, node pools) · RabbitMQ (exchanges, queues) · Apicurio | <app>-topic, <app>-exchange, <app>-apicurio_schema_registry | KAFKA_BOOTSTRAP_SERVERS, KAFKA_TOPICS, the security protocol and the TLS file locations; the AMQP connection and RABBITMQ_QUEUES; SCHEMA_REGISTRY_URL |
| Search, vectors, cache, objects | OpenSearch · Qdrant (collections) · Valkey · SeaweedFS (buckets) | <app>-opensearch, <app>-collection, <app>-valkey, <app>-swbucket | OPENSEARCH_URL and its credentials, QDRANT_URL and QDRANT_COLLECTION, the cache connection (REDIS_URL for most frameworks), the S3 endpoint, bucket and access key |
| Models | vLLM (one sub-component per model) · KServe · MLflow · Open WebUI · Langflow · Flowise | <app>-ai_gateway to an AI gateway route, which links ai_gateway-model to a served model | AI_GATEWAY_URL, AI_GATEWAY_MODEL, AI_GATEWAY_API_KEY and its header name; the gateway applies the key, the prompt guard and the token budget |
| Identity | Keycloak (clients, realms, external identity providers) | <app>-client or client-<app> | OIDC_ISSUER_URL, OIDC_DISCOVERY_URL, OIDC_REALM, OIDC_CLIENT_ID, OIDC_CLIENT_SECRET, OIDC_REDIRECT_URIS; the client itself; the login at the gateway when the route asks for it — see Identity and secrets |
| Gateway and access | APISIX (routes, AI gateway) · cert-manager · VPN · CrowdSec WAF profiles | apisix-<app>, vpn-apisix, waf-<app>, apisix-crowdsec | A route on <subdomain>.<domain> with TLS, rate limit, CORS, IP allow-list and login; VPN-only access; a WAF in front — see Gateway, login and private access |
| Delivery | In-cluster builds · Argo CD · Reloader | argo_cd-<type> | One Argo CD Application per linked component, Jobs as sync hooks, restart on a changed Secret — see Build and deploy |
| Observability | Prometheus · Grafana · Loki · Alloy · OpenTelemetry | prometheus-<type>, grafana-prometheus, grafana-loki, alloy-loki, <app>-otel | Scrape configuration, alert rules and dashboards for the linked component; log shipping; trace export |
| Scale | KEDA · Kueue · k6 | keda-prometheus, prometheus_query-<app>, keda-db, keda-topic, keda-queue, keda-model | Autoscalers bound to real signals; load-test suites whose results land in Prometheus — see Lifecycle and scale |
| Security | Generated network policies · OPA · Falco · Suricata · CrowdSec · OpenBao · External Secrets · Trivy · SonarQube · Nuclei · Sigstore | <source>-opensearch, crowdsec-suricata, sonarqube-<app>, nuclei-<app>, external_secrets-openbao | Policies per link, admission constraints, detection feeds, build gates, scans — see Security, layer by layer |
| Operations | Stack agent · MCP server · Velero | fastmcp-stack_agent, fastmcp-<type>, stack_agent-swbucket | Link tests, scans, evidence, backups; the AI tools for each linked technology — see Day 2 and MCP |
<app> stands for the application's component type: external_source_code, image_base or
fastapi. The variable names above are the ones an external_source_code component receives.
For a database, a cache, a bucket, a message broker and MongoDB the names follow the component's
framework_type: a Python application gets DATABASE_URL, REDIS_URL, S3_ENDPOINT_URL,
AMQP_URL and MONGODB_URI; a Spring application gets the SPRING_* properties; Node.js, Rails,
Laravel and the generic set each get their own conventional names.
One link, every side of it
Take the most common link, an application to a PostgreSQL database
(external_source_code-db, drawn to a database sub-component of a CloudNativePG cluster).
| Where | What appears |
|---|---|
| The application | Connection variables in its env Secret, named for its framework |
| The database | The database and its owner, from the sub-component's attributes |
| The network | A policy that lets the application's namespace reach the database namespace on the database port |
| Delivery | When Argo CD manages the database, the grant Job runs as a sync hook |
| Monitoring | With a prometheus-cnpg link, the cluster's metrics, alert rules and dashboards |
| Backups | With a cnpg-swbucket link, the object store and the backup schedule, as link attributes |
| The stack agent | The link appears in link validation: is it rendered, did the credential arrive, is the port reachable, does the database answer with that credential |
Removing the link removes all of it from the repository at the next build. Objects already in the cluster stay until someone deletes them, because an apply never removes what a file no longer lists — see Build and deploy.
Two real stacks, end to end
The two pages that follow walk through stacks the Stacktic team runs, cell by cell. Names are the ones on their diagrams; hosts and credentials are left out.
Two applications, two self-hosted models, an event stream that feeds a database and a nightly job — 22 components, all wired by links.
ExampleA secured marketplaceTwo production applications behind rate limits and a web application firewall, with admission policy, intrusion detection, secrets from a vault and every build gate on.
Read any stack yourself
Every stack repository describes itself. These files are generated on every build:
| File | What it tells you |
|---|---|
stack-metadata.yaml | The graph as data: every component, sub-component, link and attribute. The stack agent and the MCP read this file |
README.md | The architecture, rendered as a diagram |
network-diagram.md | Every network path the links opened, and why |
networkpolicy-manifest.json | The generated policies, and any link the generator could not resolve |
doc/ | One page per component, with what its links generated |
audit/ | A security audit of the design |
An AI client connected to the stack's MCP server reads the same graph with stack_graph, and can
explain any link with knowledge(action='link', link_type=<type>).
Where to go next
Where the generated files go, where your code goes, and how the two meet on every build.
Multi-stackExternal stacksCentral metrics, logs, SIEM and delivery for several stacks, and what crosses a stack boundary.
SecuritySecurity, layer by layerEvery control, the declaration it comes from, and the scan that proves it.