Skip to content

feat(k8s): the roadmap service runs in the cluster's devops namespace, reachable from outside only on /webhooks/github #1083

Closed

Description

@dan-petty

Problem

On 2026-10-03 the owner broadened #741 to devops-cli's in-cluster runtime. Since one issue is delivered by one PR, the roadmap service's Deployment, the other half of #741's earlier body, moved to this item.

The roadmap jobs must run when due with no person present (#981). They run under #752's service mode in the homelab, because only the LAN reaches the gateway.

#741 supplies:

  • the devops namespace;
  • the devops-cli Secret (envFrom, with GH_TOKEN for the machine account);
  • devops-cli-config;
  • the image tag in k8s/devops/kustomization.yaml images:;
  • the public GHCR package;
  • devops-default-perimeter.

Facts it must respect, checked at 321ecda:

Proposed solution

A single-replica Recreate Deployment, roadmap-service, in devops runs serve --service. Around it:

  • a PVC at HOME;
  • a Traefik Ingress for exactly /webhooks/github;
  • an ingress-only policy for its pods;
  • a monitoring egress rule.

#752's log-only job function runs until #981 plugs in devops roadmap run.

Scope

k8s/devops/roadmap-service/, with its own kustomization.yaml listing the five files below. k8s/devops/kustomization.yaml lists roadmap-service.

Other changes

Acceptance criteria

In the gate (no network or cluster, under 1 s: uv run pytest tests/test_k8s_roadmap_service.py --durations=0):

  • Manifests. tests/test_k8s_roadmap_service.py asserts:
    • 1 replica, Recreate, container service, and args containing --service, --host 0.0.0.0 and --workers 1.
    • The security context.
    • envFrom is only secretRef devops-cli, with no literal credential value.
    • The PVC is mounted at /home/devops, DEVOPS_CLI_DATA_DIR starts with it, and the PVC's sync-options contain Prune=false and Delete=false.
    • Annotations name port 8000.
    • The Ingress has class traefik, one host and one Exact path, /webhooks/github.
    • roadmap-service-ingress admits only Traefik in kube-system and namespace monitoring, on 8000.
    • k8s/monitoring/networkpolicy.yaml has an egress rule to devops on 8000.
    • The ConfigMap validates as Settings with non-empty service.repos and service.machine_account.
    • k8s/devops/kustomization.yaml lists roadmap-service, and k8s/devops/roadmap-service/kustomization.yaml lists exactly the five manifests, each of which exists.
  • The push-secrets table has the webhook entry, optional and without a generator, with its env name from OPTION_TO_ENV_VAR. devops/devops-cli lists deployment/roadmap-service as a restart target. Test: tests/test_k8s_push_secrets.py.
  • changelog.d/<RS>.md exists, CHANGELOG.md and docs/ROADMAP.md are untouched, and devops pr check-readiness passes.
  • uv run devops ci passes within budget.

Pending a person (homelab-k3s, against #752's log-only function). Before v0.2.26 ships, run kubectl -n devops set image deploy/roadmap-service service=ghcr.io/dan-petty/devops-cli/service:pr-<RS> first.

  • Rollout:
    • kubectl -n devops rollout status deploy/roadmap-service --timeout=180s succeeds.
    • kubectl -n devops get deploy roadmap-service -o jsonpath='{.spec.replicas} {.spec.strategy.type} {.status.readyReplicas}' prints 1 Recreate 1.
    • After kubectl -n devops rollout restart deploy/roadmap-service, kubectl -n devops get pods -l app.kubernetes.io/name=roadmap-service -w never shows two Running pods.
  • Exposure:
    • curl -s -o /dev/null -w '%{http_code}\n' https://hooks.<domain>/health prints 404 (or 302 under Access), never 200.
    • curl -s -o /dev/null -w '%{http_code}\n' -X POST https://hooks.<domain>/webhooks/github -d '{}' prints 401.
    • gh api repos/<owner>/<repo>/hooks/<id>/deliveries --jq '[.[] | select(.event == "ping") | .status_code]' shows a 2xx.
  • Egress, each run as kubectl -n devops exec deploy/roadmap-service -- python -c '<probe>':
    • import urllib.request as u; print(u.urlopen("http://llm-gateway.llm.svc.cluster.local:4000/health/liveliness", timeout=5).status) prints 200.
    • The same against https://api.github.com/zen prints 200.
    • import socket; socket.create_connection(("prometheus-server.monitoring.svc.cluster.local", 9090), timeout=5) raises ConnectionRefusedError or TimeoutError.
    • The same for ("kubernetes.default.svc.cluster.local", 443).
  • Scrape: devops prometheus query 'up{namespace="devops"}' returns one series with value 1.

Constraints

  • At most one copy of the service changes a repo at any time.
  • Only /webhooks/github is reachable from outside (ADR 0003).
  • Every rule uses container ports and is checked live.

Key questions

Out of scope

Strategic alignment

Activity

  1. added this to the v0.2.26 milestone on Oct 3, 2026
  2. added
    type/feature
    scope/k8s
    priority/p1-high
    on Oct 3, 2026
  3. dan-petty commented on Oct 3, 2026

    @dan-petty
    OwnerAuthor

    Split from #741 on 2026-10-03, after the owner broadened #741 to the in-cluster runtime this Deployment runs on. Placed in v0.2.26 with #741's placement, as #981 was.

  4. dan-petty commented on Oct 4, 2026

    @dan-petty
    OwnerAuthor

    What changed

    #1172, merged into release/v0.2.26 as e61bc91.

    Resolves #1083

    17 file(s) changed.

    How it was verified

    Check runs at 119fe22:

    • Prune PR DevContainer Images: pass
    • CodeQL: pass
    • Static Analysis: pass
    • Analyze (actions): pass
    • Analyze (python): pass
    • Tests & Coverage: pass
    • DevContainer Image: skipping
    • Service Image: skipping
    • Dependency Freshness: skipping

    Acceptance Criteria of docs/agent/tasks/task-1083-roadmap-service-deployment.md:

    • Manifests tested in tests/test_k8s_roadmap_service.py:
      • 1 replica, Recreate, container service, and args containing --service, --host 0.0.0.0 and --workers 1.
      • Restricted security context (runAsNonRoot: true, readOnlyRootFilesystem: true, drop ALL capabilities).
      • envFrom is only secretRef devops-cli, with no literal credential value.
      • The PVC is mounted at /home/devops, DEVOPS_CLI_DATA_DIR starts with it, and the PVC's sync-options contain Prune=false and Delete=false.
      • Annotations name port 8000 (prometheus.io/scrape: "true", prometheus.io/port: "8000").
      • The Ingress has class traefik, one host and one Exact path, /webhooks/github.
      • roadmap-service-ingress admits only Traefik in kube-system and namespace monitoring, on 8000.
      • k8s/monitoring/networkpolicy.yaml has an egress rule to devops on 8000.
      • The ConfigMap validates as Settings with non-empty service.repos and service.machine_account.
      • k8s/devops/kustomization.yaml lists roadmap-service, and k8s/devops/roadmap-service/kustomization.yaml lists exactly the five manifests, each of which exists.
    • The push-secrets table has the webhook entry, optional and without a generator, with its env name from OPTION_TO_ENV_VAR. devops/devops-cli lists deployment/roadmap-service as a restart target. Tested in tests/test_k8s_push_secrets.py.
    • changelog.d/1083.md exists, CHANGELOG.md and docs/ROADMAP.md remain untouched, and devops pr check-readiness passes.
    • Fast in-gate tests total under 1 s and open no network sockets. uv run devops ci passes.
    • Pending a person: live rollout and exposure verification on homelab-k3s:
      • kubectl -n devops rollout status deploy/roadmap-service --timeout=180s succeeds.
      • kubectl -n devops get deploy roadmap-service -o jsonpath='{.spec.replicas} {.spec.strategy.type} {.status.readyReplicas}' prints 1 Recreate 1.
      • curl -s -o /dev/null -w '%{http_code}\n' https://hooks.<domain>/health prints 404 (or 302 under Access), never 200.
      • curl -s -o /dev/null -w '%{http_code}\n' -X POST https://hooks.<domain>/webhooks/github -d '{}' prints 401.
      • devops prometheus query 'up{namespace="devops"}' returns one series with value 1.
  5. added a commit that references this issue on Oct 4, 2026
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

    priority/p1-highscope/k8stype/feature

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions