intdns

package
v0.1.0-alpha.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 18, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package intdns is the per-node internal DNS resolver (F26). It binds a DNS server on each per-(project,env) bridge network's gateway IP and answers <svc>.<env>.<project>.internal (and the <svc>.internal shorthand) with the service's VIP — but only within the network's own scope, so services in one project/env cannot discover another's. Everything else forwards to the host's upstream resolvers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NetworkScope

type NetworkScope struct {
	Gateway   string // e.g. "10.201.5.1"
	ProjectID string
	EnvID     string
}

NetworkScope binds one DNS listener: the bridge gateway to serve on and the (project, env) the network belongs to. The listener address determines the resolution scope.

type Resolver

type Resolver struct {
	// contains filtered or unexported fields
}

Resolver serves internal DNS across a node's bridge networks.

func New

func New(routes proxy.RouteSource, upstreams []string, log *slog.Logger) *Resolver

New builds a resolver reading service VIPs from the route source and forwarding other queries to upstreams (host:port each). Empty upstreams are filled from /etc/resolv.conf.

func (*Resolver) Answer

func (r *Resolver) Answer(scope NetworkScope, req *dns.Msg) *dns.Msg

Answer builds the reply for a query received on the listener for scope. It is exported so it can be unit-tested without binding a socket.

func (*Resolver) Close

func (r *Resolver) Close()

Close stops all listeners.

func (*Resolver) Reconcile

func (r *Resolver) Reconcile(scopes []NetworkScope)

Reconcile starts a DNS server for each scope's gateway and stops servers whose gateway is no longer present.

type VIPProxy

type VIPProxy struct {
	// contains filtered or unexported fields
}

VIPProxy binds each environment's service VIP on the dummy interface and L4-splices VIP:port to the service's endpoints (F26 / spec §2.7). It reconciles to the current RouteSnapshot's InternalServices; TCP only in v1.

func NewVIPProxy

func NewVIPProxy(source proxy.RouteSource, log *slog.Logger) *VIPProxy

NewVIPProxy builds the VIP proxy over a route source.

func (*VIPProxy) Close

func (v *VIPProxy) Close()

Close stops all listeners and removes VIP addresses.

func (*VIPProxy) Reconcile

func (v *VIPProxy) Reconcile(snap *clusterv1.RouteSnapshot)

Reconcile brings the VIP addresses and listeners in line with the snapshot. VIP addresses are added BEFORE their listeners (you cannot bind an address that is not yet on an interface).

func (*VIPProxy) Run

func (v *VIPProxy) Run(ctx context.Context)

Run reconciles to every route snapshot until ctx is canceled.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL