Skip to content

fix(k8s): admit only the gateway to the Ollama pods #3583

Open

Description

@devops-cli-service

Update 2026-11-26 (infra move): the NetworkPolicy and Ingress parts go to dan-petty/homelab.

This issue keeps one part: move ollama.endpoint in .devcontainer/devcontainer.json off the Service ollama-48gib and onto the gateway. Merge it before the homelab change, else the devcontainer loses its path. The policy and ollama-ingress are in homelab. The cited network policy test is gone.

Follow-up: dan-petty/homelab#268.


Split from #3574.

Problem The NetworkPolicy llm-default-perimeter admits every pod of the llm namespace, the monitoring namespace and Traefik to the Ollama pods. The ingress ollama-ingress exposes ollama-fast outside the cluster. Thus any client can name another model to the 48 GiB tier, and Ollama unloads qwen3.8:27b (#3567). ## Why this part is deferred #3574 says to decide with the owner whether the Ollama pods admit the gateway alone. A person must accept the loss of direct access from a workstation, the devcontainer and the benchmark tests. The rest of #3574 does not wait on this decision. ## Acceptance criteria - The owner records the decision in a comment: the gateway alone, or a named set of clients. - The NetworkPolicy llm-default-perimeter SHALL admit only the decided clients to the Ollama pods on port 11434. - A test MUST fail when the NetworkPolicy admits a client that the decision does not name. - Scenario: a pod of the monitoring namespace connects to an Ollama pod on port 11434. Then the connection is refused. - Scenario: the gateway connects to an Ollama pod on port 11434. Then the connection is admitted. - The ingress ollama-ingress MUST expose only the routes that the decision names.

Proposed design

Problem statement

The devcontainer points ollama.endpoint at the ollama-48gib Service. The homelab change admits only the gateway to the Ollama pods. Move the setting to the gateway before that change merges. Otherwise the devcontainer loses its path. The NetworkPolicy and ingress changes are in dan-petty/homelab#268 and are out of scope.

Acceptance criteria

Requirement: The devcontainer endpoint leaves the 48 GiB Service

The ollama.endpoint setting in .devcontainer/devcontainer.json MUST NOT name the ollama-48gib Service.

Scenario: The old endpoint is absent

  • WHEN A person runs jq -e '.customizations.vscode.settings["ollama.endpoint"] | test("^http://[a-z0-9-]+\.llm\.svc\.cluster\.local:11434$") and (test("ollama-48gib") | not)' .devcontainer/devcontainer.json in the repository root.
  • THEN The command exits 0 and prints true.

Requirement: The devcontainer endpoint reaches the gateway

The ollama.endpoint setting SHALL name the gateway Service on port 11434.

Scenario: The configured endpoint answers

  • WHEN A person runs curl -fsS "$(jq -r '.customizations.vscode.settings["ollama.endpoint"]' .devcontainer/devcontainer.json)/api/tags" from the devcontainer.
  • THEN The command exits 0 and returns a JSON list of models from the gateway.

Requirement: Pending a person after the merge

The owner MUST merge this change before the homelab change that admits only the gateway.

Scenario: The merge order is kept

  • WHEN A person merges this pull request before dan-petty/homelab#268.
  • THEN The devcontainer keeps its path to Ollama through the gateway.

Existing Tool Considered

No alternatives check has run. The change uses the existing Ollama.ollama VS Code extension and its ollama.endpoint setting. It builds no code, so there is no build cost. The extension lacks an offline validator; the change uses a jq validator and a curl live check.

Key questions

  • Which parts of the original issue belong to this repository?: Only the devcontainer endpoint move. The NetworkPolicy and the ingress ollama-ingress are in dan-petty/homelab#268. (best practice) [sources: .devcontainer/devcontainer.json:133]
    • Chosen: Keep only the devcontainer endpoint move. The 2026-11-26 update moves the policy and ingress to homelab, and the cited network policy test is gone.
    • Rejected: Keep the policy and ingress in this issue. Those objects are not in this repository, and homelab#268 tracks them.
  • Which endpoint does the devcontainer use now?: http://ollama-48gib.llm.svc.cluster.local:11434. [sources: .devcontainer/devcontainer.json:133]
  • Which endpoint must the devcontainer use?: The gateway Service in namespace llm on port 11434. The setting must not name ollama-48gib. [sources: .devcontainer/devcontainer.json:133]
  • Which check proves the new endpoint?: A jq validator shows that ollama-48gib is absent. A curl live check shows that the configured endpoint answers with a model list. (best practice) [sources: .devcontainer/devcontainer.json:133, tests/commands/test_devcontainer.py]
    • Chosen: Use a jq validator and a curl live check. The repository has no test for this config file, and the project forbids a test that reads a config file.
    • Rejected: Add a unit test that reads .devcontainer/devcontainer.json. The project rule forbids tests that assert a config file value.
    • Rejected: Use no check. The homelab change would break the devcontainer with no warning.
  • What merge order does the change need?: Merge this change before dan-petty/homelab#268. The reverse order removes the devcontainer path to Ollama. [sources: .devcontainer/devcontainer.json:133]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    type/bug
    scope/k8s
    status/new
    value/medium
    effort/low
    on Nov 5, 2026
  2. devops-cli-service commented on Nov 5, 2026

    @devops-cli-service
    ContributorAuthor

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

    • Type: type/bug. The fix prefix of the title gives the type.
    • Scope: scope/k8s. The (k8s) scope of the title gives the scope.
    • Priority: P2-Medium. The exposure lets any external client trigger model unloading, but a human decision must precede the change.
    • Value: Medium. It stops unauthorised clients from evicting the 27b model and wasting the 48 GiB tier.
    • Effort: Low. The change edits one NetworkPolicy and one Ingress resource and adds one test.
    • Related: fix(k8s): network policies, proxy bypass and root kustomization break the ingress and llm stack #667, which asks for a different change. Both modify the llm namespace NetworkPolicy, but #667 fixes policies that block needed traffic while this candidate narrows a policy that admits too much traffic.
  3. devops-cli-service commented on Nov 6, 2026

    @devops-cli-service
    ContributorAuthor

    Refine cannot set this item to Ready at bd65ef6. A bot opened the item, so a review of the issue and of the proposal must approve it first. The review found the defects below. A person edits the body to answer them. The next refine round looks at the item again only after a body edit.

    • false_premise at key_questions[0]: The plan cites CHANGELOG.md:1724 as a repository convention, but no file content in the input supports this. The plan picks the gateway alone, but the issue defers that choice to the owner. Evidence: "The repository keeps an internal service to its own clients (CHANGELOG.md:1724)."
    • false_premise at existing_tool: The plan says the repository already renders the NetworkPolicy and holds tests for it. It cites test files and line numbers, but files is empty, so nothing in the input supports these claims. Evidence: "the repository already renders it, so this change builds no code"
  4. dan-petty commented on Nov 14, 2026

    @dan-petty
    Owner

    Returned to New: the first acceptance criterion is an owner decision that no comment records. The issue was split from #3574 because a person must accept the loss of direct access from a workstation, the devcontainer and the benchmark tests. The two comments on this issue are the bot intake and the refine next-step comment, and the refine prose chose "the gateway alone" itself, which is no person's decision. No agent may narrow the perimeter or the ingress before that comment: the change would cut the devcontainer and the benchmark path. When an owner records "the gateway alone" (or the named set), the item can be built as the design says.

  5. devops-cli-service commented on Nov 26, 2026

    @devops-cli-service
    ContributorAuthor

    Next step: the alternatives check records a verdict. See the section Proposed design of the body.

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/agentstatus/newtype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions