How rhastie/nmos-kubernetes works
Project Type & Purpose
• This is an “infrastructure-as-code” Kubernetes deployment project.
• It sets up a local kind cluster with MetalLB, CoreDNS extended by a custom DNS‐SD plugin, the Gateway API (via Istio), and two NMOS C++ services (registry & node) exposed for service discovery and testing.
File Structure Analysis
• Top level assets are all YAML or text files—no code directories.
• You see:
• kind.yaml, node.yaml, registry.yaml – kind cluster config and Kubernetes resource manifests for the NMOS services
• coredns-config.yaml – CoreDNS plugin configuration to forward DNS queries to the custom plugin
• dns-values-*.yml, values.yaml – Helm values for installing k8s_gateway and MetalLB
• svc-test.yaml – likely a Service manifest for testing connectivity
• README shows a sequential Helm/Kubectl deployment of:
• MetalLB (L2 load-balancer)
• Gateway API CRDs
• k8s_gateway (custom Gateway API controller / DNS plugin)
• CoreDNS plugin update
• Istio control plane & ingress gateway
• NMOS registry & node deployments
Key Insights from README
• Uses kind (Kubernetes in Docker) as the test cluster environment.
• MetalLB provides external LoadBalancer IPs in the kind cluster.
• Gateway API (HTTPRoute, TCPRoute) is enabled via upstream CRDs and Istio’s Gateway controller.
• A CoreDNS plugin is loaded to handle DNS-SD (_nmos-register._tcp) queries and forward them to the k8s_gateway service.
• The NMOS C++ registry runs on HTTP port 8010 (NodePort) and a WebSocket query port 8011.
• NMOS Node service is similarly deployed.
Main Components
a. Kubernetes Cluster (kind)
• Control Plane (API Server, Scheduler, etcd)
• Worker Node(s)
b. MetalLB (L2 LoadBalancer)
• Provides external IPs to Services of type LoadBalancer
c. CoreDNS + DNS-SD Plugin
• CoreDNS deployment (built-in Kubernetes DNS)
• Custom plugin endpoint (local pod)
d. k8s_gateway Controller
• Installed via Helm (listens for Gateway API CRDs: Gateway, HTTPRoute, TCPRoute)
e. Istio Service Mesh
• istio-base, istiod (control plane)
• istio-ingress (Envoy gateway)
f. NMOS Services
• nmos-cpp-registry Deployment + NodePort Service (port 8010/8011)
• nmos-cpp-node Deployment + (Service)
g. External Clients & mDNS Service Discovery
• dns-sd clients issuing _nmos-register._tcp queries
• curl/HTTP client hitting NodePort
Relationships & Data Flows
• DNS-SD client → CoreDNS (UDP 53) → plugin intercepts _nmos-register._tcp → forwards to k8s_gateway
• k8s_gateway (Gateway API controller) evaluates HTTPRoute/TCPRoute CRs → configures Istio ingress → routes to registry/node Services
• Kubernetes Services (LoadBalancer via MetalLB or NodePort) send traffic to Pods
• curl/HTTP client or WebSocket clients connect through NodePort to registry
Architectural Patterns & Principles
• Control Plane vs Data Plane separation (Kubernetes API vs actual packet forwarding)
• Declarative infrastructure (Helm + YAML + Kustomize)
• Plugin architecture (CoreDNS plugin for DNS-SD)
• Service mesh + Gateway API for protocol‐agnostic routing
• Microservices: registry & node as separate deployable units