Skip to content

feat(k8s): the kube api is reachable off the home network at k8s.<domain> through the cloudflare tunnel, behind access, with kubectl over cloudflared access tcp - #1597

Merged
dan-petty merged 1 commit into
release/v0.2.36from
feat/kube-api-tunnel
Oct 16, 2026
Merged

dan-petty merged 1 commit into
release/v0.2.36from
feat/kube-api-tunnel

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

Closes #1595

Off the home network a workstation cannot reach the cluster's API server: the kubeconfig names the node's LAN address. This makes the API reachable at k8s.<domain> through the existing Cloudflare Tunnel, behind the Access application that already covers the domain, with kubectl over cloudflared access tcp. An HTTP hostname cannot carry the API, because Cloudflare ends TLS at its edge and drops kubectl's client certificate; a tcp:// route keeps TLS end to end.

Changes

  • k8s/cloudflared/networkpolicy.yaml: cloudflared may reach the API server on TCP 6443 through an ipBlock peer (0.0.0.0/0 except 169.254.169.254/32). The kubernetes Service resolves to the node's address, which no namespace selector matches; this is the form Argo CD's rule has used since fix(k8s): the argocd and otel perimeters admit 0.0.0.0/0 ingress and deploy-stack applies neither #1371, which kube-router enforces. The Traefik rule keeps its bare pod selector peer.
  • devops cloudflare tunnel sync (cloudflare/client.py): a new hostname is inserted before the first rule whose wildcard hostname would match it, instead of after every rule. cloudflared uses the first matching rule, and a leading *. matches any name ending in the rest (matchHost in cloudflared's ingress/rule.go), so a host added under the live *.<domain> route was never reached. Existing rules keep their order.
  • tools.lock: cloudflared 2026.9.3, the version the cluster runs. Linux builds are bare binaries and macOS builds are .tgz, so an Artifact may now name its own format, falling back to the tool's (BinaryTool.format_of). Each sha256 is GitHub's asset digest; the Linux ones equal the release notes' checksums, and for macOS the notes list the binary inside the archive, which matches after unpacking. The lock header records this.
  • k8s/README.md: a "Kubernetes API at k8s.<domain>" subsection with the route (tunnel sync --subdomains k8s --service tcp://kubernetes.default.svc.cluster.local:443), the Access check, devops install-tools --tool cloudflared, cloudflared access tcp --hostname k8s.<domain> --url 127.0.0.1:16443 and a kubeconfig context with --tls-server-name=kubernetes.default.svc.

Verification

  • tests/test_cloudflare_commands.py::test_a_new_hostname_goes_before_the_wildcard_cloudflared_would_match_it_to: under a wildcard, under the nearest of two wildcards, and with no wildcard (appended before the catch-all). The first two failed before the change.
  • tests/test_k8s_network_policies.py::test_api_server_egress_admits_6443_through_ipblock[argocd|cloudflared]: the Argo CD test, now parametrized; the cloudflared case failed before the change. test_cloudflared_traefik_egress_rule_has_no_port_restriction selects the Traefik rule by its pod selector peer instead of taking the only rule with a to:.
  • tests/test_install_tools.py::test_a_build_packed_unlike_the_tools_others_unpacks_by_its_own_format and tests/test_tools_lock.py (cloudflared required; member set exactly when a build's effective format is tar.gz) failed before the change.
  • devops install-tools --tool cloudflared installed 2026.9.3 from the lock on linux-amd64, and cloudflared --version reports it. The README's jsonpath returns the cluster entry's CA certificate from a real kubeconfig.
  • uv run devops ci passed locally, including the full suite and coverage.
  • Pending a person: once the release reaches main and Argo CD applies the policy, run devops cloudflare tunnel sync --subdomains k8s --service tcp://kubernetes.default.svc.cluster.local:443 (preview with --dry-run), then from off the home network cloudflared access tcp --hostname k8s.<domain> --url 127.0.0.1:16443 and kubectl --context <cluster>-tunnel get nodes after the Access login.
  • A command that keeps the cloudflared access tcp forward running beside the CLI's port-forward daemon is not part of this change.

…ain> through the cloudflare tunnel, behind access, with kubectl over cloudflared access tcp

- k8s/cloudflared/networkpolicy.yaml lets cloudflared reach the API server on 6443 through an ipBlock peer with the metadata address excluded, as Argo CD's rule does (#1371).
- `devops cloudflare tunnel sync` inserts a new hostname before the first wildcard rule that would match it (cloudflared's matchHost: a leading `*.` matches any name ending in the rest), so `k8s.<domain>` is reached under an existing `*.<domain>` route.
- cloudflared 2026.9.3 is a tools.lock binary. A build may name its own format, since cloudflared ships bare Linux binaries and macOS tar.gz archives.
- k8s/README.md documents the tcp:// route, `cloudflared access tcp` and the kubeconfig context.

Closes #1595
@dan-petty
dan-petty marked this pull request as ready for review October 16, 2026 19:02
@dan-petty
dan-petty merged commit e7f032f into release/v0.2.36 Oct 16, 2026
11 checks passed
@dan-petty
dan-petty deleted the feat/kube-api-tunnel branch October 16, 2026 19:03
dan-petty added a commit that referenced this pull request Oct 17, 2026
* fix(github): fail closed on review thread read errors in pr readiness (#1583)

* chore(release): pin docker/setup-qemu-action SHA and align BaseCapability id types for ty 0.0.87 (#1582)

* fix(github): fail closed on review thread read errors in pr readiness

* fix(ai): emit failing unit test scaffolds in devops ai test-gen (#1584)

* fix(review): write no session directory or findings on dry-run review (#1587)

* feat(k8s): argo cd's web terminal opens a shell in any pod an application manages (#1586)

Set configs.cm."exec.enabled" to "true" in k8s/argocd/values.yaml. The pinned argo-cd chart
then grants argocd-server create on pods/exec, and Argo CD's built-in role:admin already holds
exec, create, so the admin user can open a pod's Terminal tab without kube API access from the
workstation.

Closes #1585

* test(cli): suppression comments may not grow unnoticed (#849) (#1590)

* fix(cli): messages reach the terminal as one line, so a command in one is never split by an inserted newline (#1589)

Step, raw and leveled messages go to Rich with soft_wrap=True. Rich's own word wrap wrote a
newline at a space, which split a command a message names, such as `devops devcontainer
unlock-keyring`, so copying it gave two lines. Tables, panels and Markdown keep Rich's layout.

An abandoned keyring prompt (timeout, EOF or Ctrl-C) now ends its line before the message that
follows: getpass writes that newline only once the prompt is answered.

Closes #1588

* fix(docs): generated reference docs fail closed and describe the real surface (#854) (#1591)

* test(cli): whole-tree import-cycle and interface-layer invariants (#848) (#1592)

* fix(roadmap): an intake placement that fails stops only its own candidate, and the round still reports the failure and exits non-zero (#1593)

apply_intake applies each candidate's writes on its own. A GitHubOperationError skips that
candidate with a warning naming it and the error, and the round's other candidates are still
written. raise_for_failed_placements then raises RoadmapIntakeError (ROADMAP_INTAKE_FAILED)
naming each skipped candidate and its error's class: `devops roadmap intake --confirm` reports
what it placed and exits 1, and the roadmap run's intake job fails. A GitHubRateLimitError,
which also carries a GraphQL budget refusal, still stops the round at once.

GitHub answers the board add of some existing issues with an INTERNAL error, which stopped
every round at the first of them.

Closes #1443

* feat(ai): one json repair seam that counts repairs per entry point (#875) (#1594)

* feat(ci): fail-to-pass check proves a fix's tests fail on its base (#844) (#1596)

* feat(k8s): the kube api is reachable off the home network at k8s.<domain> through the cloudflare tunnel, behind access, with kubectl over cloudflared access tcp (#1597)

- k8s/cloudflared/networkpolicy.yaml lets cloudflared reach the API server on 6443 through an ipBlock peer with the metadata address excluded, as Argo CD's rule does (#1371).
- `devops cloudflare tunnel sync` inserts a new hostname before the first wildcard rule that would match it (cloudflared's matchHost: a leading `*.` matches any name ending in the rest), so `k8s.<domain>` is reached under an existing `*.<domain>` route.
- cloudflared 2026.9.3 is a tools.lock binary. A build may name its own format, since cloudflared ships bare Linux binaries and macOS tar.gz archives.
- k8s/README.md documents the tcp:// route, `cloudflared access tcp` and the kubeconfig context.

Closes #1595

* feat(review): devops-cli's rule pack turns the recall set's network-exposure entries into tested Semgrep rules, and CI runs the pack's tests when a rule changes (#1145) (#1598)

* feat(mcp): declare ToolAnnotations readOnlyHint on all tools and default tf_apply auto_approve=False (#857) (#1600)

* fix(github): supply-chain claims made true — live Dependabot, zizmor and workflow invocation contracts (#1599)

* fix(github): supply-chain claims made true — live Dependabot, zizmor and workflow invocation contracts

- zizmor 1.30.1 is pinned in the dev group. `devops scan workflows` runs it offline with --no-exit-codes, shows every finding and fails on template-injection, unpinned-uses and excessive-permissions, or when zizmor could not run; `devops ci` runs it as the `zizmor` check.
- No `run:` block interpolates a `${{ }}` expression: the release workflow's version, notes, tag and milestone steps and ci.yml's image name take their values through `env:` or the runner's GITHUB_REPOSITORY.
- `devops ci maintain` audits with the `audit` check's `uv audit` instead of the undeclared pip-audit, and reports an audit that could not run (uv exit 2) apart from one that found vulnerabilities (exit 1).
- docs/SDLC.md drops the Dependabot, pip-audit and SLSA Level 3 claims and names the controls the repository runs; the Renovate line says Renovate acts only where its GitHub App is installed.
- Contract tests resolve every `devops` command in the workflows, composite actions and pre-commit hooks with resolve_devops_argv, and pin that no run block holds an expression and every remote `uses:` is SHA-pinned.

Closes #861

* fix(ci): fail-to-pass replay counts the other changed tests when one cannot be collected on base

`devops ci fail-to-pass` runs the changed test files on the merge-base tree in one pytest session. A fix that adds a module and a test file importing it cannot collect that file on base, and pytest then ran none of the files, so the gate found no failing test and failed the PR. The replay passes `--continue-on-collection-errors`: the file is reported as errored and the others run. This PR's own `tests/test_security_zizmor.py` hit it.

* feat(review): run review tools at project versions and gate on 5-tuple cached canaries (#1143) (#1603)

* feat(review): run review tools at project versions and gate on 5-tuple cached canaries (#1143)

* fix(review): isolate tool canaries with recorded outputs in conftest and keep scanner failure reasons

* fix(github): pr monitor judges each check by its latest run, so a cancelled run a newer one replaced does not fail the pr (#1605)

The REST check-runs listing returns every check suite's runs, so a workflow that cancels its in-progress run when a newer event starts it leaves the cancelled run beside its replacement; `filter=latest` collapses runs only within a suite. `_parse_rest_check_runs_payload` now drops a cancelled run when a later-started run of the same check exists. A cancelled run with no newer one still fails, and a failure is never dropped. PR #1599's checks read as 2 cancelled and failing before, and as passing after.

Closes #1602

* fix(telemetry): resetting the tracer waits for its exports, so no test's exports run on into the next (#1606)

`reset_tracer()`, which the autouse config fixture calls before and after every test, dropped the global tracer without shutting it down, so exports queued on its two-worker executor kept running into the next test. `tests/test_roadmap_dry_runs.py`'s dry-run test refuses connections process-wide and intermittently recorded those exports' connections to localhost:4318. The reset now calls `shutdown()` on the dropped tracer, which waits up to DEFAULT_OTEL_DRAIN_TIMEOUT_SECONDS for exports in flight and closes the executor.

The five-persona transient-503 review test also asserts the error its review recorded, so its own intermittent `failed` stage names its cause the next time it happens.

Closes #1604

* fix(tests): isolate KeyringBackend._classes registration across xdist workers (#1607)

keyring registers every concrete KeyringBackend subclass as a candidate for the rest of the process and picks the highest-priority viable one when it next detects a backend; a ChainerBackend also takes its members from get_viable_backends(). Test doubles in tests/test_config_cmd.py therefore became later tests' keyrings in the same xdist worker: `FakeChainer` (priority 10) made writes fail with "'EncryptedKeyring' object has no attribute 'set_password'" (test_k8s_bootstrap_openwebui), and `Raising` (priority 1, KeyringLocked) made reads warn that the keyring was locked (test_review_embeddings_unserved, test_roadmap_refine). An autouse fixture (tests/keyring_isolation.py) unregisters the backend classes each test defines and restores keyring's chosen backend.

Closes #1601

* feat(review): zizmor's workflow findings reach code scanning through devops scan report, and reviews run it (#1610)

`ZizmorScanner` (security/zizmor.py) registers zizmor with the default scanner registry, built on the same offline command and JSON parser `devops scan workflows` uses. It applies where the target has a `.github/workflows` directory, or, for a list of files, to its workflow and action files, and an isolated review scan hands it `--config` with no rules changed (#972). Its findings are non-gating, so `devops scan report` and its SARIF publish all of them while `devops scan workflows` stays the gate. Finding titles are `[<audit>] <description>`, so `extract_rule_id` gives SARIF the audit's name as its rule ID. On this repository the SARIF carries the 26 non-gated findings under the `zizmor` tool and the report exits 0.

Closes #1608

* feat(review): grounded per-group model analysis and plan verified with G10 checks (#1147) (#1611)

* fix(telemetry): aggregate delta metrics via OTel SDK MeterProvider and use prometheus-client (#792) (#1612)

* feat(k8s): qdrant metrics with an authenticated scrape, and its dashboard row restored (#823) (#1613)

* fix(ci): the v0.2.36 release pull request's checks pass: the service image takes Debian security updates, checkouts keep no credentials, and zizmor's self-repository audit waits for actionlint (#1616)

- Service Image: Trivy failed on CVE-2026-8286, CVE-2026-8927 and CVE-2026-92392 in libcurl3t64-gnutls 8.14.1-2+deb13u5. The Dockerfile already runs `apt-get upgrade`, but the build reused that layer from the GitHub Actions cache, made before Debian published deb13u7. The final stage is named `service` and the three service-image builds pass `no-cache-filters: service`; a fresh upgrade of the same base installs deb13u7.
- zizmor artipacked (release PR threads): every actions/checkout sets persist-credentials, false except release.yml's release job, which pushes its tag; tests/test_workflow_contracts.py checks that only a job running `git push` keeps them.
- zizmor self-repository (release PR threads): `.github/zizmor.yml` disables the audit, whose `$/<path>` form actionlint 1.7.12 rejects ("ref is missing").
- The five-persona transient-503 stall test (#1609) records any gateway request that bypasses its fake transport, by method and path, and asserts there are none, so its intermittent CI failure ("Cannot connect to AI provider API") names the request next time.

* chore(release): cut v0.2.36 — version 0.2.36, the changelog fragments collected and the roadmap rendered (#1614)

The changes `devops roadmap close --confirm` makes when it cuts v0.2.36, produced by its own `cut_release` (`is_prepare=True`, `sync_docs=False`, and the close job's docs/ROADMAP.md render as its edit) from release/v0.2.36 at 414a290, as a pull request instead of the cut's commit and push to the release branch: pyproject.toml and uv.lock at 0.2.36, the 24 changelog.d fragments collected into CHANGELOG.md's [0.2.36] - 2026-10-17 section and deleted, and docs/ROADMAP.md rendered from GitHub.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant