Repository navigation
Description
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
devopsnamespace; - the
devops-cliSecret (envFrom, withGH_TOKENfor the machine account); devops-cli-config;- the image tag in
k8s/devops/kustomization.yamlimages:; - the public GHCR package;
devops-default-perimeter.
Facts it must respect, checked at 321ecda:
- Tunnel. Remotely managed (
TUNNEL_TOKEN, k8s/cloudflared/deployment.yaml:40-44). It forwards only to Traefik (k8s/cloudflared/networkpolicy.yaml:43-55). GitHub's deliveries cannot pass Cloudflare Access. tunnel syncstill drops route settings (fix(k8s): tunnel sync and url setup still overwrite settings they should keep #794).tunnel routesandaccess statusare read-only.- Ports. NetworkPolicy ports are container ports, and Traefik listens on 8000. Blocked means refused (fix(k8s): cloudflared egress NetworkPolicy silently blocks Traefik traffic #725).
- Scrape path.
- Prometheus egress to port 8000 is open only to
llm(k8s/monitoring/networkpolicy.yaml:102-116). - Both sides of the path are needed (tests/test_llm_pool_metrics.py:89-104).
- The
kubernetes-podsjob reads pod annotations (k8s/monitoring/prometheus-values.yaml:56).
- Prometheus egress to port 8000 is open only to
devops servedefaults.- It binds
127.0.0.1:8000with 1 worker (src/devops_cli/config/defaults.py:318-320). - feat(cli): service mode for
devops servewith github webhooks, a polling tick and per-repo job queues #752's--servicerefuses--workersabove 1 and--reload. - It mounts only
POST /webhooks/github,/healthz,/readyzand/metrics, and drains for 120 s.
- It binds
- State. refactor(github): roadmap store that reads and writes items, releases and board fields behind one interface #768 keeps nothing locally. The service's local state is feat(roadmap): run the roadmap jobs when they are due (
devops roadmap run) #981'sschedule.jsonand clones, feat(github): current release admission, cap, descoping and stall rules (devops roadmap reprioritize) #740's markers and gh's config, all under/home/devops. - Webhook secrets are feat(cli): service mode for
devops servewith github webhooks, a polling tick and per-repo job queues #752's credentialservice.webhook_secrets(DEVOPS_CLI_SERVICE_WEBHOOK_SECRETS, with a keyring key). - Kustomize. A directory listed as a resource needs its own
kustomization.yaml. - Data safety. Every live PV is
local-pathwith reclaimDelete. feat(k8s): argo cd keeps the homelab cluster at the current release branch, with automated sync, prune and self-heal that never delete data #755 will prune whatever leaves git unless it carriesPrune=false.
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.
deployment.yaml:roadmap-service, 1 replica,strategy: Recreate,terminationGracePeriodSeconds: 150,serviceAccountName: devops-cli.- Container
service, argsserve --service --host 0.0.0.0 --port 8000 --workers 1, security context as feat(k8s): devops-cli runs in the homelab cluster as Jobs, and every cluster Secret is pushed from the keyring, also by deploy-stack (devops k8s push-secrets, devops k8s run-job) #741's template,envFromsecretRefdevops-cli. - Env
DEVOPS_CLI_CONFIG=/config/devops-cli.yamlandDEVOPS_CLI_DATA_DIR=/home/devops/.data. - The PVC on
/home/devops, anemptyDiron/tmp, the ConfigMap on/config. - Liveness
/healthz, readiness/readyz. - Pod annotations
prometheus.io/scrape: "true"andprometheus.io/port: "8000". - Requests 100m/256Mi, limits 1 CPU/1Gi.
pvc.yaml:roadmap-service-home, 1Gi,ReadWriteOnce,local-path, annotatedargocd.argoproj.io/sync-options: Prune=false,Delete=false.service.yaml: ClusterIP on 8000.ingress.yaml:- class
traefik, annotationtraefik.ingress.kubernetes.io/router.entrypoints: web; - host
hooks.example.com. The template sets the domain. Under feat(k8s): argo cd keeps the homelab cluster at the current release branch, with automated sync, prune and self-heal that never delete data #755, the homelab overlay fordevopspatches it, and whichever of this item and feat(k8s): argo cd keeps the homelab cluster at the current release branch, with automated sync, prune and self-heal that never delete data #755 lands second adds the patch; - one path,
/webhooks/github,pathType: Exact.
- class
networkpolicy.yaml:roadmap-service-ingress,podSelector: app.kubernetes.io/name: roadmap-service,policyTypes: [Ingress]. Ingress on 8000 from Traefik pods in kube-system and from namespacemonitoring.
Other changes
devops-cli-configgainsservice.reposandservice.machine_account.- feat(k8s): devops-cli runs in the homelab cluster as Jobs, and every cluster Secret is pushed from the keyring, also by deploy-stack (devops k8s push-secrets, devops k8s run-job) #741's push table gains an entry on
devops/devops-cli:DEVOPS_CLI_SERVICE_WEBHOOK_SECRETS← feat(cli): service mode fordevops servewith github webhooks, a polling tick and per-repo job queues #752's keyring key forservice.webhook_secrets. It is optional (skipped with a warning where the service is not set up) and never generated. The Secret's restart targets gaindeployment/roadmap-service, so a changed Secret restarts the service after the push. k8s/monitoring/networkpolicy.yamlgains an egress rule to namespacedevopson TCP 8000, next to thellmrule (:102-116).- A k8s/README.md section, "Roadmap service":
uv run devops config set service.webhook_secrets(hidden prompt; a JSON object mappingowner/nameto its secret).uv run devops k8s push-secrets --stack devops, with the machine account's login ink8s.github_account(feat(k8s): devops-cli runs in the homelab cluster as Jobs, and every cluster Secret is pushed from the keyring, also by deploy-stack (devops k8s push-secrets, devops k8s run-job) #741). deploy-stack also pushes it once namespacedevopsexists.- Invite the machine account as a Write collaborator on each repo and board.
- Check that the GHCR
servicepackage is public (feat(k8s): devops-cli runs in the homelab cluster as Jobs, and every cluster Secret is pushed from the keyring, also by deploy-stack (devops k8s push-secrets, devops k8s run-job) #741 made it so):DOCKER_CONFIG=$(mktemp -d) docker pull ghcr.io/dan-petty/devops-cli/service:<tag>. devops cloudflare tunnel routes. If no route covers the webhook host, add one in the dashboard, not withtunnel sync(fix(k8s): tunnel sync and url setup still overwrite settings they should keep #794).devops cloudflare access status, then add a Bypass application forhooks.<domain>/webhooks/github.devops k8s apply k8s/monitoring/networkpolicy.yaml, until feat(k8s): argo cd keeps the homelab cluster at the current release branch, with automated sync, prune and self-heal that never delete data #755 or fix(k8s): deploy-stack applies the monitoring namespace perimeter #913 deploys it.devops k8s apply k8s/devops/ --template, until feat(k8s): argo cd keeps the homelab cluster at the current release branch, with automated sync, prune and self-heal that never delete data #755.- Add each repo's webhook:
https://hooks.<domain>/webhooks/github,application/json, that repo's secret, and the Issues, Pull requests and Milestones events. - To rotate a credential, update it in the keyring (
uv run devops config set service.webhook_secrets, orgh auth loginfor the machine account), then runuv run devops k8s push-secrets --only devops/devops-cli --rotate. It restartsroadmap-service. - Run one service per set of repos. While it runs, use
devops roadmap run --dry-run(feat(roadmap): run the roadmap jobs when they are due (devops roadmap run) #981).
changelog.d/<RS>.md; task filedocs/agent/tasks/task-<RS>-roadmap-service-deployment.md.
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, containerservice, and args containing--service,--host 0.0.0.0and--workers 1. - The security context.
envFromis only secretRefdevops-cli, with no literal credentialvalue.- The PVC is mounted at
/home/devops,DEVOPS_CLI_DATA_DIRstarts with it, and the PVC's sync-options containPrune=falseandDelete=false. - Annotations name port 8000.
- The Ingress has class
traefik, one host and oneExactpath,/webhooks/github. roadmap-service-ingressadmits only Traefik in kube-system and namespacemonitoring, on 8000.- k8s/monitoring/networkpolicy.yaml has an egress rule to
devopson 8000. - The ConfigMap validates as
Settingswith non-emptyservice.reposandservice.machine_account. k8s/devops/kustomization.yamllistsroadmap-service, andk8s/devops/roadmap-service/kustomization.yamllists exactly the five manifests, each of which exists.
- 1 replica,
- The push-secrets table has the webhook entry, optional and without a generator, with its env name from
OPTION_TO_ENV_VAR.devops/devops-clilistsdeployment/roadmap-serviceas a restart target. Test: tests/test_k8s_push_secrets.py. -
changelog.d/<RS>.mdexists, CHANGELOG.md and docs/ROADMAP.md are untouched, anddevops pr check-readinesspasses. -
uv run devops cipasses 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=180ssucceeds.kubectl -n devops get deploy roadmap-service -o jsonpath='{.spec.replicas} {.spec.strategy.type} {.status.readyReplicas}'prints1 Recreate 1.- After
kubectl -n devops rollout restart deploy/roadmap-service,kubectl -n devops get pods -l app.kubernetes.io/name=roadmap-service -wnever shows two Running pods.
- Exposure:
curl -s -o /dev/null -w '%{http_code}\n' https://hooks.<domain>/healthprints404(or302under Access), never200.curl -s -o /dev/null -w '%{http_code}\n' -X POST https://hooks.<domain>/webhooks/github -d '{}'prints401.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)prints200.- The same against
https://api.github.com/zenprints200. import socket; socket.create_connection(("prometheus-server.monitoring.svc.cluster.local", 9090), timeout=5)raisesConnectionRefusedErrororTimeoutError.- The same for
("kubernetes.default.svc.cluster.local", 443).
- Scrape:
devops prometheus query 'up{namespace="devops"}'returns one series with value1.
Constraints
- At most one copy of the service changes a repo at any time.
- Only
/webhooks/githubis reachable from outside (ADR 0003). - Every rule uses container ports and is checked live.
Key questions
- Volume and mount? A 1Gi
local-pathPVC at/home/devops, the image'sHOME.local-pathpins the pod to the volume's node. - Two copies during a rollout? No: 1 replica,
Recreate,--workers 1, and kept out of the root kustomization. - Why a second NetworkPolicy? feat(k8s): devops-cli runs in the homelab cluster as Jobs, and every cluster Secret is pushed from the keyring, also by deploy-stack (devops k8s push-secrets, devops k8s run-job) #741's perimeter admits no ingress, and policies add up. An ingress-only policy on the service's pods opens 8000 without opening the jobs.
- Path restriction and Access? A Traefik Ingress with one
Exactpath, plus a path-scoped Access Bypass. feat(cli): service mode fordevops servewith github webhooks, a polling tick and per-repo job queues #752's HMAC check authenticates deliveries. - Prometheus? An egress rule to
devopson 8000, plus this item's ingress rule. - Webhook events? Issues, Pull requests and Milestones. Board changes come from polling (ADR 0003).
- Does a Secret change reach the pod? Only at start.
push-secretsrestartsroadmap-servicewhendevops-cli's data changed (feat(k8s): devops-cli runs in the homelab cluster as Jobs, and every cluster Secret is pushed from the keyring, also by deploy-stack (devops k8s push-secrets, devops k8s run-job) #741). - Does feat(k8s): argo cd keeps the homelab cluster at the current release branch, with automated sync, prune and self-heal that never delete data #755's prune touch it? The PVC carries
Prune=false,Delete=false, and the Secret is not in git. feat(k8s): argo cd keeps the homelab cluster at the current release branch, with automated sync, prune and self-heal that never delete data #755'sdevopsApplication adopts the rest. Whichever of the two lands second addshooks.example.comto the homelab overlay's patch fordevops. - Resource figures? A starting point. Revisit with
kubectl -n devops top podafter a week. - Can a GitHub workflow hold the token? No. fix(ci): only collaborators can trigger pr updates with
/updateor/synccomments #754 must land first, and this item adds no workflow.
Out of scope
- The namespace, Secret, config, image tag, public package and job template (feat(k8s): devops-cli runs in the homelab cluster as Jobs, and every cluster Secret is pushed from the keyring, also by deploy-stack (devops k8s push-secrets, devops k8s run-job) #741).
devops roadmap run(feat(roadmap): run the roadmap jobs when they are due (devops roadmap run) #981).- feat(cli): service mode for
devops servewith github webhooks, a polling tick and per-repo job queues #752, feat(release): production service image for scheduled jobs and webhook handlers #753 and refactor(github): one github session per identity owning token, quota and transport #767. - The Tavily row (feat(ai): item refinement to ready with proposed decisions (
devops roadmap refine) #744), discovery egress (feat(ai): roadmap discovery from advisories, alerts, repo signals and web research (devops roadmap discover) #745), Argo CD (feat(k8s): argo cd keeps the homelab cluster at the current release branch, with automated sync, prune and self-heal that never delete data #755),tunnel sync(fix(k8s): tunnel sync and url setup still overwrite settings they should keep #794) and the rate metric (feat(github): github api request and throttle counters for the devops-cli dashboard #814).
Strategic alignment
- Milestone: v0.2.26.
- Priority: P1. Value: High. Effort: High.
- Depends on: feat(k8s): devops-cli runs in the homelab cluster as Jobs, and every cluster Secret is pushed from the keyring, also by deploy-stack (devops k8s push-secrets, devops k8s run-job) #741, feat(cli): service mode for
devops servewith github webhooks, a polling tick and per-repo job queues #752, feat(release): production service image for scheduled jobs and webhook handlers #753 and refactor(github): one github session per identity owning token, quota and transport #767. - Dependents: feat(roadmap): run the roadmap jobs when they are due (
devops roadmap run) #981. - Overlaps:
- fix(k8s): pod logs reach loki once and labelled, with alloy as the only shipper (remove fluent-bit) #548: k8s/monitoring/networkpolicy.yaml and k8s/README.md. Both changes are additive; the second to merge rebases.
- fix(k8s): deploy-stack applies the monitoring namespace perimeter #913: guard-test exemption for
roadmap-service-ingress.
- Related: feat(k8s): argo cd keeps the homelab cluster at the current release branch, with automated sync, prune and self-heal that never delete data #755, fix(ci): only collaborators can trigger pr updates with
/updateor/synccomments #754, fix(k8s): tunnel sync and url setup still overwrite settings they should keep #794, ADR 0002 and ADR 0003.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
dan-petty commentedon Oct 3, 2026
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.
feat(k8s): the roadmap service runs in the cluster's devops namespace…
dan-petty commentedon Oct 4, 2026
What changed
#1172, merged into
release/v0.2.26as e61bc91.17 file(s) changed.
How it was verified
Check runs at 119fe22:
Acceptance Criteria of
docs/agent/tasks/task-1083-roadmap-service-deployment.md:tests/test_k8s_roadmap_service.py:Recreate, containerservice, and args containing--service,--host 0.0.0.0and--workers 1.runAsNonRoot: true,readOnlyRootFilesystem: true, drop ALL capabilities).envFromis only secretRefdevops-cli, with no literal credentialvalue./home/devops,DEVOPS_CLI_DATA_DIRstarts with it, and the PVC's sync-options containPrune=falseandDelete=false.prometheus.io/scrape: "true",prometheus.io/port: "8000").traefik, one host and oneExactpath,/webhooks/github.roadmap-service-ingressadmits only Traefik in kube-system and namespacemonitoring, on 8000.k8s/monitoring/networkpolicy.yamlhas an egress rule todevopson 8000.Settingswith non-emptyservice.reposandservice.machine_account.k8s/devops/kustomization.yamllistsroadmap-service, andk8s/devops/roadmap-service/kustomization.yamllists exactly the five manifests, each of which exists.OPTION_TO_ENV_VAR.devops/devops-clilistsdeployment/roadmap-serviceas a restart target. Tested intests/test_k8s_push_secrets.py.changelog.d/1083.mdexists,CHANGELOG.mdanddocs/ROADMAP.mdremain untouched, anddevops pr check-readinesspasses.uv run devops cipasses.homelab-k3s:kubectl -n devops rollout status deploy/roadmap-service --timeout=180ssucceeds.kubectl -n devops get deploy roadmap-service -o jsonpath='{.spec.replicas} {.spec.strategy.type} {.status.readyReplicas}'prints1 Recreate 1.curl -s -o /dev/null -w '%{http_code}\n' https://hooks.<domain>/healthprints404(or302under Access), never200.curl -s -o /dev/null -w '%{http_code}\n' -X POST https://hooks.<domain>/webhooks/github -d '{}'prints401.devops prometheus query 'up{namespace="devops"}'returns one series with value1.feat(release): v0.2.26 (#1178)