fix(forgejo): allow ci-runners -> forgejo:3000 so CI image pushes work #91

Merged
sirius merged 1 commit from fix/forgejo-allow-ci-runners-registry into master 2026-12-05 05:18:47 +00:00
Owner

Symptom

Every image-building CI job has failed since 2026-11-27 07:13Z — the moment forgejo-allow landed:

Error response from daemon: Get "http://forgejo.forgejo.svc.cluster.local:3000/v2/":
net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

Why

forgejo-allow's comment argued no cross-namespace rule was needed because the runners in ci-runners register/poll over the public URL and therefore arrive as reserved:ingress. That is true for registration. The build workflows push to the in-cluster ClusterIP (PUSH_REGISTRY: forgejo.forgejo.svc.cluster.local:3000) from the docker daemon in the runner pod's dind sidecar — pod → pod, which the namespace default-deny drops and forgejo-allow never re-allowed.

Reproduced live before the fix (runner pod, 8 s timeout, exit 143):

$ kubectl -n ci-runners exec forgejo-runner-amd64-6d8dc9d467-4849l -c runner --     timeout 8 wget -qO- http://forgejo.forgejo.svc.cluster.local:3000/api/v1/version
command terminated with exit code 143

Change

One port-scoped ingress rule added to forgejo-allow in apps/base/forgejo/networkpolicy.yaml:

    - fromEndpoints:
        - matchLabels:
            io.kubernetes.pod.namespace: ci-runners
      toPorts:
        - ports:
            - port: "3000"
              protocol: TCP

The runner container and its dind sidecar are the same pod, so a single namespace selector covers both. Nothing else in forgejo is widened (existing rules untouched: entities ingress/host/remote-node/health, same-namespace pods, cnpg-system:8000, monitoring:9187). The stale "no cross-namespace rule is needed" paragraph is rewritten to say the rule is required and why, so the next isolation audit does not delete it as redundant.

Verification (after merge)

Re-ran sirius/osint-dashboard build.yml for master fb5285df7f388a06f457842071d0318d5a3a6e0f (run 1496, previously failed) and confirmed the tag amd64-fb5285df7f38 exists in the registry with a manifest digest. Evidence will be quoted in the kanban card.

Refs: card t_e137b2d8.

## Symptom Every image-building CI job has failed since **2026-11-27 07:13Z** — the moment `forgejo-allow` landed: ``` Error response from daemon: Get "http://forgejo.forgejo.svc.cluster.local:3000/v2/": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers) ``` ## Why `forgejo-allow`'s comment argued no cross-namespace rule was needed because the runners in `ci-runners` register/poll over the public URL and therefore arrive as `reserved:ingress`. That is true for registration. The build workflows push to the **in-cluster ClusterIP** (`PUSH_REGISTRY: forgejo.forgejo.svc.cluster.local:3000`) from the docker daemon in the runner pod's dind sidecar — pod → pod, which the namespace `default-deny` drops and `forgejo-allow` never re-allowed. Reproduced live before the fix (runner pod, 8 s timeout, exit 143): ``` $ kubectl -n ci-runners exec forgejo-runner-amd64-6d8dc9d467-4849l -c runner -- timeout 8 wget -qO- http://forgejo.forgejo.svc.cluster.local:3000/api/v1/version command terminated with exit code 143 ``` ## Change One port-scoped ingress rule added to `forgejo-allow` in `apps/base/forgejo/networkpolicy.yaml`: ```yaml - fromEndpoints: - matchLabels: io.kubernetes.pod.namespace: ci-runners toPorts: - ports: - port: "3000" protocol: TCP ``` The runner container and its dind sidecar are the same pod, so a single namespace selector covers both. Nothing else in `forgejo` is widened (existing rules untouched: entities ingress/host/remote-node/health, same-namespace pods, cnpg-system:8000, monitoring:9187). The stale "no cross-namespace rule is needed" paragraph is rewritten to say the rule is required and why, so the next isolation audit does not delete it as redundant. ## Verification (after merge) Re-ran `sirius/osint-dashboard` build.yml for master `fb5285df7f388a06f457842071d0318d5a3a6e0f` (run 1496, previously failed) and confirmed the tag `amd64-fb5285df7f38` exists in the registry with a manifest digest. Evidence will be quoted in the kanban card. Refs: card `t_e137b2d8`.
`forgejo-allow` claimed no cross-namespace rule was needed because the CI
runners in `ci-runners` "register/poll over the public URL and therefore
arrive as reserved:ingress". That holds for registration only. Every
image-building workflow pushes to the in-cluster ClusterIP
(`PUSH_REGISTRY: forgejo.forgejo.svc.cluster.local:3000`) from the dind
sidecar of the runner pod — pod->pod, which `default-deny` dropped, so
every build since the policy landed (2026-11-27 07:13Z) died at
`Get "http://forgejo.forgejo.svc.cluster.local:3000/v2/": request canceled
... Client.Timeout exceeded`.

Add one port-scoped ingress rule: fromEndpoints
`io.kubernetes.pod.namespace: ci-runners` -> 3000/TCP (runner container and
its dind sidecar share the pod identity, so a single namespace selector
covers both). Nothing else in `forgejo` is widened. Rewrite the stale
comment paragraph so the next isolation audit does not re-remove it.
sirius merged commit 9cec2da3c4 into master 2026-12-05 05:18:47 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
sirius/homek8s!91
No description provided.