fix(installer): trust the corporate MITM CA in the k3d nodes (#424) - #453
Draft
shujaatTracebloc wants to merge 3 commits into
Draft
fix(installer): trust the corporate MITM CA in the k3d nodes (#424)#453shujaatTracebloc wants to merge 3 commits into
shujaatTracebloc wants to merge 3 commits into
Conversation
Proxy REACHABILITY reaches the nodes, but on a TLS-inspecting (break-and- inspect) network the nodes still don't TRUST the corporate CA, so every in-node containerd pull (rancher/k3s, ghcr.io, tracebloc images) fails x509 — then masked (helm runs without --wait) into a root-cause-free "an image couldn't be pulled." Enterprise/hospital archetype, all three OSes. - Inject the CA at create time: when TRACEBLOC_CA_BUNDLE (or CURL_CA_BUNDLE) is set, mount the bundle into every k3d node and write a registries.yaml pointing containerd at it per-registry (docker.io, registry-1.docker.io, ghcr.io), via the same --config/create path that already carries proxy env. Parity across scripts/lib/cluster.sh (Linux/macOS) and install-k8s.ps1 (Windows). A CA var set but unreadable fails loudly instead of silently skipping. - Name the env var where the user hits the wall: the TLS-interception preflight hint (both OSes), docs/INSTALL.md, and the PS -Help env-var list. - CA-aware diagnosis: detect x509 / "certificate signed by unknown authority" pull events and report a dedicated image_pull_ca state — "the cluster does not trust your network's TLS-inspection CA" + the exact remedy — instead of the generic pull error. Mirrored in summary.sh and Print-Summary. - New check-drift.sh parity check (_drift_ca_trust) so neither installer can drop the CA wiring for the other's OS. Tests: +8 cluster.bats, +3 summary.bats, +2 check-drift.bats, +8 Pester. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…-ca-trust # Conflicts: # scripts/manifest.sha256 # scripts/tests/install-k8s.Tests.ps1
…-ca-trust # Conflicts: # scripts/install-k8s.ps1 # scripts/manifest.sha256 # scripts/tests/check-drift.bats # scripts/tests/check-drift.sh # scripts/tests/install-k8s.Tests.ps1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #424.
Problem
Proxy reachability reaches the k3d nodes, but on a TLS-inspecting (break-and-inspect) network the nodes still don't trust the corporate CA — so every in-node containerd pull (rancher/k3s, ghcr.io, tracebloc images) fails x509. Because
helm upgraderuns without--waitthe failure is masked (companion #425) and surfaces as a root-cause-free "an image couldn't be pulled." This is the enterprise/hospital archetype, on all three OSes.Fix
1. Inject the CA at create time (the core fix). When
TRACEBLOC_CA_BUNDLE(orCURL_CA_BUNDLE) is set, mount the bundle into every k3d node (-v …:/etc/ssl/certs/tracebloc-mitm-ca.crt@all) and write aregistries.yaml(configs.<registry>.tls.ca_file) pointing containerd at it fordocker.io/registry-1.docker.io/ghcr.io, hooked into the same--config/create path that already carries proxy env. Parity acrosscluster.sh(Linux/macOS) andinstall-k8s.ps1(Windows). A CA var set but unreadable fails loudly, not silently.2. Name the env var where the user hits the wall. The TLS-interception preflight hint (both OSes),
docs/INSTALL.md, and the PS-Helpenv-var list.3. CA-aware diagnosis.
_diagnose_not_ready/Get-NotReadyStatedetectx509/ "certificate signed by unknown authority" pull events → a dedicatedimage_pull_castate → "the cluster does not trust your network's TLS-inspection CA" + the exact remedy (never the generic pull error). Mirrored insummary.shandPrint-Summary.Drift gate. New
check-drift.shparity check (_drift_ca_trust) so neither installer can drop the CA wiring for the other's OS.Design choices (as flagged)
TRACEBLOC_CA_BUNDLE, fall back toCURL_CA_BUNDLE.registries.yamlca_fileas primary (targets the actual registry-pull failure) plus mounting the bundle into the nodes so theca_filepath resolves.Acceptance criteria
registries.yaml+ node mount).Tests (+21)
cluster.bats+8 (resolver 4 cases, registries.yaml gen, create wires mount +--registry-config, no-CA path, unreadable→hard error),summary.bats+3 (x509→image_pull_ca, non-x509 staysimage_pull, report names CA+env var),check-drift.bats+2, Pester +8.Verified locally (CI-identical):
Note: a real break-and-inspect network can't be exercised in CI; the wiring is the documented k3d
registries.yaml+ node-mount mechanism and is unit-tested end-to-end.