Route the dev session as QUIC over UDP 7400
Foundation / checks (checks) (push) Successful in 5s
Foundation / checks (client) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 5s
Foundation / checks (network) (push) Successful in 5s
Foundation / checks (postgres) (push) Successful in 5s
Foundation / checks (tsan) (push) Successful in 5s
Foundation / checks (deploy) (push) Successful in 3m16s
Foundation / postgres-tools (push) Successful in 5s
Foundation / server-image (push) Successful in 5s
Foundation / image (push) Successful in 6s
Foundation / checks (checks) (push) Successful in 5s
Foundation / checks (client) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 5s
Foundation / checks (network) (push) Successful in 5s
Foundation / checks (postgres) (push) Successful in 5s
Foundation / checks (tsan) (push) Successful in 5s
Foundation / checks (deploy) (push) Successful in 3m16s
Foundation / postgres-tools (push) Successful in 5s
Foundation / server-image (push) Successful in 5s
Foundation / image (push) Successful in 6s
The deployed M10 listener is QUIC (UDP) but the ADR-0087 route admitted only TCP 7400, so nothing reached it through the VIP. The route container port, Service and NetworkPolicy now carry UDP 7400 only (no TCP: nothing needs it). The policy check requires exactly UDP 7400 for the route and counts any protocol on 7400 as session exposure elsewhere; six new self-test cases. ADR-0087 amended (edge firewall and internal DNS as separate reviewed steps, end-to-end probe as acceptance); session protocol v1 recorded as frozen now that it is deployed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -313,7 +313,8 @@ for path, doc in objects:
|
||||
if volume.get('secret', {}).get('secretName') == 'evolution-dev-session':
|
||||
check(volume['secret'].get('optional') is True and volume['secret'].get('defaultMode') == 0o440,
|
||||
f'{path}: the dev session Secret is optional and 0440')
|
||||
ROUTE_PORT = [{'name': 'session', 'port': 7400, 'targetPort': 'session', 'protocol': 'TCP'}]
|
||||
# The M10 session is QUIC (ADR-0090, ADR-0087 amendment 2026-10-05): UDP 7400 only.
|
||||
ROUTE_PORT = [{'name': 'session', 'port': 7400, 'targetPort': 'session', 'protocol': 'UDP'}]
|
||||
REGION_SELECTOR = {'app.kubernetes.io/name': 'evo-region'}
|
||||
|
||||
|
||||
@@ -324,7 +325,7 @@ def validate_route_service(where, doc):
|
||||
check(spec.get('type') == 'LoadBalancer' and spec.get('externalTrafficPolicy') == 'Local'
|
||||
and spec.get('allocateLoadBalancerNodePorts') is False,
|
||||
f'{where}: the route is a LoadBalancer with Local traffic policy and no node ports')
|
||||
check(spec.get('ports') == ROUTE_PORT, f'{where}: the route exposes exactly TCP 7400')
|
||||
check(spec.get('ports') == ROUTE_PORT, f'{where}: the route exposes exactly UDP 7400 (QUIC)')
|
||||
check(spec.get('selector') == REGION_SELECTOR, f'{where}: the route selects only the region pod')
|
||||
annotations = doc['metadata'].get('annotations', {})
|
||||
check(set(annotations) == {'metallb.io/loadBalancerIPs'},
|
||||
@@ -351,13 +352,13 @@ def validate_route_service(where, doc):
|
||||
|
||||
|
||||
def validate_route_policy(where, doc, ranges):
|
||||
"""The route policy admits TCP 7400 to the region pod from exactly the Service ranges."""
|
||||
"""The route policy admits UDP 7400 to the region pod from exactly the Service ranges."""
|
||||
spec = doc['spec']
|
||||
rules = spec.get('ingress', [])
|
||||
check(spec.get('podSelector') == {'matchLabels': REGION_SELECTOR}
|
||||
and spec.get('policyTypes') == ['Ingress'] and len(rules) == 1
|
||||
and rules[0].get('ports') == [{'protocol': 'TCP', 'port': 7400}],
|
||||
f'{where}: the session policy admits only TCP 7400 to the region pod')
|
||||
and rules[0].get('ports') == [{'protocol': 'UDP', 'port': 7400}],
|
||||
f'{where}: the session policy admits only UDP 7400 to the region pod')
|
||||
peers = rules[0].get('from', []) if rules else []
|
||||
check(peers and all(set(peer) == {'ipBlock'} and set(peer['ipBlock']) == {'cidr'} for peer in peers)
|
||||
and sorted(peer['ipBlock']['cidr'] for peer in peers) == sorted(ranges),
|
||||
@@ -380,7 +381,7 @@ for path, doc in objects:
|
||||
if doc['kind'] == 'Ingress':
|
||||
text = yaml.safe_dump(doc)
|
||||
check('7400' not in text and 'session' not in text,
|
||||
f'{path}: the dev session is raw TCP, never an Ingress (ADR-0087)')
|
||||
f'{path}: the dev session is QUIC over UDP, never an Ingress (ADR-0087)')
|
||||
policies = [(p, d) for p, d in objects if p.startswith(ROUTE) and d['kind'] == 'NetworkPolicy']
|
||||
check(len(policies) == 1, f'{ROUTE}: exactly one session ingress policy')
|
||||
for path, doc in policies:
|
||||
@@ -639,14 +640,13 @@ def selects_region(selector):
|
||||
|
||||
|
||||
def admits_session(rule):
|
||||
"""True when an ingress rule admits TCP 7400 on the region pod: no or empty ports, a
|
||||
TCP entry without a port, the 'session' name, 7400 itself or a range spanning it."""
|
||||
"""True when an ingress rule admits 7400 on the region pod in any protocol (UDP for the
|
||||
QUIC session, and TCP or SCTP, which nothing may expose there either): no or empty ports,
|
||||
an entry without a port, the 'session' name, 7400 itself or a range spanning it."""
|
||||
ports = rule.get('ports')
|
||||
if not ports:
|
||||
return True
|
||||
for port in ports:
|
||||
if port.get('protocol', 'TCP') != 'TCP':
|
||||
continue
|
||||
number = port.get('port')
|
||||
if number is None or number in (7400, 'session'):
|
||||
return True
|
||||
@@ -690,8 +690,10 @@ for overlay, docs in renders.items():
|
||||
else:
|
||||
check('--m10-listen' not in text and '--synthetic-inputs' not in text,
|
||||
f'{where}: only evo-server may listen for sessions')
|
||||
ports = sorted((p.get('name'), p.get('containerPort')) for p in container.get('ports', []))
|
||||
allowed = [('ops', 9100), ('session', 7400)] if route_active else [('ops', 9100)]
|
||||
ports = sorted((p.get('name'), p.get('containerPort'), p.get('protocol', 'TCP'))
|
||||
for p in container.get('ports', []))
|
||||
allowed = ([('ops', 9100, 'TCP'), ('session', 7400, 'UDP')] if route_active
|
||||
else [('ops', 9100, 'TCP')])
|
||||
if container.get('name') == 'evo-server':
|
||||
check(ports == sorted(allowed), f'{where}: container ports must be {allowed}')
|
||||
if kind == 'Service':
|
||||
|
||||
@@ -192,7 +192,28 @@ CASES = [
|
||||
'172.10.1.0/24', '10.99.0.0/24'),
|
||||
'exactly the Service source ranges'),
|
||||
('policy admits another port', lambda t: edit(t, ROUTE + 'networkpolicy.yaml', 'port: 7400', 'port: 7401'),
|
||||
'only TCP 7400'),
|
||||
'only UDP 7400'),
|
||||
# ADR-0087 amendment 2026-10-05: the route is QUIC over UDP; a stale TCP route fails.
|
||||
('route Service still TCP', lambda t: edit(t, ROUTE + 'service.yaml', 'protocol: UDP', 'protocol: TCP'),
|
||||
'exactly UDP 7400 (QUIC)'),
|
||||
('route policy still TCP', lambda t: edit(t, ROUTE + 'networkpolicy.yaml', 'protocol: UDP', 'protocol: TCP'),
|
||||
'only UDP 7400'),
|
||||
('route Service with TCP beside UDP', lambda t: append(
|
||||
t, ROUTE + 'service.yaml', ' - {name: session-tcp, port: 7400, targetPort: 7400, protocol: TCP}\n'),
|
||||
'exactly UDP 7400 (QUIC)'),
|
||||
('route container port still TCP', lambda t: edit(t, ROUTE + 'listener.yaml',
|
||||
'containerPort: 7400, protocol: UDP',
|
||||
'containerPort: 7400, protocol: TCP'),
|
||||
'container ports must be'),
|
||||
('region policy admitting UDP 7400', lambda t: add_resource(
|
||||
t, DEV, 'widened.yaml', region_policy('{matchLabels: {app.kubernetes.io/name: evo-region}}',
|
||||
'{from: [{ipBlock: {cidr: 10.0.0.0/8}}], '
|
||||
'ports: [{protocol: UDP, port: 7400}]}')),
|
||||
'admits the region session port'),
|
||||
('region policy admitting SCTP 7400', lambda t: add_resource(
|
||||
t, DEV, 'widened.yaml', region_policy('{matchLabels: {app.kubernetes.io/name: evo-region}}',
|
||||
'{ports: [{protocol: SCTP, port: 7400}]}')),
|
||||
'admits the region session port'),
|
||||
('cluster traffic policy', lambda t: edit(t, ROUTE + 'service.yaml', 'externalTrafficPolicy: Local',
|
||||
'externalTrafficPolicy: Cluster'), 'Local traffic policy'),
|
||||
('node ports allocated', lambda t: edit(t, ROUTE + 'service.yaml', 'allocateLoadBalancerNodePorts: false',
|
||||
@@ -202,7 +223,7 @@ CASES = [
|
||||
'no PROXY protocol'),
|
||||
('extra route port', lambda t: append(t, ROUTE + 'service.yaml',
|
||||
' - {name: ops, port: 9100, targetPort: ops, protocol: TCP}\n'),
|
||||
'exactly TCP 7400'),
|
||||
'exactly UDP 7400'),
|
||||
('another LoadBalancer', lambda t: edit(t, 'deploy/kubernetes/region/base/service.yaml', 'type: ClusterIP',
|
||||
'type: LoadBalancer'), 'Services are forbidden'),
|
||||
('session port on another Service', lambda t: append(t, 'deploy/kubernetes/region/base/service.yaml',
|
||||
|
||||
Reference in New Issue
Block a user