vxpu/pki: mint CA and coordinator/agent SPIFFE certs from a Job #855
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.45) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.45 · 413 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.361
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #855"
general
weight: 0.35
codebot-robot
Implements the Kubernetes Job half of agent mutual TLS bootstrapping
(#662, #852): minting the certificate authority and workload SPIFFE
certificates without changing any existing network connections yet. The
local-directory command for single-machine use without a cluster is split
out to a follow-up pull request to keep this change focused and small.
Approach:
vxpu/pkg/pkiusing only the Go standard library (crypto/ecdsaP-256,
crypto/x509) andk8s.io/client-gowith no new dependencies.vxpu-ca, 1-year default TTL, path length 0)and leaf certificates (30-day default TTL) carrying a single SPIFFE URI
SAN and no DNS or IP SANs so SPIRE or another issuer can replace this
Job later:
- coordinator:
spiffe://<trust-domain>/ns/<ns>/sa/vxpu-routerwithClientAuthEKU (vxpu-coordinator-tls),- pod agents:
spiffe://<trust-domain>/ns/<ns>/sa/vxpu-agentwithServerAuthEKU (vxpu-agent-tls).vxpu-ca(ca.crt,ca.key) in a dedicatedvxpu-pkinamespace so the router cannot mount it onto pods in the workload
namespace, and refuse configurations where the CA and workload
namespaces match or where an existing
vxpu-cais malformed or expired.against the current CA, matching private key, expected SPIFFE ID and
EKU, and expiry. Valid leaves stay unchanged (
status="kept"); stalevxpu-ca-bundleConfigMaps are updated to the current CA(
status="updated"), and missing, expired, mismatched, or wrong-CAleaves are minted from
vxpu-ca(status="created"orstatus="re-minted"with the reason). Log identities, expiries,status, and reason via
klog, never key material.vxpu/images/pki-init/Dockerfile(golang:1.27.4builder,distroless nonroot UID 65532),
vxpu/k8s/pki-init.yaml(least-privilege namespaced RBAC with scoped
updateon the workloadConfigMap and leaf Secrets only, zero-RBAC
vxpu-agentServiceAccount,hardened Job), unit tests in
vxpu/pkg/pki/pki_test.go, kind e2ecoverage in
vxpu/tests/e2e/pki_test.go, and a trust-model section invxpu/docs/design.md.Verification:
ap generate --verify //...,ap lint vxpu, andap test vxpupass.vxpu-pki-init:e2eand verified three Job runs in kind(
kindest/node:v1.37.0) withvxpu/k8s/pki-init.yamland the routerRBAC from
vxpu/cmd/vxpu/router.yaml:1. Initial mint created
vxpu-ca,vxpu-ca-bundle(no private key),vxpu-coordinator-tls, andvxpu-agent-tls;kubectl auth can-ireturnedget secret/vxpu-ca -n vxpu-pki
noforvxpu-router,vxpu-agent, anddefault, andyesforvxpu-pki-init.2. Deleting
vxpu-agent-tlsand re-running keptvxpu-ca,vxpu-ca-bundle, andvxpu-coordinator-tlsunchanged and recreatedvxpu-agent-tls.3. Deleting
vxpu-cawhile leaving the old bundle and leaves in placeand re-running minted a new CA, updated
vxpu-ca-bundle, andre-minted both leaves with
status="re-minted"and the verificationfailure reason in the Job logs (zero key material logged).
go test -c ./tests/e2ecompiles cleanly; the fullap-e2e-vxpupresubmit runs
testPKIInitinsideTestE2E.Fixes #852