Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 13 additions & 14 deletions api/network/v1alpha1/egresspolicy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ import (
// of an egress flow is an arbitrary internet address, not a pre-configured
// backend list.
//
// It is namespaced (deployed to galactic-system) and tenant-writable; like
// NetworkService's vpcRef, vpcRef/vpcAttachmentRef are opaque string identifiers
// because this kind carries identifiers from the VPC API in
// api/cloud/v1alpha1 without a Kubernetes object reference. An admission webhook (implemented by the consuming controller) must
// verify the requester is authorized for vpcRef/vpcAttachmentRef before a
// policy is accepted — see the Accepted condition.
// It is namespaced (deployed to galactic-system), and RBAC on the namespace
// decides who may write it. Like NetworkService's vpcRef, vpcRef and
// vpcAttachmentRef are opaque string identifiers because this kind carries
// identifiers from the VPC API in api/cloud/v1alpha1 without a Kubernetes
// object reference. Galactic does not check that the writer is authorized for
// them, and nothing in this repository sets the Accepted condition.
//
// Presence of an accepted NetworkEgressPolicy resolves only *enablement*
// Presence of a NetworkEgressPolicy resolves only *enablement*
// (should this tenant's VRF get an egress route toward the shared
// translation tier at all) — unlike this type's original design (superseded), there is
// no single "assigned gateway node" to compute or pin: any EgressShard may
Expand Down Expand Up @@ -50,16 +50,15 @@ type NetworkEgressPolicy struct {
type NetworkEgressPolicySpec struct {
// VPCRef is the opaque identifier of the target VPC this policy applies
// to. This repo does not own the VPC API and does not validate the
// identifier beyond non-emptiness; the admission webhook of the
// consuming controller is responsible for verifying the requester is
// authorized for this VPC before the policy is accepted.
// identifier beyond non-emptiness, or check that the writer is
// authorized for this VPC.
// +kubebuilder:validation:Required
// +kubebuilder:validation:MinLength=1
VPCRef string `json:"vpcRef"`

// VPCAttachmentRef is the opaque identifier of the target
// VPCAttachment this policy applies to. Like VPCRef, this is an opaque
// string reference validated by the admission webhook, not by this API.
// string reference that this API checks only for non-emptiness.
// +kubebuilder:validation:Required
// +kubebuilder:validation:MinLength=1
VPCAttachmentRef string `json:"vpcAttachmentRef"`
Expand All @@ -72,9 +71,9 @@ type NetworkEgressPolicyStatus struct {
// +optional
ObservedGeneration int64 `json:"observedGeneration,omitempty"`

// Conditions contains the standard conditions for this resource,
// including Accepted (see AcceptedReasonOwnershipVerified /
// AcceptedReasonOwnershipDenied in rule_types.go, reused as-is here).
// Conditions contains the standard conditions for this resource. Nothing
// in this repository sets them. Accepted, when set, uses the ownership
// reasons shared with NetworkService (see AcceptedReasonOwnershipVerified).
//
// +listType=map
// +listMapKey=type
Expand Down
37 changes: 21 additions & 16 deletions api/network/v1alpha1/networkservice_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,28 +39,34 @@ const (
NetworkServiceProtocolICMP NetworkServiceProtocol = "icmp"
)

// Accepted reasons — used as Accepted.Reason on NetworkService (and reused by
// NetworkEgressPolicy), set by the admission webhook that verifies the
// requester is authorized for the VPC resources the object references.
// Ownership reasons for the Accepted condition on NetworkService and
// NetworkEgressPolicy, reserved for an admission check that verifies the
// requester is authorized for the VPC resources the object references. No such
// check runs in this repository and nothing sets these reasons. On a
// NetworkService, Accepted reports only that a gateway node is registered in
// its namespace.
const (
// AcceptedReasonOwnershipVerified indicates admission verified the
// requester is authorized for the VPC resources the object references.
// AcceptedReasonOwnershipVerified is reserved for an admission check that
// found the requester authorized for the VPC resources the object
// references.
AcceptedReasonOwnershipVerified string = "OwnershipVerified"

// AcceptedReasonOwnershipDenied indicates admission rejected the object
// because the requester is not authorized for the VPC resources it
// references.
// AcceptedReasonOwnershipDenied is reserved for an admission check that
// rejected the object because the requester is not authorized for the VPC
// resources it references.
AcceptedReasonOwnershipDenied string = "OwnershipDenied"
)

// NetworkService defines ingress load-balancing for a single tenant VPC, served
// by every NetworkGateway node identically (anycast Direct Server Return —
// see NetworkGateway's doc comment). It is namespaced (deployed to
// galactic-system) and tenant-writable; vpcRef is an opaque string identifier
// because this kind carries identifiers from the VPC API in
// api/cloud/v1alpha1 without a Kubernetes object reference. An admission webhook (implemented by the consuming controller) must
// verify the requester is authorized for vpcRef before a service is accepted —
// see the Accepted condition.
// galactic-system) and written by the platform API that serves tenants, which
// verifies the tenant owns vpcRef before it writes the service; RBAC on the
// namespace decides who else may write it. vpcRef is an opaque string
// identifier because this kind carries identifiers from the VPC API in
// api/cloud/v1alpha1 without a Kubernetes object reference. Accepted is set
// once a gateway node is registered in the namespace and is not an ownership
// check.
//
// Unlike the earlier Full-NAT design this type originally described, there
// is no primary/secondary gateway node for a service: every NetworkGateway
Expand Down Expand Up @@ -101,9 +107,8 @@ type NetworkService struct {
type NetworkServiceSpec struct {
// VPCRef is the opaque identifier of the target VPC this service applies
// to. This repo does not own the VPC API and does not validate the
// identifier beyond non-emptiness; the admission webhook of the
// consuming controller is responsible for verifying the requester is
// authorized for this VPC before the service is accepted.
// identifier beyond non-emptiness. The platform API that serves tenants
// verifies the tenant owns this VPC before it writes the service.
// +kubebuilder:validation:Required
// +kubebuilder:validation:MinLength=1
VPCRef string `json:"vpcRef"`
Expand Down
27 changes: 13 additions & 14 deletions config/crd/galactic.datumapis.com_networkegresspolicies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ spec:
of an egress flow is an arbitrary internet address, not a pre-configured
backend list.

It is namespaced (deployed to galactic-system) and tenant-writable; like
NetworkService's vpcRef, vpcRef/vpcAttachmentRef are opaque string identifiers
because this kind carries identifiers from the VPC API in
api/cloud/v1alpha1 without a Kubernetes object reference. An admission webhook (implemented by the consuming controller) must
verify the requester is authorized for vpcRef/vpcAttachmentRef before a
policy is accepted — see the Accepted condition.
It is namespaced (deployed to galactic-system), and RBAC on the namespace
decides who may write it. Like NetworkService's vpcRef, vpcRef and
vpcAttachmentRef are opaque string identifiers because this kind carries
identifiers from the VPC API in api/cloud/v1alpha1 without a Kubernetes
object reference. Galactic does not check that the writer is authorized for
them, and nothing in this repository sets the Accepted condition.

Presence of an accepted NetworkEgressPolicy resolves only *enablement*
Presence of a NetworkEgressPolicy resolves only *enablement*
(should this tenant's VRF get an egress route toward the shared
translation tier at all) — unlike this type's original design (superseded), there is
no single "assigned gateway node" to compute or pin: any EgressShard may
Expand Down Expand Up @@ -83,16 +83,15 @@ spec:
description: |-
VPCAttachmentRef is the opaque identifier of the target
VPCAttachment this policy applies to. Like VPCRef, this is an opaque
string reference validated by the admission webhook, not by this API.
string reference that this API checks only for non-emptiness.
minLength: 1
type: string
vpcRef:
description: |-
VPCRef is the opaque identifier of the target VPC this policy applies
to. This repo does not own the VPC API and does not validate the
identifier beyond non-emptiness; the admission webhook of the
consuming controller is responsible for verifying the requester is
authorized for this VPC before the policy is accepted.
identifier beyond non-emptiness, or check that the writer is
authorized for this VPC.
minLength: 1
type: string
required:
Expand All @@ -106,9 +105,9 @@ spec:
properties:
conditions:
description: |-
Conditions contains the standard conditions for this resource,
including Accepted (see AcceptedReasonOwnershipVerified /
AcceptedReasonOwnershipDenied in rule_types.go, reused as-is here).
Conditions contains the standard conditions for this resource. Nothing
in this repository sets them. Accepted, when set, uses the ownership
reasons shared with NetworkService (see AcceptedReasonOwnershipVerified).
items:
description: Condition contains details for one aspect of the current
state of this API Resource.
Expand Down
17 changes: 9 additions & 8 deletions config/crd/galactic.datumapis.com_networkservices.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,13 @@ spec:
NetworkService defines ingress load-balancing for a single tenant VPC, served
by every NetworkGateway node identically (anycast Direct Server Return —
see NetworkGateway's doc comment). It is namespaced (deployed to
galactic-system) and tenant-writable; vpcRef is an opaque string identifier
because this kind carries identifiers from the VPC API in
api/cloud/v1alpha1 without a Kubernetes object reference. An admission webhook (implemented by the consuming controller) must
verify the requester is authorized for vpcRef before a service is accepted —
see the Accepted condition.
galactic-system) and written by the platform API that serves tenants, which
verifies the tenant owns vpcRef before it writes the service; RBAC on the
namespace decides who else may write it. vpcRef is an opaque string
identifier because this kind carries identifiers from the VPC API in
api/cloud/v1alpha1 without a Kubernetes object reference. Accepted is set
once a gateway node is registered in the namespace and is not an ownership
check.

Unlike the earlier Full-NAT design this type originally described, there
is no primary/secondary gateway node for a service: every NetworkGateway
Expand Down Expand Up @@ -234,9 +236,8 @@ spec:
description: |-
VPCRef is the opaque identifier of the target VPC this service applies
to. This repo does not own the VPC API and does not validate the
identifier beyond non-emptiness; the admission webhook of the
consuming controller is responsible for verifying the requester is
authorized for this VPC before the service is accepted.
identifier beyond non-emptiness. The platform API that serves tenants
verifies the tenant owns this VPC before it writes the service.
minLength: 1
type: string
required:
Expand Down
2 changes: 1 addition & 1 deletion docs/agents/ARCHITECTURE-GATEWAY.md
Original file line number Diff line number Diff line change
Expand Up @@ -1037,7 +1037,7 @@ that tag into `config/galactic-gateway/base`.
## Known Constraints

- **E2E coverage is lab-only.** `task verify:gateway-ingress` and `task verify:gateway-ingress-ipv4` in `deploy/containerlab/` send real traffic through every lab gateway node (see [Testing](#testing)). Before it, the `gatewayDatapathKeepAlive` incident described in [Entry Points](#cmd-galactic-gatewaygateway-go--datapath-setup) above was only discovered because ingress traffic silently stopped being intercepted. Nothing runs that check in CI, since it needs the containerlab lab.
- **Galactic does not check VPC ownership on `NetworkService`.** `NetworkService` is internal: the platform API that serves tenants verifies the tenant owns `vpcRef` before it writes the rule, and RBAC on `galactic-system` decides who else can write one. `updateAcceptedCondition` sets `Accepted=True` once gateway nodes exist for the namespace; it is not an ownership result. galactic-router used to carry an allow-all admission webhook for this, never deployed, removed in #366. The `api/network/v1alpha1` doc comments still call the CRD tenant-writable and define `OwnershipVerified`/`OwnershipDenied` reasons nothing sets.
- **Galactic does not check VPC ownership on `NetworkService`.** `NetworkService` is internal: the platform API that serves tenants verifies the tenant owns `vpcRef` before it writes the rule, and RBAC on `galactic-system` decides who else can write one. `updateAcceptedCondition` sets `Accepted=True` once gateway nodes exist for the namespace; it is not an ownership result. galactic-router used to carry an allow-all admission webhook for this, never deployed, removed in #366. The `OwnershipVerified`/`OwnershipDenied` reasons in `api/network/v1alpha1` are reserved, and nothing sets them.
- **The uSID backend resolver's tenant-ownership check depends on `BGPVRFInstance` naming staying deterministic.** `verifyTenantOwnership` closes the ambiguous-match gap an earlier version of this resolver had, but it is only as strong as `crdnames.BGPVRFInstanceName(vpc, nodeName)` staying the exact name `galactic-bgp` writes — a divergence between the two would fail closed (a real backend never resolving) rather than open (a wrong-tenant resolve), which is the safer failure direction but still worth knowing about when either side of that naming contract changes.
- **The derived SRv6 encap source is read once, at startup.** Changing a gateway node's `BGPRouter` locator or node ID does not move its encapsulation source until `galactic-gateway` restarts. See [SRv6 encap-source address](#srv6-encap-source-address) above.
- **`edge_return` sends no ICMP for an oversized reply.** `edge_lb` answers a packet too big for the fabric once encapsulated: an IPv6 client with a Packet Too Big (`send_too_big6`), an IPv4 client that set Don't Fragment with a Fragmentation Needed (`send_frag_needed4`, for a header without options, which is all a fixed-size quote covers). An IPv4 packet without Don't Fragment, or with options, is counted as `fib_frag_needed` and dropped: a router would fragment the first, which XDP cannot. `edge_return` drops an oversized reply the same way for both families; the backend's MSS clamp keeps TCP replies under the fabric MTU. ICMP a client sends to a VIP is not claimed, so path MTU discovery from the client toward a backend is not relayed.
Expand Down
Loading
Loading