From f8f30536ddaf1d6e6189c1149befab90a12f2aac Mon Sep 17 00:00:00 2001 From: Peter Sprygada Date: Mon, 30 Nov 2026 09:06:19 -0500 Subject: [PATCH 1/2] feat(masque)!: Ship a public listener instead of a Service The provider bundle shipped a ClusterIP Service that every deployment had to expose itself. It now ships no Service. The new component config/masque/provider/components/public-listener adds the ingress gVPC's EdgeService with ingress and egress traffic policies, an EdgeListener for UDP/443 and TCP/443 to port 8443, the provider's read access to that EdgeService, --listener-service and a 40-second grace period. Without the policies the EdgeService would deny all listener traffic. The overlay fills in the ingress gVPC's UID and /64 and the cell's VIPs before the first apply, since both EdgeService fields are immutable. The masque EdgeProvider now lists SocketAccess/v1 and PublicListener/v1. A cell without an ingress identity for masque gets an IngressIdentityMissing event, which the guide documents as expected. An envtest case creates the component's policies, EdgeService and EdgeListener against the CRDs. The MASQUE service guide explains the setup and what a deployment that used the old Service has to change. The design records Phase 5's provider and bundle work, and its example EdgeListener ports now match the CRD: lowercase protocols and no name field. BREAKING CHANGE: config/masque/provider no longer ships the masque-provider Service. An overlay that patches that Service fails to build, and one that relied on it must add its own Service or include the public-listener component. --- api/v1alpha1/masque_listener_bundle_test.go | 60 +++++++++++++++++++ config/masque/edgeprovider.yaml | 7 +++ .../public-listener/edgelistener.yaml | 28 +++++++++ .../public-listener/edgeservice.yaml | 30 ++++++++++ .../public-listener/kustomization.yaml | 42 +++++++++++++ .../components/public-listener/rbac.yaml | 27 +++++++++ .../public-listener/trafficpolicy.yaml | 41 +++++++++++++ config/masque/provider/kustomization.yaml | 7 ++- config/masque/provider/service.yaml | 24 -------- .../provider/kustomization.yaml | 2 +- docs/designs/edge-public-listener.md | 7 ++- docs/edge/masque-provider.md | 2 +- docs/edge/masque-service.md | 55 ++++++++++++++--- 13 files changed, 293 insertions(+), 39 deletions(-) create mode 100644 api/v1alpha1/masque_listener_bundle_test.go create mode 100644 config/masque/provider/components/public-listener/edgelistener.yaml create mode 100644 config/masque/provider/components/public-listener/edgeservice.yaml create mode 100644 config/masque/provider/components/public-listener/kustomization.yaml create mode 100644 config/masque/provider/components/public-listener/rbac.yaml create mode 100644 config/masque/provider/components/public-listener/trafficpolicy.yaml delete mode 100644 config/masque/provider/service.yaml diff --git a/api/v1alpha1/masque_listener_bundle_test.go b/api/v1alpha1/masque_listener_bundle_test.go new file mode 100644 index 000000000..620a6abec --- /dev/null +++ b/api/v1alpha1/masque_listener_bundle_test.go @@ -0,0 +1,60 @@ +// Copyright 2026 Datum Cloud, Inc. +// +// SPDX-License-Identifier: AGPL-3.0-or-later + +package v1alpha1_test + +import ( + "context" + "os" + "path/filepath" + "strings" + "testing" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/yaml" + + galacticv1alpha1 "go.datum.net/galactic/api/v1alpha1" +) + +// TestMASQUEPublicListenerBundle creates the EdgeService and EdgeListener +// that config/masque/provider/components/public-listener ships, so the +// bundle's placeholders stay valid against the CRDs an overlay patches. +func TestMASQUEPublicListenerBundle(t *testing.T) { + c, dyn := startAPIServer(t) + ctx := context.Background() + dir := filepath.Join("..", "..", "config", "masque", "provider", "components", "public-listener") + + ns := &unstructured.Unstructured{Object: map[string]any{ + "apiVersion": "v1", "kind": "Namespace", "metadata": map[string]any{"name": "galactic-system"}, + }} + if _, err := dyn.Resource(schema.GroupVersionResource{Version: "v1", Resource: "namespaces"}). + Create(ctx, ns, metav1.CreateOptions{}); err != nil { + t.Fatal(err) + } + for _, f := range []struct { + file string + obj func() client.Object + }{ + {"trafficpolicy.yaml", func() client.Object { return &galacticv1alpha1.TrafficPolicy{} }}, + {"edgeservice.yaml", func() client.Object { return &galacticv1alpha1.EdgeService{} }}, + {"edgelistener.yaml", func() client.Object { return &galacticv1alpha1.EdgeListener{} }}, + } { + b, err := os.ReadFile(filepath.Join(dir, f.file)) + if err != nil { + t.Fatal(err) + } + for i, doc := range strings.Split(string(b), "\n---\n") { + obj := f.obj() + if err := yaml.UnmarshalStrict([]byte(doc), obj); err != nil { + t.Fatalf("%s document %d: %v", f.file, i, err) + } + if err := c.Create(ctx, obj); err != nil { + t.Fatalf("%s document %d is not admitted: %v", f.file, i, err) + } + } + } +} diff --git a/config/masque/edgeprovider.yaml b/config/masque/edgeprovider.yaml index 29ed10b15..f433b88d7 100644 --- a/config/masque/edgeprovider.yaml +++ b/config/masque/edgeprovider.yaml @@ -7,11 +7,18 @@ metadata: spec: contractVersions: - v1alpha1 + # PacketAccess and PrefixReachability serve connectors. SocketAccess and + # PublicListener serve the provider's public listener, whose EdgeService + # provider/components/public-listener adds. capabilities: - name: PacketAccess version: v1 - name: PrefixReachability version: v1 + - name: SocketAccess + version: v1 + - name: PublicListener + version: v1 serviceAccounts: - namespace: masque-system name: masque-provider diff --git a/config/masque/provider/components/public-listener/edgelistener.yaml b/config/masque/provider/components/public-listener/edgelistener.yaml new file mode 100644 index 000000000..7025e1c57 --- /dev/null +++ b/config/masque/provider/components/public-listener/edgelistener.yaml @@ -0,0 +1,28 @@ +# CONNECT-IP over HTTP/3 on UDP/443 and over HTTP/2 on TCP/443, both to the +# provider's port 8443. The addresses are documentation placeholders: an +# overlay sets one IPv6 and one IPv4 address from the cell's gateway VIP +# prefixes (galactic-controller --edge-listener-vip-prefixes). The gateway +# health check probes TCP 8443 on each listener attachment. +apiVersion: galactic.datumapis.com/v1alpha1 +kind: EdgeListener +metadata: + name: masque-public + namespace: galactic-system +spec: + providerRef: + name: masque + serviceRef: + namespace: galactic-system + name: masque-ingress + addresses: + - 2001:db8::443 + - 192.0.2.43 + ports: + - protocol: udp + port: 443 + backendPort: 8443 + - protocol: tcp + port: 443 + backendPort: 8443 + sessionAffinity: ClientIPAndProtocol + failurePolicy: FailClosed diff --git a/config/masque/provider/components/public-listener/edgeservice.yaml b/config/masque/provider/components/public-listener/edgeservice.yaml new file mode 100644 index 000000000..1c37b5246 --- /dev/null +++ b/config/masque/provider/components/public-listener/edgeservice.yaml @@ -0,0 +1,30 @@ +# Grants the masque provider's listener attachments in its ingress gVPC. +# vpcRef.uid and clientPool are placeholders an overlay must replace before +# the first apply: both are immutable once the object exists, so an +# EdgeService created with the placeholders has to be deleted and created +# again. Read them from the ingress gVPC, which galactic-controller creates +# without this component, with +# kubectl -n galactic-system get vpc edge-ingress-masque \ +# -o jsonpath='{.metadata.uid} {.spec.networks[0]}' +# The pool may be the gVPC's whole /64. trafficpolicy.yaml holds the +# policies it binds. +apiVersion: galactic.datumapis.com/v1alpha1 +kind: EdgeService +metadata: + name: masque-ingress + namespace: galactic-system +spec: + providerRef: + name: masque + vpcRef: + name: edge-ingress-masque + uid: 00000000-0000-0000-0000-000000000000 + capabilities: + - SocketAccess + - PublicListener + clientPool: fd00:ffff::/64 + trafficPolicy: + ingressPolicyRef: + name: masque-listener-ingress + egressPolicyRef: + name: masque-listener-egress diff --git a/config/masque/provider/components/public-listener/kustomization.yaml b/config/masque/provider/components/public-listener/kustomization.yaml new file mode 100644 index 000000000..4216b5c94 --- /dev/null +++ b/config/masque/provider/components/public-listener/kustomization.yaml @@ -0,0 +1,42 @@ +# Serve the provider through the cell's public listener (PublicListener/v1, +# docs/designs/edge-public-listener.md) instead of a Service. Include it from +# the overlay of config/masque/provider: +# +# resources: +# - ../../config/masque/provider +# components: +# - ../../config/masque/provider/components/public-listener +# +# It adds the ingress gVPC's EdgeService and its traffic policies, the +# EdgeListener that serves it on the cell's gateway VIPs and the provider's +# read access to that EdgeService, and starts the provider with +# --listener-service. Before the first apply the overlay replaces the +# per-cell placeholders: the EdgeService's vpcRef.uid and clientPool, read +# from the edge-ingress-masque VPC that galactic-controller creates once +# --edge-ingress-identity names masque, and the EdgeListener's addresses +# (docs/edge/masque-service.md). +# +# The objects name their namespaces, galactic-system and masque-system, and +# reference each other by them. An overlay that sets namespace: rewrites +# them and breaks those references. +apiVersion: kustomize.config.k8s.io/v1alpha1 +kind: Component +resources: + - trafficpolicy.yaml + - edgeservice.yaml + - edgelistener.yaml + - rbac.yaml +patches: + # The pod serves on its listener attachment, not the pod network, and + # keeps serving for 5 seconds after it stops taking new flows, so its + # shutdown needs up to 30 seconds after SIGTERM. + - target: + kind: Deployment + name: masque-provider + patch: |- + - op: add + path: /spec/template/spec/containers/0/args/- + value: --listener-service=galactic-system/masque-ingress + - op: replace + path: /spec/template/spec/terminationGracePeriodSeconds + value: 40 diff --git a/config/masque/provider/components/public-listener/rbac.yaml b/config/masque/provider/components/public-listener/rbac.yaml new file mode 100644 index 000000000..cd75a80f3 --- /dev/null +++ b/config/masque/provider/components/public-listener/rbac.yaml @@ -0,0 +1,27 @@ +# masque-provider reads the one EdgeService its --listener-service names, +# for the UID its listener attachment pins. An overlay that renames the +# EdgeService renames it here too. +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: masque-provider-listener + namespace: galactic-system +rules: + - apiGroups: [galactic.datumapis.com] + resources: [edgeservices] + resourceNames: [masque-ingress] + verbs: [get] +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: masque-provider-listener + namespace: galactic-system +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: masque-provider-listener +subjects: + - kind: ServiceAccount + name: masque-provider + namespace: masque-system diff --git a/config/masque/provider/components/public-listener/trafficpolicy.yaml b/config/masque/provider/components/public-listener/trafficpolicy.yaml new file mode 100644 index 000000000..8b60489e2 --- /dev/null +++ b/config/masque/provider/components/public-listener/trafficpolicy.yaml @@ -0,0 +1,41 @@ +# The listener attachments receive the gateways' public listener traffic and +# answer it, and the TCP health probes their own node sends to the backend +# port from its host-side link-local address, and nothing else. Without a +# policy an EdgeService denies everything in that direction. +apiVersion: galactic.datumapis.com/v1alpha1 +kind: TrafficPolicy +metadata: + name: masque-listener-ingress + namespace: galactic-system +spec: + rules: + - name: allow-listener + action: Allow + match: + path: PublicService + - name: allow-health-probe + action: Allow + match: + path: Private + protocol: TCP + sourceCIDRs: ["fe80::/10"] + destinationPorts: [{start: 8443, end: 8443}] +--- +apiVersion: galactic.datumapis.com/v1alpha1 +kind: TrafficPolicy +metadata: + name: masque-listener-egress + namespace: galactic-system +spec: + rules: + - name: allow-listener-replies + action: Allow + match: + path: PublicService + - name: allow-health-probe-replies + action: Allow + match: + path: Private + protocol: TCP + destinationCIDRs: ["fe80::/10"] + sourcePorts: [{start: 8443, end: 8443}] diff --git a/config/masque/provider/kustomization.yaml b/config/masque/provider/kustomization.yaml index 807d3406e..8af2816c8 100644 --- a/config/masque/provider/kustomization.yaml +++ b/config/masque/provider/kustomization.yaml @@ -2,8 +2,10 @@ # applied as-is. An overlay appends --authority with the name clients use, # supplies the masque-provider-tls Secret (tls.crt, tls.key) for that name # and the masque-authority-ca ConfigMap (ca.crt) the grant authority's -# certificate chains to, and chooses how the masque-provider Service is -# exposed. It may also set the TUN device plugin's resource name. +# certificate chains to, and chooses how clients reach the pods: through +# the cell's public listener with components/public-listener, or through +# a Service of its own. The bundle ships no Service. It may also set the +# TUN device plugin's resource name. # # With the authority's components/cert-manager, include components/cert-manager # here to trust the CA that issued it. A CA published under another name is @@ -11,4 +13,3 @@ # (docs/edge/masque-service.md). resources: - deployment.yaml - - service.yaml diff --git a/config/masque/provider/service.yaml b/config/masque/provider/service.yaml deleted file mode 100644 index 38888a389..000000000 --- a/config/masque/provider/service.yaml +++ /dev/null @@ -1,24 +0,0 @@ -# CONNECT-IP over HTTP/3 on UDP/443, and over HTTP/2 on TCP/443 for clients -# whose UDP is blocked. ClusterIP is a placeholder: an overlay exposes it, -# for example as a LoadBalancer. ClientIP affinity keeps a client's QUIC -# packets on the pod that holds its connection. -apiVersion: v1 -kind: Service -metadata: - name: masque-provider - namespace: masque-system - labels: - app.kubernetes.io/name: masque-provider -spec: - selector: - app.kubernetes.io/name: masque-provider - sessionAffinity: ClientIP - ports: - - name: connect-ip - port: 443 - targetPort: connect-ip - protocol: UDP - - name: connect-ip-tcp - port: 443 - targetPort: connect-ip-tcp - protocol: TCP diff --git a/deploy/containerlab/resources/masque-service/provider/kustomization.yaml b/deploy/containerlab/resources/masque-service/provider/kustomization.yaml index 238462f58..aa4f6887a 100644 --- a/deploy/containerlab/resources/masque-service/provider/kustomization.yaml +++ b/deploy/containerlab/resources/masque-service/provider/kustomization.yaml @@ -6,7 +6,7 @@ # (../authority/kustomization.yaml). The base's TUN resource, # devic.es/tun, is the one the device plugin serves # (config/galactic-edge/tun-device-plugin), so it is kept. Clients reach the -# pod directly from its node, so the Service stays ClusterIP. +# pod directly from its node, so it needs no Service or public listener. # # The edge nodes cannot reach the cluster DNS, so the pod resolves the # authority's name through a host alias to the fixed address of its Service diff --git a/docs/designs/edge-public-listener.md b/docs/designs/edge-public-listener.md index eda169c8c..85ea77abd 100644 --- a/docs/designs/edge-public-listener.md +++ b/docs/designs/edge-public-listener.md @@ -1,6 +1,6 @@ # Galactic Edge public listener -Status: proposed, with its open decisions settled. The Phase 0 lab proof is done (see [Phase 0 results](#phase-0-results)), and Phase 1, the API, is implemented: `EdgeListener`, the `PublicListener` capability and `NetworkService.spec.edgeListenerRef` exist. Phase 2, core, is implemented: the ingress gVPC, listener admission and status, `/128` publication and the `NetworkService` writer. Phase 3's unmatched-egress drop is implemented. Phase 4's backend resolution is implemented: gateways and `galactic-router` serve a listener from the backends core reports serving. Its lab failover tests are not done yet. It extends the [Galactic Edge Foundation](galactic-edge.md) and reuses the [XDP/DSR gateway](../gateway/architecture.md). The [provider contract](../edge/provider-contract.md) remains the reference for behavior that exists today. +Status: proposed, with its open decisions settled. The Phase 0 lab proof is done (see [Phase 0 results](#phase-0-results)), and Phase 1, the API, is implemented: `EdgeListener`, the `PublicListener` capability and `NetworkService.spec.edgeListenerRef` exist. Phase 2, core, is implemented: the ingress gVPC, listener admission and status, `/128` publication and the `NetworkService` writer. Phase 3's unmatched-egress drop is implemented. Phase 4's backend resolution is implemented: gateways and `galactic-router` serve a listener from the backends core reports serving. Its lab failover tests are not done yet. Phase 5's provider and bundle changes are implemented: `masque-provider --listener-service` serves from a listener attachment, and `config/masque/provider/components/public-listener` replaces the Service. Its lab acceptance tests are not done yet. It extends the [Galactic Edge Foundation](galactic-edge.md) and reuses the [XDP/DSR gateway](../gateway/architecture.md). The [provider contract](../edge/provider-contract.md) remains the reference for behavior that exists today. This design follows the [Datum enhancement template](https://github.com/datum-cloud/enhancements/blob/main/enhancements/template/README.md). @@ -142,8 +142,8 @@ spec: - 2001:db8:100::10 - 192.0.2.10 ports: - - {name: h3, protocol: UDP, port: 443, backendPort: 8443} - - {name: h2, protocol: TCP, port: 443, backendPort: 8443} + - {protocol: udp, port: 443, backendPort: 8443} + - {protocol: tcp, port: 443, backendPort: 8443} healthPort: 8443 # TCP backend port probed for health; defaults to the first TCP backendPort, required when every port is UDP sessionAffinity: ClientIPAndProtocol # defaults to ClientIPAndProtocol failurePolicy: FailClosed # copied into each NetworkService's healthCheck @@ -305,6 +305,7 @@ Each listener has up to 16 ports and two addresses, and each port is one `Networ - 2026-11-28: Phase 0 proved remote delivery and the reply path, and showed local delivery failing ([#1507](https://github.com/datum-cloud/galactic/issues/1507)). - 2026-11-28: Phase 2 core controllers implemented ([#1509](https://github.com/datum-cloud/galactic/issues/1509)). - 2026-11-28: Phase 3 added the unmatched-egress drop on listener host links ([#1510](https://github.com/datum-cloud/galactic/issues/1510)). +- 2026-11-30: Phase 5 served MASQUE from listener attachments and replaced its Service with the public listener ([#1512](https://github.com/datum-cloud/galactic/issues/1512)). ## Drawbacks diff --git a/docs/edge/masque-provider.md b/docs/edge/masque-provider.md index fe24dd3ae..3ac17d101 100644 --- a/docs/edge/masque-provider.md +++ b/docs/edge/masque-provider.md @@ -8,7 +8,7 @@ The adapter never touches host networking. galactic-edge programs and releases e The cell must run galactic-controller with `--edge` and the galactic-edge DaemonSet on the provider's node ([deployment](provider-contract.md)). The provider's node also needs a TUN device plugin (`config/galactic-edge/tun-device-plugin`). The VPC needs no workload on that node: galactic-edge creates the VPC's host VRF there when the attachment is its only user. -1. Register the provider: an `EdgeProvider` that lists contract version `v1alpha1`, `PacketAccess/v1` and `PrefixReachability/v1`, and names the provider's ServiceAccount. An operator approves it with an `EdgeProviderApproval` of the same name (`config/masque/approval`). galactic-controller then binds the provider role and admission policy to that ServiceAccount. +1. Register the provider: an `EdgeProvider` that lists contract version `v1alpha1`, `PacketAccess/v1` and `PrefixReachability/v1` for connectors, `SocketAccess/v1` and `PublicListener/v1` for its [public listener](masque-service.md#public-listener), and names the provider's ServiceAccount. An operator approves it with an `EdgeProviderApproval` of the same name (`config/masque/approval`). galactic-controller then binds the provider role and admission policy to that ServiceAccount. 2. Grant each connector an `EdgeService` in its VPC's namespace. The [grant authority](masque-authority.md) issues one per connector authorization. It grants `PacketAccess` and `PrefixReachability`, lists the connector's /96 in `prefixes`, and sets a `clientPool` outside every connector /96. A service that lacks `PrefixReachability` gets an attachment, but core refuses every route on it. 3. Run the provider pod as that ServiceAccount, with a pod-bound token, the downward-API pod name, namespace, UID and node name, a device-plugin TUN, and no host namespace, hostPath, `NET_ADMIN` or BPF access. `tests/edgeconformance/masqueprovider/deploy/` is a worked example. diff --git a/docs/edge/masque-service.md b/docs/edge/masque-service.md index 0215f722d..3a5d8c6e5 100644 --- a/docs/edge/masque-service.md +++ b/docs/edge/masque-service.md @@ -15,12 +15,13 @@ Images: `config/masque` holds the manifests. None of them is in the root `config/kustomization.yaml`. CI stamps both images into the `galactic-kustomize` bundle at the tag of the same build, so an overlay of that bundle needs no image pin. The TUN device plugin's image is a third-party image pinned by digest, which CI does not stamp or mirror. -| Path | Applies | Needs from an overlay | -| ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | -| `config/galactic-edge/tun-device-plugin` | DaemonSet `galactic-system/tun-device-plugin`, which serves `devic.es/tun` on the nodes labeled `galactic.datumapis.com/node=edge` and `galactic.datumapis.com/edge=enabled` | Nothing | -| `config/masque` | Namespace `masque-system`, both ServiceAccounts, the authority's RBAC, and the `EdgeProvider` named `masque` | Nothing | -| `config/masque/authority` | The `masque-authority` Deployment and Service | `--cell`, and Secret `masque-authority-tls` for `masque-authority.masque-system.svc` | -| `config/masque/provider` | The `masque-provider` Deployment and UDP/443 + TCP/443 Service | `--authority`, Secret `masque-provider-tls` for that name, ConfigMap `masque-authority-ca` (`ca.crt`), and how the Service is exposed | +| Path | Applies | Needs from an overlay | +| --------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | +| `config/galactic-edge/tun-device-plugin` | DaemonSet `galactic-system/tun-device-plugin`, which serves `devic.es/tun` on the nodes labeled `galactic.datumapis.com/node=edge` and `galactic.datumapis.com/edge=enabled` | Nothing | +| `config/masque` | Namespace `masque-system`, both ServiceAccounts, the authority's RBAC, and the `EdgeProvider` named `masque` | Nothing | +| `config/masque/authority` | The `masque-authority` Deployment and Service | `--cell`, and Secret `masque-authority-tls` for `masque-authority.masque-system.svc` | +| `config/masque/provider` | The `masque-provider` Deployment. It ships no Service | `--authority`, Secret `masque-provider-tls` for that name, ConfigMap `masque-authority-ca` (`ca.crt`), and how clients reach the pods | +| `config/masque/provider/components/public-listener` | The `EdgeService` and `EdgeListener` of the public listener, the provider's read access to that `EdgeService`, and `--listener-service` | The ingress gVPC's UID and `/64`, and the listener's addresses ([public listener](#public-listener)) | The [certificates](#certificates) section covers both Secrets and the CA. @@ -45,13 +46,53 @@ To bring up a cell: 2. Apply `config/masque`. 3. Approve the provider by applying `config/masque/approval`, the `EdgeProviderApproval` named `masque`. galactic-controller then sets `status.approved` on `EdgeProvider/masque` and binds the provider role and admission policy to `masque-system/masque-provider`. In a GitOps cell, include `config/masque/approval` in the same overlay as `config/masque`; removing it from the overlay, with pruning on, withdraws the approval and both bindings. Applying it needs write access to `edgeproviderapprovals`, which no MASQUE or galactic ServiceAccount holds. A manual write to `status.approved` is reverted. 4. In each tenant namespace the authority serves, bind ClusterRole `masque-authority-tenant` to `masque-system/masque-authority` with a RoleBinding. Without it the authority can't issue that namespace's EdgeServices. -5. Apply the `authority` and `provider` overlays. Each provider pod reports ready once it holds its instance Lease. +5. Apply the `authority` and `provider` overlays. Each provider pod reports ready once it holds its instance Lease and, with the [public listener](#public-listener), serves on its listener attachment. 6. Create each VPC's ledger and the test connectors with the [operator commands](masque-authority.md#operator-tasks). The provider Deployment uses a rolling update. A connector that moves to a new pod gets a new authorization: the authority retires the old pod's incarnation and core releases its route before the new pod forwards ([cross-instance replacement](../designs/masque/contract.md#cross-instance-replacement-and-stale-cleanup)). The resource requests are starting values; [#984](https://github.com/datum-cloud/galactic/issues/984) qualifies the pod's size. To take MASQUE out of a cell, delete the provider overlay first so its pods release their routes, then the authority overlay, then `config/masque`. Delete `config/galactic-edge/tun-device-plugin` last, and only once no other `PacketAccess` provider in the cell requests `devic.es/tun`. Pods already running keep their device, but new ones stay Pending. +### Public listener + +Clients reach the provider pods through the cell's public listener ([design](../designs/edge-public-listener.md)): one IPv6 and one IPv4 address that every gateway node in the cell advertises, delivered to the pods through Galactic. The bundle ships no Service. An overlay that keeps its own Service, `LoadBalancer` or `NodePort` leaves out the component below; the pods then listen on the pod network as before. + +The cell needs: + +- galactic-controller started with `--edge-ingress-identity=masque=`, `--edge-ingress-prefix` and `--edge-listener-vip-prefixes` ([controller flags](../controller/README.md)). Once `config/masque` and its approval are applied, it creates the ingress gVPC `galactic-system/edge-ingress-masque`. +- Gateway nodes that serve IPv4 VIPs, for the IPv4 address. +- Edge nodes whose uplink carries replies sourced from the listener's addresses back to clients. + +The `masque` `EdgeProvider` lists `PublicListener/v1` in every cell. In a cell whose galactic-controller has no `--edge-ingress-identity` for `masque`, core records an `IngressIdentityMissing` Warning event on `EdgeProvider/masque` and creates no ingress gVPC. That is expected in a cell that serves MASQUE without the listener. + +To serve through it, in this order: + +1. Read the ingress gVPC's UID and `/64`: + + ```sh + kubectl -n galactic-system get vpc edge-ingress-masque -o jsonpath='{.metadata.uid} {.spec.networks[0]}' + ``` + +2. Include `config/masque/provider/components/public-listener` in the provider overlay. It adds the `EdgeService` `galactic-system/masque-ingress` and its two traffic policies, the `EdgeListener` `galactic-system/masque-public` for UDP/443 and TCP/443 to the pods' port 8443, the provider's read access to that one `EdgeService`, `--listener-service=galactic-system/masque-ingress` and a 40-second termination grace period. +3. In the same overlay, before it is first applied, patch the UID and `/64` into the `EdgeService`, and the cell's addresses into the `EdgeListener`, one per family from `--edge-listener-vip-prefixes`. Both `EdgeService` fields are immutable, so an `EdgeService` created with the component's placeholders has to be deleted and created again. + + ```yaml + patches: + - target: {kind: EdgeService, name: masque-ingress} + patch: | + - {op: replace, path: /spec/vpcRef/uid, value: } + - {op: replace, path: /spec/clientPool, value: } + - target: {kind: EdgeListener, name: masque-public} + patch: | + - {op: replace, path: /spec/addresses, value: [, ]} + ``` + +4. Set `--authority` to a hostname whose AAAA and A records resolve to those addresses, and issue `masque-provider-tls` for it. + +`kubectl -n galactic-system get edgelistener masque-public` then reports `Accepted` and `Programmed`, and lists each pod's attachment under `status.backends` with `serving: true` once the pod serves on it. [Startup and readiness](#startup-and-readiness) describes the pod's side. + +The bundle no longer ships the `masque-provider` Service. An overlay that patches that Service fails to build after the upgrade, and one that only relied on it loses it. Either add a Service to the overlay, or move clients to the listener: bring the listener up beside the Service on its own addresses, move clients by DNS, then remove the Service. + ### Certificates The provider pods need two certificates and one CA: From 745b3fddc13247ae3b60f11f1387a1a3883fbd8d Mon Sep 17 00:00:00 2001 From: Peter Sprygada Date: Mon, 30 Nov 2026 10:19:43 -0500 Subject: [PATCH 2/2] docs(masque): Describe the downtime of moving to the listener The guide said to keep the old Service serving while clients move to the listener by DNS. A pod started with --listener-service stops listening on the pod network, so the same pods cannot serve both, and clients that still resolve the Service lose connectivity once the last old pod exits. The guide now states that window and its bounds, gives the steps that keep it to the DNS TTL, and describes the rollback. --- docs/edge/masque-service.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/docs/edge/masque-service.md b/docs/edge/masque-service.md index 3a5d8c6e5..86c1e1d02 100644 --- a/docs/edge/masque-service.md +++ b/docs/edge/masque-service.md @@ -91,7 +91,24 @@ To serve through it, in this order: `kubectl -n galactic-system get edgelistener masque-public` then reports `Accepted` and `Programmed`, and lists each pod's attachment under `status.backends` with `serving: true` once the pod serves on it. [Startup and readiness](#startup-and-readiness) describes the pod's side. -The bundle no longer ships the `masque-provider` Service. An overlay that patches that Service fails to build after the upgrade, and one that only relied on it loses it. Either add a Service to the overlay, or move clients to the listener: bring the listener up beside the Service on its own addresses, move clients by DNS, then remove the Service. +#### Moving from a Service + +The bundle no longer ships the `masque-provider` Service. An overlay that patches that Service fails to build after the upgrade, and one that only relied on it loses it. To keep serving through a Service, add one to the overlay and leave out the component. + +A pod started with `--listener-service` listens only on its listener attachment, not on the pod network, so the same pods cannot serve the Service and the listener at once. Moving a cell to the listener therefore has a window in which a client that still resolves the Service's address cannot connect: + +- The window opens when the last pod without the listener terminates, which happens during the rollout as soon as a replacement pod is `Ready` on the listener. +- It closes for each client when its DNS answer expires and it resolves the listener's addresses. +- An open tunnel on an old pod ends when that pod terminates, and the connector reconnects to whatever address it then resolves. + +To keep the window to the DNS TTL: + +1. Lower the TTL of the `--authority` hostname's records, for example to 60 seconds, and wait for the old TTL to pass. +2. Read the ingress gVPC's values and include the component as above, keeping the Service in the overlay for now. Apply it. The pods roll over to the listener. +3. Once `kubectl -n galactic-system get edgelistener masque-public` reports `Programmed` with a serving backend, point the hostname's AAAA and A records at the listener's addresses. +4. After the TTL passes, remove the Service from the overlay and raise the TTL again. + +To roll back, remove the component from the overlay, add the Service back if it was removed, and apply. The pods roll back to the pod network. Then point the hostname at the Service's address again. The same window applies in reverse. Each pod deletes its listener attachment on shutdown, and pruning the overlay removes the listener's `EdgeService`, `EdgeListener` and policies. ### Certificates