Skip to content

feat(k8s): the runner pod reads Qdrant with a scoped key #3823

Closed

Description

@dan-petty

Problem

The runner pod cannot reach Qdrant. k8s/devops/networkpolicy.yaml admits egress only to DNS, the llm namespace on ports 4000 and 6379, the OTLP collector and public HTTPS. devops ai rag-query embeds the query through the gateway and then searches Qdrant, a separate service with its own URL and API key (qdrant.url, qdrant.api_key). The implement agent therefore cannot use the RAG index (#3563, item B).

Expected

The runner pod can reach the Qdrant search path and no other Qdrant path. It uses a read-only key that is scoped to search. The key is a cluster Secret that a person creates and pushes.

Acceptance criteria

  • A test over k8s/devops/networkpolicy.yaml: the runner pod has egress to Qdrant on its port, to nothing else new.
  • A test: the manifest adds no write or delete path for the runner.
  • The change names the Secret that holds the read key and says that a person creates it (SECURITY.md); the change makes no Secret.
  • k8s/README.md names the new route.

Existing tool considered

Qdrant read-only API keys and the Kubernetes NetworkPolicy API cover the need. No new tool.

Related

Split from #3563. Related: #3041, item A (the loopback broker) of the same split.

Proposed design

Problem statement

The runner pod cannot reach Qdrant. The policy k8s/devops/networkpolicy.yaml admits egress to the llm namespace on ports 4000 and 6379 only, and Qdrant answers on 6333. So the implement agent cannot use the RAG index (#3563, item B). The change admits the Qdrant search path on TCP 6333 with a read-only key. It adds no write or delete path, and a person pushes the key.

Acceptance criteria

Requirement: Egress to Qdrant on TCP 6333

The devops perimeter MUST admit egress from the pods of namespace devops to namespace llm on TCP 6333.

Scenario: The policy admits the Qdrant port

  • WHEN A test reads k8s/devops/networkpolicy.yaml.
  • THEN It finds one egress rule whose peer is the namespace selector of llm and whose only port is TCP 6333.

Requirement: No other new egress

The change MUST add no egress peer, port or protocol to the devops perimeter other than TCP 6333 to namespace llm.

Scenario: The admitted set stays the same

  • WHEN A test reads the policy and collects each peer and each port of every egress rule.
  • THEN The set equals DNS on 53, namespace llm on 4000, 6379 and 6333, namespace otel on 4318, and public HTTPS on 443.

Requirement: Qdrant admits the devops namespace

The policy that selects the Qdrant pod MUST admit ingress from namespace devops on TCP 6333.

Scenario: The Qdrant pod admits the runner

  • WHEN A test reads the policy that selects the Qdrant pod.
  • THEN It finds an ingress rule whose peer is namespace devops and whose port is TCP 6333.

Requirement: Qdrant reads a read-only key

The Qdrant container MUST read its read-only key from key read-only-api-key of Secret llm/qdrant-api-key.

Scenario: The read-only key comes from the Secret

  • WHEN A test reads llm/values-qdrant.yaml.
  • THEN The environment sets QDRANT__SERVICE__READ_ONLY_API_KEY from a secretKeyRef to that key, and it holds no literal value.

Requirement: One keyring value feeds both Secrets

The push MUST write one keyring value, qdrant_read_only_api_key, to key read-only-api-key of Secret llm/qdrant-api-key and to DEVOPS_CLI_QDRANT_API_KEY of Secret devops/devops-cli.

Scenario: The table holds two rows from one keyring value

  • WHEN A test reads the rows of src/devops_cli/k8s/cluster_secrets.py.
  • THEN The row of llm/qdrant-api-key key read-only-api-key and the row of devops/devops-cli key DEVOPS_CLI_QDRANT_API_KEY both name keyring qdrant_read_only_api_key.

Requirement: The pod config names the Qdrant Service

The example ConfigMap MUST name qdrant.url as the Qdrant Service of namespace llm on TCP 6333, and it MUST hold no key value.

Scenario: The template names the in-cluster URL

  • WHEN A test reads k8s/devops/configmap.example.yaml.
  • THEN qdrant.url is http://qdrant.llm.svc.cluster.local:6333, and the qdrant section holds no api_key value.

Requirement: The runner holds no write path

The runner pod MUST get its Qdrant key from the read-only key, and no row of Secret devops/devops-cli MUST name the admin key api-key.

Scenario: The runner template reads the read-only key

  • WHEN A test reads k8s/devops/cronjob-runner.yaml and the rows of Secret devops/devops-cli.
  • THEN DEVOPS_CLI_QDRANT_API_KEY comes from keyring qdrant_read_only_api_key, and no row of devops/devops-cli names keyring qdrant_api_key.

Requirement: The README names the new route

k8s/README.md MUST name the Qdrant route of the devops namespace on TCP 6333.

Scenario: The README lists the route

  • WHEN A test reads the section of k8s/README.md on devops-cli in the cluster.
  • THEN It names Qdrant on TCP 6333 beside the gateway, the cache and the collector.

Requirement: The documentation names the key and the person step

The documentation MUST name the read-only key and the command that a person runs to push it.

Scenario: The Cluster Secrets table holds the rows

  • WHEN A test reads the Cluster Secrets section of k8s/README.md and rule 1 of SECURITY.md.
  • THEN The section lists key read-only-api-key of llm/qdrant-api-key and DEVOPS_CLI_QDRANT_API_KEY of devops/devops-cli from keyring qdrant_read_only_api_key, with devops k8s push-secrets as the person step, and rule 1 names the read-only Qdrant key of the runner.

Existing Tool Considered

No alternatives check has run. The change builds no code, so there is no build cost. The Kubernetes NetworkPolicy API and the Qdrant read-only API key cover the need. The read-only key lacks a per-collection scope: it permits every read of the instance. A JWT RBAC token scopes to a collection, and it adds the setting jwt_rbac and a token that a person mints.

Key questions

  • Which pod does devops-default-perimeter select, and does the runner pod carry its label?: The policy selects every pod of namespace devops whose app.kubernetes.io/name is not crawl4ai. The admission policy gives each runner Job the pod label app.kubernetes.io/name: devops-cli-job, so the policy selects it. [sources: k8s/devops/networkpolicy.yaml, k8s/devops/roadmap-service/admissionpolicy.yaml]
  • Does Qdrant need a key on the search path?: Yes. Qdrant requires the key of llm/qdrant-api-key on every REST and gRPC request. Only /, /healthz, /readyz, /livez and the files of its web UI need no key. [sources: k8s/README.md]
  • Which key does the runner pod use for Qdrant?: The read-only key of Qdrant. Secret llm/qdrant-api-key gains key read-only-api-key, and the Qdrant container reads it as QDRANT__SERVICE__READ_ONLY_API_KEY. The same keyring value, qdrant_read_only_api_key, feeds DEVOPS_CLI_QDRANT_API_KEY of Secret devops/devops-cli. (best practice) [sources: SECURITY.md, k8s/README.md, k8s/devops/roadmap-service/admissionpolicy.yaml]
    • Chosen: One keyring value in both Secrets, as the read-only key. It permits search and read, and it refuses write and delete. One keyring value feeds both Secrets, as crawl4ai_api_token does, so the two values cannot differ.
    • Rejected: A JWT RBAC token scoped to one collection. It needs the setting jwt_rbac and a token that a person mints. A collection name in the token breaks when the RAG collections change.
    • Rejected: The admin key api-key. It grants write and delete, so the runner would hold the path that the issue forbids.
    • Rejected: A new Secret devops/qdrant-read-only-key. The admission policy admits only Secret devops-cli in envFrom. A new Secret needs a policy change and a second inventory row for one value.
  • How does the policy write the new egress rule?: As a separate egress rule. Its peer is the namespace selector of llm, and its only port is TCP 6333. It carries a comment that names Qdrant and the search path. (best practice) [sources: k8s/devops/networkpolicy.yaml, k8s/README.md]
    • Chosen: A separate rule with a comment. It keeps the comment of the gateway rule true, and the review of the policy shows why 6333 exists.
    • Rejected: Port 6333 in the port list of the gateway rule. The comment of that rule names the gateway and the cache only, so the rule would then state what it does not do.
    • Rejected: A peer that selects the Qdrant pod by label, with ports. The comment of the policy records that kube-router refused a namespace and pod selector peer paired with ports:.
    • Rejected: An ipBlock for the Qdrant address. A pod address changes, and kube-router matches an ingress ipBlock against pod addresses.
  • Which policy admits the devops namespace to the Qdrant pod?: The policy that selects the Qdrant pod, llm-default-perimeter, gains an ingress rule for namespace devops on TCP 6333. It admits no other new peer. (best practice) [sources: k8s/devops/networkpolicy.yaml, k8s/README.md]
    • Chosen: An ingress rule in llm-default-perimeter. It already selects the Qdrant pod. The devops policy assumes that each target in llm admits only the pods that it serves.
    • Rejected: A dedicated Qdrant policy. A second policy is additive: the pod still takes llm-default-perimeter, so two files would hold the peer list.
    • Rejected: Keep the ingress as it is. No source shows that the current ingress admits namespace devops on 6333. A refused ingress leaves the new egress rule with no effect.
  • Which URL does the in-cluster config use for Qdrant?: http://qdrant.llm.svc.cluster.local:6333, the ClusterIP Service of namespace llm. (best practice) [sources: k8s/README.md, k8s/devops/configmap.example.yaml]
    • Chosen: The Service name of namespace llm. It stays in the cluster, and the policy admits namespace llm on TCP 6333. It matches the shape of the gateway URL.
    • Rejected: The Ingress host https://qdrant.<domain>. It leaves the cluster through Cloudflare Access and needs a public host. A pod holds no Access token.
    • Rejected: A port-forward to loopback. No person runs in a pod, and the policy admits no loopback peer.
  • Which file records the read-only key and the person step?: The Cluster Secrets table of k8s/README.md holds the rows. Rule 1 of SECURITY.md gains one sentence: the runner pod reads Qdrant with a read-only key from Secret devops/devops-cli. (best practice) [sources: k8s/README.md, SECURITY.md, src/devops_cli/k8s/cluster_secrets.py]
    • Chosen: The rows in k8s/README.md, and one sentence in rule 1 of SECURITY.md. One table lists every Secret that a manifest references, and a test fails on a reference without a row. The sentence gives the runner its rule.
    • Rejected: A full list of the key in SECURITY.md. It repeats the table, and no test reads it. The two lists would drift.
    • Rejected: The table only. The issue asks that the security policy names the read key of the runner.
  • Does the new route also serve the roadmap Service pod?: Yes. devops-default-perimeter selects every pod of namespace devops, so the Service pod also gets TCP 6333 to llm. It holds the same read-only key through envFrom, so the change adds no write path. (best practice) [sources: k8s/devops/networkpolicy.yaml, k8s/devops/roadmap-service/deployment.yaml, k8s/README.md]
    • Chosen: One rule for the namespace. It adds one rule. The Service pod reads the same read-only key from Secret devops-cli through envFrom.
    • Rejected: A rule that selects only the runner label. kube-router refused a namespace and pod selector peer paired with ports:, and a second policy would repeat the peer list.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Alternatives check of 2026-11-08: in-use.
The item already names this tool.
Tool: qdrant/qdrant (https://github.com/qdrant/qdrant), Apache-2.0, last activity 2026-11-08, maintained.

Activity

  1. added
    source/agent
    type/feature
    scope/k8s
    status/new
    value/medium
    effort/low
    on Nov 6, 2026
  2. dan-petty commented on Nov 6, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/feature. The feat prefix of the title gives the type.
    • Scope: scope/k8s. The (k8s) scope of the title gives the scope.
    • Priority: P2-Medium. It unblocks the implement agent RAG path but is not a production outage or security incident.
    • Value: Medium. It lets the implement agent use the RAG index, which improves agent output quality.
    • Effort: Low. The change is a network policy rule, a Secret reference, and two small tests.
    • Related: feat(k8s): Keep the RAG index current on poll and push #3589, which asks for a different change. Both enable Qdrant access for a cluster workload, but #3589 is the indexer lane and the candidate is the runner pod.
  3. added
    priority/p2-medium
    on Nov 6, 2026
  4. added
    status/ready
    and removed
    status/new
    on Nov 7, 2026
  5. devops-cli-service commented on Nov 7, 2026

    @devops-cli-service
    Contributor

    Status set to Ready at eb7a1a4 (see proposed design in issue body).

  6. devops-cli-service commented on Nov 8, 2026

    @devops-cli-service
    Contributor

    Alternatives check: in-use

    Reason: The searches surfaced no dedicated open tool for Qdrant egress; they confirm Qdrant itself is an open, maintained project (Apache-2.0, actively pushed, not archived). Qdrant's read-only API key covers the "read-only key" part of the need (read/search only, no write or delete), but it supplies neither the cluster egress rule nor a per-collection scope, so one tool covers only part of what the issue asks for.

    The item already names this tool.

    Tool: qdrant/qdrant (https://github.com/qdrant/qdrant)

    • License: Apache-2.0
    • Last activity: 2026-11-08
    • Maintained: yes

    Covers:

    • Qdrant's read-only API key restricts a client to read/search operations and refuses write and delete.
    • Qdrant is an open-source, maintained vector database (Apache-2.0).

    Lacks:

    • No Kubernetes egress control; admitting the devops namespace to Qdrant on TCP 6333 is a separate NetworkPolicy.
    • The read-only key is instance-wide, not scoped to one collection or to the search endpoint only.
    • Creating and pushing the Secret, and wiring the env vars, remains manual project work.

    Tools considered:

    Searches run:

    • Qdrant read-only API key, results: 5
    • Kubernetes NetworkPolicy egress allow Qdrant namespace port 6333, results: 5
    • Qdrant QDRANT__SERVICE__READ_ONLY_API_KEY documentation security, results: 5
    • Qdrant JWT RBAC scoped to collection read-only token, results: 5
    • qdrant vector database api key authentication documentation, results: 5
    • qdrant.tech security api key read-only, results: 5
    • Qdrant service read only api key environment variable docker, results: 5

    Sources:

    Checked on 2026-11-08. A person decides what this means for the item. The check changes no label and closes no issue.

  7. added
    status/in-progress
    and removed
    status/ready
    on Nov 14, 2026
  8. added
    status/in-review
    and removed
    status/in-progress
    on Nov 14, 2026
  9. removed
    status/in-review
    on Nov 14, 2026
  10. devops-cli-service commented on Nov 14, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-14 21:08 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/lowpriority/p2-mediumscope/k8ssource/agenttype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions