direction: down

title: "Discovery Plane" {
  style.font-size: 36
  shape: text
  near: top-center
}

components: "Components" {
  style.font-size: 32
  direction: right

  frontend: Frontend {
    style.font-size: 24
    shape: rectangle
  }
  router: Router {
    style.font-size: 24
    shape: rectangle
  }
  planner: Planner {
    style.font-size: 24
    shape: rectangle
  }
}

discovery: "Discovery Layer" {
  style.font-size: 32
  direction: right

  k8s: "Kubernetes Backend" {
    style.font-size: 28

    crds: "DynamoWorkerMetadata\nCRDs" {
      style.font-size: 22
      shape: rectangle
    }
    eps: "EndpointSlices" {
      style.font-size: 22
      shape: rectangle
    }
    api: "K8s API Watch" {
      style.font-size: 22
      shape: rectangle
    }
  }

  etcd_backend: "etcd Backend (default)" {
    style.font-size: 28

    store: "etcd" {
      style.font-size: 22
      shape: cylinder
    }
    keys: "Key hierarchy\n/services/{ns}/{comp}/{ep}" {
      style.font-size: 22
      shape: text
    }
    lease: "Lease-based cleanup\nTTL: 10s" {
      style.font-size: 22
      shape: text
    }
  }
}

workers: "Workers" {
  style.font-size: 32
  direction: right

  w1: "Worker 1" {
    style.font-size: 24
    shape: rectangle
  }
  w2: "Worker 2" {
    style.font-size: 24
    shape: rectangle
  }
  w3: "Worker N" {
    style.font-size: 24
    shape: rectangle
  }
}

components -> discovery: "discover" {
  style.font-size: 22
}
workers -> discovery: "register" {
  style.font-size: 22
}
