Documentation ¶
Index ¶
- Constants
- type MultiCluster
- func (m *MultiCluster) InitController(ctx context.Context) (onStart func() error, onShut func() error, err error)
- func (m MultiCluster) IsNameError(err error) bool
- func (m MultiCluster) Lookup(ctx context.Context, state request.Request, name string, typ uint16) (*dns.Msg, error)
- func (m MultiCluster) MinTTL(state request.Request) uint32
- func (m MultiCluster) Name() string
- func (m *MultiCluster) Ready() bool
- func (m MultiCluster) Records(ctx context.Context, state request.Request, exact bool) ([]msg.Service, error)
- func (m MultiCluster) Reverse(ctx context.Context, state request.Request, exact bool, opt plugin.Options) ([]msg.Service, error)
- func (m MultiCluster) Serial(state request.Request) uint32
- func (m MultiCluster) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error)
- func (m MultiCluster) Services(ctx context.Context, state request.Request, exact bool, opt plugin.Options) ([]msg.Service, error)
- type ResponsePrinter
Constants ¶
const ( DNSSchemaVersion = "1.1.0" // Svc is the DNS schema for kubernetes services Svc = "svc" // Pod is the DNS schema for kubernetes pods Pod = "pod" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MultiCluster ¶
type MultiCluster struct { Next plugin.Handler Zones []string ClientConfig clientcmd.ClientConfig Fall fall.F // contains filtered or unexported fields }
MultiCluster implements a plugin supporting multi-cluster DNS spec.
func New ¶
func New(zones []string) *MultiCluster
func ParseStanza ¶
func ParseStanza(c *caddy.Controller) (*MultiCluster, error)
ParseStanza parses a kubernetes stanza
func (*MultiCluster) InitController ¶
func (MultiCluster) IsNameError ¶
func (m MultiCluster) IsNameError(err error) bool
IsNameError returns true if err indicated a record not found condition
func (MultiCluster) Lookup ¶
func (m MultiCluster) Lookup(ctx context.Context, state request.Request, name string, typ uint16) (*dns.Msg, error)
Lookup is used to find records else where.
func (MultiCluster) MinTTL ¶
func (m MultiCluster) MinTTL(state request.Request) uint32
MinTTL returns the minimum TTL to be used in the SOA record.
func (MultiCluster) Name ¶
func (m MultiCluster) Name() string
Name implements the Handler interface.
func (*MultiCluster) Ready ¶
func (m *MultiCluster) Ready() bool
Ready implements the ready.Readiness interface. func (m *MultiCluster) Ready() bool { return m.controller.HasSynced() }
func (MultiCluster) Records ¶
func (m MultiCluster) Records(ctx context.Context, state request.Request, exact bool) ([]msg.Service, error)
Returns _all_ services that matches a certain name. Note: it does not implement a specific service.
func (MultiCluster) Reverse ¶
func (m MultiCluster) Reverse(ctx context.Context, state request.Request, exact bool, opt plugin.Options) ([]msg.Service, error)
Reverse communicates with the backend to retrieve service definition based on a IP address instead of a name. I.e. a reverse DNS lookup.
func (MultiCluster) Serial ¶
func (m MultiCluster) Serial(state request.Request) uint32
Serial returns a SOA serial number to construct a SOA record.
type ResponsePrinter ¶
type ResponsePrinter struct {
dns.ResponseWriter
}
func NewResponsePrinter ¶
func NewResponsePrinter(w dns.ResponseWriter) *ResponsePrinter
NewResponsePrinter returns ResponseWriter.