Repository navigation
Description
Problem Description
The Ingress loki-ingress in k8s/ingress/ingress-routes.yaml sends host loki.<domain> on the Traefik web entry point to Service loki, port 3100, in namespace logging. The NetworkPolicy logging-default-perimeter in k8s/logging/networkpolicy.yaml admits port 3100 only from pods in logging, from Grafana and the Alloy collectors in monitoring, and from the OpenTelemetry Collector in otel. It has no peer for Traefik, so each request through this Ingress fails.
The policy is correct. Loki runs with auth_enabled: false. A Traefik peer would open the Loki API without authentication (push, query and detected_fields) to each client that can reach Traefik. The change for #1632 recorded this decision: keep the policy closed and delete the Ingress.
Reproduction Steps
- Run
kubectl get ingress -n logging. The list showsloki-ingress. - Run
kubectl get networkpolicy -n logging logging-default-perimeter -o yaml. No ingress peer selects the Traefik pods inkube-system. - Send a request to
http://loki.<domain>/readythrough Traefik. Loki does not answer.
Expected vs Actual Behavior
- Expected: no Ingress sends traffic to Loki, and a test fails when an Ingress sends traffic to a Service in
loggingagain. - Actual:
loki-ingresssends traffic to a backend that the policy blocks.
Proposed change
- Delete
loki-ingressfromk8s/ingress/ingress-routes.yaml. Argo CD tracksmainwith prune, so it deletes the live Ingress after the merge. - Add an invariant test to
tests/invariants/test_k8s_manifests.py: no Ingress underk8s/names a backend Service in namespacelogging.
Environment Diagnostics
Homelab k3s cluster. Argo CD Application ingress syncs k8s/ingress/ from main with prune and self-heal.
Source: #1632
Proposed design
Problem statement
The Ingress loki-ingress routes traffic to Loki in namespace logging, but the NetworkPolicy logging-default-perimeter blocks all traffic from Traefik to port 3100. Every request through this Ingress fails. The project decided in #1632 to keep the policy closed and delete the Ingress. This change removes the dead Ingress and adds a test that prevents a dead Ingress from returning.
Acceptance criteria
Requirement: loki-ingress removed
The file k8s/ingress/ingress-routes.yaml SHALL NOT contain an Ingress named loki-ingress.
Scenario: Parse the YAML and check for the Ingress name
- WHEN A test loads every document in k8s/ingress/ingress-routes.yaml and collects the names of all Ingress objects
- THEN The name loki-ingress is not in the collected set
Requirement: invariant test blocks logging Ingress
A test in tests/invariants/test_k8s_manifests.py SHALL fail when any Ingress document under k8s/ has metadata.namespace equal to logging.
Scenario: Add a fake Ingress in namespace logging and run the test
- WHEN A test iterates over all Ingress documents returned by manifests() and collects those whose metadata.namespace is logging
- THEN The collected list is empty, and the test passes
Existing Tool Considered
The project already has the test infrastructure: tests/support/k8s_tree.py provides the manifests() helper that reads all documents under k8s/, and tests/invariants/test_k8s_manifests.py holds the pattern for invariant tests. The change adds one test function of about 15 lines using the existing manifests() helper and yaml.safe_load_all, plus the deletion of one Ingress block of about 20 lines from the YAML. No external library is needed.
Key questions
- Does the NetworkPolicy block Traefik from reaching Loki on port 3100?: Yes. The policy admits port 3100 only from pods in logging, from Grafana and the Alloy collectors in monitoring, and from the OpenTelemetry Collector in otel. No peer selects the Traefik pods in kube-system. [sources: k8s/logging/networkpolicy.yaml]
- Did the project decide to keep the policy closed and delete the Ingress?: Yes. The design document for fix(k8s): loki runs from the grafana-community chart on loki 3.7, out of reach of cve-2026-21729 #1632 records: 'Admit Traefik in the NetworkPolicy of logging, so that loki-ingress reaches Loki. Rejected: Loki runs with auth_enabled: false, so a Traefik peer opens the API without authentication. The policy stays closed, and fix(k8s): delete loki-ingress, whose backend the logging network policy blocks #2439 deletes loki-ingress.' [sources: openspec/changes/archive/2026-10-28-1632-loki-grafana-community-chart/design.md:53]
- How should the invariant test identify a dead Ingress for the logging namespace?: Check that no Ingress document under k8s/ has metadata.namespace equal to logging. This is equivalent to checking the backend Service namespace because Kubernetes Ingress routes to a Service in the same namespace. It is simpler than collecting Service names and matching them against backends. (best practice) [sources: tests/invariants/test_k8s_manifests.py, k8s/ingress/ingress-routes.yaml]
- Chosen: Check metadata.namespace of every Ingress. Simpler, one field to read. Equivalent because Kubernetes Ingress routes to a Service in the same namespace. Matches the existing test pattern of reading a single field per document.
- Rejected: Collect Service names in logging and match against Ingress backends. More complex: requires reading Service objects, building a name set, and matching against every backend path. Gives no extra coverage because an Ingress cannot route to a Service in another namespace.
- Will Argo CD delete the live Ingress after the merge?: Yes. The Argo CD Application for ingress syncs k8s/ingress/ from main with prune and self-heal, so it removes the live Ingress when the manifest is gone. [sources: k8s/ingress/ingress-routes.yaml]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Oct 28, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
The Ingress sends traffic to a backend the policy blocks, so it is a broken resource to remove.The policy already blocks the traffic, so no active harm occurs, but the dead resource causes confusion.It removes a misleading resource and adds a test that prevents a dead Ingress from returning.The change is one Ingress deletion in a YAML file plus one invariant test.Both concern the logging namespace perimeter, but #121 created the policy that blocks Traefik while this candidate deletes the dead Ingress that policy renders useless.fix(k8s): loki runs from the grafana-community chart on loki 3.7.9, o…
devops-cli-service commentedon Oct 29, 2026
Status set to Ready at 38a0a44 (see proposed design in issue body).
chore(main): release 0.15.1 (#2625)