Skip to content

Commit a46d086

Browse files
committed
docs(rfc): cover CNI contract versioning for mixed-version clusters
The cni-sidecar RFC described the cluster-singleton and its lifecycle but not how one node plugin version coexists with gateways spanning OpenShell versions. Add a Risks entry documenting the versioned CNI-to-pod contract: the gateway stamps openshell.ai/cni-contract-version and the node plugin fails closed on a version it does not implement (backward compatible within a major, absent = pre-versioning), with independent CNI lifecycle (cni.only) and node pools as the operator mitigations and RFC 0012 as the long-term home. Also update the CNI CHECK note: it now validates ruleset structure, not mere table/chain existence. Signed-off-by: Russell Bryant <rbryant@redhat.com>
1 parent 7c28a71 commit a46d086

1 file changed

Lines changed: 27 additions & 3 deletions

File tree

‎rfc/cni-sidecar-topology-DRAFT.md‎

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,27 @@ behavior is behind a default-off value.
442442
upgrade in place (the conflist patch preserves all other plugins). The
443443
singleton's `pods get` and `configmaps list` RBAC are cluster-scoped so it can
444444
discover marker ConfigMaps and read sandbox pods in any allowlisted namespace.
445+
- **Mixed-version clusters (CNI contract skew).** The singleton is one plugin
446+
version per node, but the gateways scheduling sandboxes onto that node may span
447+
OpenShell versions. Rather than assume compatibility, the CNI-to-pod contract
448+
(the pod annotations the plugin reads plus the ruleset shape it installs) is
449+
versioned. The gateway stamps `openshell.ai/cni-contract-version` on each
450+
cni-sidecar pod, and the node plugin **fails closed** — refuses CNI `ADD`, so
451+
the pod's network is not set up — when the pod requires a version the plugin
452+
does not implement. It accepts any version at or below its own (the plugin stays
453+
backward compatible within a contract-major) and treats an absent annotation as
454+
a pre-versioning gateway. A newer gateway running against an older singleton
455+
therefore fails safe — its sandboxes do not start — instead of running under a
456+
ruleset that does not match its expectations. Mitigations for operators: the
457+
plugin has an independent lifecycle (install it as its own `cni.only` release
458+
with every gateway `cni.external=true`), so it can be upgraded to a version that
459+
satisfies all gateways without touching them; where versions must be hard
460+
isolated, scope the DaemonSet with a `nodeSelector` and pin matching gateway
461+
versions to that node pool so incompatible versions never share a node.
462+
Same-node coexistence of two incompatible contract-majors is out of scope — it
463+
would require a per-major plugin fan-out — and cross-component version
464+
negotiation ultimately belongs to the Isolation Backend contract version
465+
(RFC 0012).
445466
- **Dependency on Multus aux chain.** `multus-chain` requires the Multus thick
446467
daemon to have `auxiliaryCNIChainName` set. It is default on OpenShift 4.x but
447468
not guaranteed everywhere. Mitigation: document the requirement; the chart does
@@ -460,9 +481,12 @@ behavior is behind a default-off value.
460481
- **SCC drift / cluster policy.** A cluster that further restricts SCC or blocks
461482
custom SCCs could reject the sandbox pod. Mitigation: the SCC is minimal and
462483
documented; the lower-privilege endpoint/L7 mode admits under `restricted-v2`.
463-
- **Non-destructive rule maintenance.** CNI `CHECK` is read-only (verifies the
464-
rules without reinstalling), and `ADD` applies the nft ruleset in a single
465-
atomic transaction (ensure→delete→recreate), so a failed apply/check never
484+
- **Non-destructive rule maintenance.** CNI `CHECK` is read-only and validates
485+
the installed ruleset's **structure** — the OUTPUT hook, the proxy-UID
486+
exemption, and TCP/UDP rejection across both address families — not merely that
487+
the table or chain exists, so a partially damaged or empty ruleset is caught
488+
instead of trusted. `ADD` applies the nft ruleset in a single atomic
489+
transaction (ensure→delete→recreate), so a failed apply/check never
466490
leaves a running pod with the table deleted-but-not-recreated. All Kubernetes
467491
API calls from the plugin/installer use bounded connect/request timeouts so an
468492
API stall cannot wedge CNI `ADD`, the coverage wait, or reconciliation.

0 commit comments

Comments
 (0)