Repository navigation
fix(k8s): probe the ghostunnel sidecars on their status port, not their TLS port - #830
Conversation
…ir TLS port Each sidecar's readiness probe was a tcpSocket connect to its TLS port, which ghostunnel logs as a failed TLS handshake: one line every 5 s per sidecar, hiding real TLS errors. Each sidecar now serves --status on its own port (8453 beside the supervisor; 8454 and 8455 beside the relay's attach and exec sidecars), and the probe is GET /_metrics there. /_metrics dials nothing, where /_status would open a connection to the target on every probe. No NetworkPolicy admits the status ports. Closes rossoctl#724 Assisted-By: Claude Code Signed-off-by: Rong Chang <[email protected]>
clawgenti
left a comment
There was a problem hiding this comment.
All checks pass. Ready for human review.
Summary
Reviewed all four overlay patches (ocp, ocp-single/routes, ocp/p4-relay, ocp-sbx/exec-tls), both test suites and the README change against the base manifests. The change is consistent across overlays: each sidecar gains --status http://0.0.0.0:<port> plus a named status containerPort, and its readiness probe becomes httpGet /_metrics on that port instead of a tcpSocket connect to the TLS port. Port names stay unique per pod (status/status-exec), the TS and shell tests assert the exact args, ports and probe shape, and the README's node-CIDR fallback caveat in the PR body matches the existing fallback policy (which never admitted the TLS ports either). No findings.
Author: webchang (MEMBER — maintainer)
Areas reviewed: Helm/K8s, Shell, YAML, Docs, Tests
Agent/IDE config (.claude/.vscode): none
Commits: 1 commit, all signed-off: yes
CI status: passing (18/18)
Generated by RepoMan github-pr-review@235a7f7 (https://github.com/rossoctl/agent-skills/blob/235a7f7620139ee3e4ab0872b8439591fe52e8c1/skills/github-pr-review/SKILL.md).
clawgenti
left a comment
There was a problem hiding this comment.
(Marker for the review above: #830 (review))
Generated by RepoMan github-pr-review@235a7f7 (https://github.com/rossoctl/agent-skills/blob/235a7f7620139ee3e4ab0872b8439591fe52e8c1/skills/github-pr-review/SKILL.md).
ingpaolodettori-dev
left a comment
There was a problem hiding this comment.
Swapping the ghostunnel sidecars' tcpSocket probes for httpGet /_metrics on a dedicated --status port looks right, and /_metrics over /_status avoids an empty backend connection every 5 s.
Checked: kubectl kustomize of ocp, ocp-sbx and ocp-combined renders the new ports/probes with no container-port or port-name collisions (ocp-combined's relay pod carries both sidecars: 8444/8454 and 8445/8455); no rendered NetworkPolicy has a port-less ingress rule that would admit 8453–8455, so default-deny does keep them off the pod network. Tests pin the args, ports and exact probe. CI is green.
One suggestion (§10 node-CIDR fallback should list the status ports) and one nit inline. Not validated on a live OpenShift cluster, as the PR notes.
Assisted-By: Claude Code
| `overlays/ocp/kustomization.yaml`. Each ghostunnel sidecar's readiness probe is `GET /_metrics` on | ||
| its own status port (`--status`; 8453 beside the supervisor, 8454 and 8455 beside the relay's attach | ||
| and exec sidecars), never a TCP connect to its TLS port, which logged a handshake error every 5 s. | ||
| `/_metrics` dials nothing (`/_status` would open a connection to the target on every probe), and |
There was a problem hiding this comment.
suggestion: The PR body says a cluster that needs the node-CIDR fallback for probes should list the status port in that policy too, but §10 ("Kubelet probes and the node-CIDR fallback") still names only 8081 and 8080. Worth adding 8453/8454/8455 there (or a pointer from this paragraph), so an operator on a filtering CNI doesn't end up with sidecars stuck NotReady.
There was a problem hiding this comment.
Done in dadb9df. Section 10's node-CIDR fallback now has a paragraph after the policy: on OpenShift the ghostunnel sidecars are probed on 8453 (supervisor) and 8454/8455 (relay), so a cluster that needs the fallback adds sandbox-relay to the selector and those three ports to the rule, or the sidecars stay NotReady. Section 3's paragraph points to it.
Assisted-By: Claude Code
| its own status port (`--status`; 8453 beside the supervisor, 8454 and 8455 beside the relay's attach | ||
| and exec sidecars), never a TCP connect to its TLS port, which logged a handshake error every 5 s. | ||
| `/_metrics` dials nothing (`/_status` would open a connection to the target on every probe), and | ||
| no NetworkPolicy admits the status ports, so only the kubelet's probes reach them. Docker Hub is the project's official channel; it does not |
There was a problem hiding this comment.
nit: this line is 140 characters, while the rest of the paragraph wraps at 100. Moving "Docker Hub is the project's official channel…" onto the next line fixes it. The §1 port table ("8443 ghostunnel (OCP)") could also mention 8453.
There was a problem hiding this comment.
Done in dadb9df. The 140-character line came from this PR's paragraph landing in the middle of the image sentence. The image and Docker Hub sentences are back together, and the status-port text is its own paragraph, wrapped at 100. The section 1 table lists 8453 its status (OCP) beside 8443, and the kubelet column says so too.
Assisted-By: Claude Code
… the image paragraph rewrapped Section 10's fallback names 8453-8455 for a cluster whose CNI filters the kubelet's probes, the section 1 table lists 8453, and the status-port text is its own paragraph (review suggestion and nit). Part of rossoctl#724 Assisted-By: Claude Code Signed-off-by: Rong Chang <[email protected]>
Takes upstream main at 1a7f41e (19 merges since 032c8f6): the sandbox idle lifetime across docs, control plane, clients and deploy (rossoctl#820, rossoctl#837, rossoctl#842, rossoctl#843), grant redemption (rossoctl#822), the lease-check log line (rossoctl#824), egress fixes (rossoctl#829, rossoctl#834), the mock wait (rossoctl#828), the deadline timer (rossoctl#835), the create rollback (rossoctl#832), multi refusals and the rossoctl#363 leftovers (rossoctl#833, rossoctl#838), the identity near-miss check (rossoctl#827), mocactl login errors (rossoctl#836), the ghostunnel probes (rossoctl#830), refusal-burst deferral (rossoctl#831), a sandbox-worker change (rossoctl#841) and the v0.11 doc truth (rossoctl#821). Conflicts (one): - deploy/sbx/README.md, the "Optional inputs" table. Upstream (rossoctl#843) rewrote the SBX_LIFETIME_DAYS row (the default idle lifetime, at most SBX_MAX_LIFETIME_DAYS) and added the SBX_MAX_LIFETIME_DAYS and SBX_LOWER_WORKSPACE_IDLE rows, which widened the table; the fork had added an SBX_GATE_RECORD_SCHEMA row at its end. Resolved by taking upstream's table whole and appending the fork's SBX_GATE_RECORD_SCHEMA row after SBX_PROFILE, then re-padding the table with prettier. The fork's env-file example line for SBX_GATE_RECORD_SCHEMA merged cleanly. Merged without markers, checked: setup.sh keeps the fork's SBX_GATE_RECORD_SCHEMA validation and its sbx-settings write (so it stays in the settings hash) beside upstream's SH_SANDBOX_MAX_LIFETIME_SECONDS; both ocp-sbx and ocp-combined patch-control-plane.yaml keep the optional SH_GATE_RECORD_SCHEMA from sbx-settings beside the new optional SH_SANDBOX_MAX_LIFETIME_SECONDS; setup.test.sh keeps the fork's cases beside upstream's. The fork's RUNBOOK, README and template-onboarding docs say nothing about sandbox lifetime, refusal bursts, login errors or the create rollback, so none needed a correction; GUIDE.md is unchanged and GUIDE.pdf is not regenerated. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Rong Chang <[email protected]>
Closes #724
What changed and why
Every ghostunnel sidecar's readiness probe was a
tcpSocketconnect to its TLS port. ghostunnel logs each one aserror on TLS handshake from …: EOF, so each sidecar wrote a line every 5 s, and real TLS errors were lost in them.ghostunnel TLS sidecars log a handshake error every 5 s from the TCP probe #724 offered two directions. This PR takes the first: probe somewhere other than the TLS port. Silencing the log (ghostunnel's
--quiet=handshake-errs) would also hide the real handshake errors, the thing the issue wants to keep visible.Each sidecar now serves ghostunnel's status endpoint on its own port (
--status http://0.0.0.0:<port>), and its readiness probe ishttpGet /_metricsthere:tls(supervisor)ocp,ocp-single/routesstatus)tls(relay attach)ocp/p4-relaystatus)tls-exec(relay exec)ocp-sbx/exec-tlsstatus-exec)/_metrics, not/_status: in v1.11.3,/_statusdials the target on every request to reportbackend_ok(and answers 503 when it can't). For the supervisor, whose comment says every connection to127.0.0.1:8080is handed off on its own, that would trade a log line for an empty connection every 5 s./_metricsdials nothing.Exposure: no NetworkPolicy admits the status ports, so the namespaces' default-deny keeps them off the pod network. The kubelet's probes reach them the way they reach the TLS ports today. If a cluster needs the README's node-CIDR fallback for probes, that policy should list the status port too.
deploy/k8s/README.md§3 says so in one paragraph.Validation
error on TLS handshake … EOFlines.deploy/k8s/overlays/ocpwithkubectl kustomizeand ran ghostunnel with the sidecar's rendered args, with only the paths and ports remapped to local ones. TenGET /_metricsprobes answered200and logged nothing. A real TLS client still reached the backend through the tunnel, and the backend saw exactly that one connection.packages/supervisor/test/k8s, withkubectlon thePATH): 105 passed. The three sidecar tests now assert the--statusargs, the status port and thehttpGetprobe. Run against these manifests, main's versions of those tests fail.deploy/sbx/tests/overlay.test.sh: a new check that both relay sidecars are probed on/_metricsof their own ports, and that neither has atcpSocketprobe.overlay-combined, anddeploy/k8sanddeploy/sbxsetup.test.sh, also pass.check-doc-links.py, shellcheck (-S warning) and pre-commit pass.Every commit is signed off (DCO).
Assisted-By: Claude Code