Documentation
¶
Index ¶
Constants ¶
View Source
const ( // InternalDomain is the cluster internal domain for service discovery. All DNS queries ending with this suffix // will be resolved using the internal DNS server. InternalDomain = "internal." // Port is the standard DNS port. Port = 53 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClusterResolver ¶
type ClusterResolver struct {
// contains filtered or unexported fields
}
ClusterResolver implements Resolver by tracking containers in the cluster and resolving service names to their IP addresses.
func NewClusterResolver ¶
func NewClusterResolver(store *store.Store) *ClusterResolver
NewClusterResolver creates a new cluster resolver using the cluster store.
type Resolver ¶
type Resolver interface {
// Resolve returns a list of IP addresses of the service containers.
// An empty list is returned if no service is found.
Resolve(serviceName string) []netip.Addr
}
Resolver is an interface for resolving service names to IP addresses.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is an embedded internal DNS server for service discovery and forwarding external queries to upstream DNS servers.
func NewServer ¶
func NewServer(listenAddr netip.Addr, resolver Resolver, upstreams []netip.AddrPort) (*Server, error)
NewServer creates a new DNS server with the given configuration. If upstreams is nil, nameservers from /etc/resolv.conf will be used. An empty upstreams list means to only resolve internal DNS queries and not forward any external queries.
Click to show internal directories.
Click to hide internal directories.