Files
mpc/k8s/network-policy.yaml
zeekay cb5de9fdea feat(zap): adopt canonical port 9999 across MPC + transport
ZAP is the binary protocol — like HTTP=80 and HTTPS=443, ZAP=9999
across the Lux ecosystem. The DNS name (e.g. zap.kms.svc, zap.mpc.svc,
mpc-node-headless.lux-mpc.svc) disambiguates the service; the port is
always the same.

Changes:
- mpcd --listen default :9651 → :9999
- pkg/transport/{transport,factory}.go: comments and examples
- k8s/mpc-statefulset.yaml: ports + peer template
- k8s/network-policy.yaml: ingress/egress allow rules
- cloudbuild.yaml: EXPOSE
- deployments/customer-3of5/{compose.yml,k8s/*,topology.yaml}: full
  template sweep — every peer hostname is distinct, port is uniform 9999
- README.md / LLM.md: example commands

luxd validator P2P (9631 mainnet, 9641 testnet, 9651 devnet) is a
DIFFERENT protocol on a DIFFERENT pod and is unchanged.
2025-12-28 15:07:49 -08:00

151 lines
2.9 KiB
YAML

# NetworkPolicies for lux-mpc namespace
# MPC nodes hold key shares — restrict lateral movement
---
# MPC node ingress: only allow p2p from other MPC nodes, API from mpc-api
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: mpc-node-ingress
namespace: lux-mpc
spec:
podSelector:
matchLabels:
app: mpc-node
policyTypes:
- Ingress
ingress:
# mpc-node <-> mpc-node: consensus p2p
- from:
- podSelector:
matchLabels:
app: mpc-node
ports:
- protocol: TCP
port: 9999
- protocol: TCP
port: 9800
# mpc-api -> mpc-node: dashboard API proxy
- from:
- podSelector:
matchLabels:
app: mpc-api
ports:
- protocol: TCP
port: 8081
- protocol: TCP
port: 9800
# probes from kubelet (must allow)
- ports:
- protocol: TCP
port: 9800
---
# MPC node egress: restricted to peers, data stores, S3, DNS
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: mpc-node-egress
namespace: lux-mpc
spec:
podSelector:
matchLabels:
app: mpc-node
policyTypes:
- Egress
egress:
# mpc-node <-> mpc-node: consensus p2p
- to:
- podSelector:
matchLabels:
app: mpc-node
ports:
- protocol: TCP
port: 9999
- protocol: TCP
port: 9800
# mpc-node -> postgres
- to:
- podSelector:
matchLabels:
app: mpc-postgres
ports:
- protocol: TCP
port: 5432
# mpc-node -> valkey
- to:
- podSelector:
matchLabels:
app: mpc-valkey
ports:
- protocol: TCP
port: 6379
# DNS resolution (kube-dns / CoreDNS)
- to:
- namespaceSelector: {}
ports:
- protocol: UDP
port: 53
- protocol: TCP
port: 53
# S3 backup (MinIO or external S3 — HTTPS only)
- ports:
- protocol: TCP
port: 443
---
# MPC API ingress: only from ingress controller and dashboard
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: mpc-api-ingress
namespace: lux-mpc
spec:
podSelector:
matchLabels:
app: mpc-api
policyTypes:
- Ingress
ingress:
# From Traefik ingress (lux-system namespace)
- from:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: lux-system
ports:
- protocol: TCP
port: 8081
# From dashboard
- from:
- podSelector:
matchLabels:
app: mpc-dashboard
ports:
- protocol: TCP
port: 8081
# Probes
- ports:
- protocol: TCP
port: 8081
---
# Dashboard: only from ingress
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: mpc-dashboard-ingress
namespace: lux-mpc
spec:
podSelector:
matchLabels:
app: mpc-dashboard
policyTypes:
- Ingress
ingress:
- from:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: lux-system
ports:
- protocol: TCP
port: 3000
- ports:
- protocol: TCP
port: 3000