{
  "$schema": "../../../skill/references/schemap.schema.json",
  "kind": "architecture",
  "title": "Kubernetes cluster",
  "subtitle": "Ingress to pods, with managed data outside",
  "groups": [
    { "id": "cluster", "label": "EKS cluster" },
    { "id": "ns-app", "label": "namespace: app", "parent": "cluster" },
    { "id": "ns-sys", "label": "namespace: kube-system", "parent": "cluster" },
    { "id": "aws", "label": "AWS managed" }
  ],
  "nodes": [
    { "id": "users", "type": "client", "card": { "title": "Users" } },
    {
      "id": "alb",
      "type": "gateway",
      "group": "cluster",
      "card": { "title": "Ingress", "subtitle": "AWS ALB controller" }
    },
    {
      "id": "web",
      "type": "service",
      "group": "ns-app",
      "card": {
        "title": "web",
        "subtitle": "Deployment",
        "stats": [{ "value": "3–12", "label": "pods" }, { "value": "70%", "label": "CPU target" }]
      }
    },
    {
      "id": "api",
      "type": "service",
      "group": "ns-app",
      "card": { "title": "api", "subtitle": "Deployment", "stats": [{ "value": "4–20", "label": "pods" }] }
    },
    {
      "id": "jobs",
      "type": "service",
      "group": "ns-app",
      "card": { "title": "jobs", "subtitle": "CronJob", "tag": "nightly" }
    },
    { "id": "dns", "type": "service", "group": "ns-sys", "card": { "title": "CoreDNS" } },
    {
      "id": "secrets",
      "type": "security",
      "group": "ns-sys",
      "card": { "title": "External Secrets", "subtitle": "from Secrets Manager" }
    },
    { "id": "rds", "type": "database", "group": "aws", "card": { "title": "RDS", "subtitle": "PostgreSQL, Multi-AZ" } },
    { "id": "redis", "type": "cache", "group": "aws", "card": { "title": "ElastiCache", "subtitle": "Redis" } },
    { "id": "s3", "type": "storage", "group": "aws", "card": { "title": "S3", "subtitle": "uploads" } }
  ],
  "edges": [
    { "id": "e1", "from": "users", "to": "alb", "label": "HTTPS", "tone": "main" },
    { "id": "e2", "from": "alb", "to": "web", "tone": "main" },
    { "id": "e3", "from": "web", "to": "api", "tone": "main" },
    { "id": "e4", "from": "api", "to": "rds", "tone": "main" },
    { "id": "e5", "from": "api", "to": "redis" },
    { "id": "e6", "from": "api", "to": "s3", "label": "presigned URLs" },
    { "id": "e7", "from": "jobs", "to": "rds" },
    { "id": "e8", "from": "secrets", "to": "api", "label": "env", "tone": "security" },
    { "id": "e9", "from": "api", "to": "dns", "kind": "async", "label": "lookups" }
  ]
}
