Documentation ¶
Overview ¶
Package kubernetes provides the kubernetes backend.
Index ¶
- Constants
- type Kubernetes
- func (k *Kubernetes) AutoPath(state request.Request) []string
- func (k *Kubernetes) Federations(state request.Request, fname, fzone string) (msg.Service, error)
- func (k *Kubernetes) IsNameError(err error) bool
- func (k *Kubernetes) Lookup(state request.Request, name string, typ uint16) (*dns.Msg, error)
- func (k Kubernetes) Name() string
- func (k *Kubernetes) Records(state request.Request, exact bool) ([]msg.Service, error)
- func (k *Kubernetes) Reverse(state request.Request, exact bool, opt plugin.Options) ([]msg.Service, error)
- func (k Kubernetes) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error)
- func (k *Kubernetes) Services(state request.Request, exact bool, opt plugin.Options) (svcs []msg.Service, err error)
Constants ¶
const ( LabelZone = "failure-domain.beta.kubernetes.io/zone" LabelRegion = "failure-domain.beta.kubernetes.io/region" )
The federation node.Labels keys used.
const ( // Svc is the DNS schema for kubernetes services Svc = "svc" // Pod is the DNS schema for kubernetes pods Pod = "pod" )
const (
// DNSSchemaVersion is the schema version: https://github.com/kubernetes/dns/blob/master/docs/specification.md
DNSSchemaVersion = "1.0.1"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Kubernetes ¶
type Kubernetes struct { Next plugin.Handler Zones []string Proxy proxy.Proxy // Proxy for looking up names during the resolution process APIServerList []string APIProxy *apiProxy APICertAuth string APIClientCert string APIClientKey string APIConn dnsController Namespaces map[string]bool Fallthrough bool // contains filtered or unexported fields }
Kubernetes implements a plugin that connects to a Kubernetes cluster.
func New ¶
func New(zones []string) *Kubernetes
New returns a intialized Kubernetes. It default interfaceAddrFunc to return 127.0.0.1. All other values default to their zero value, primaryZoneIndex will thus point to the first zone.
func (*Kubernetes) AutoPath ¶
func (k *Kubernetes) AutoPath(state request.Request) []string
AutoPath implements the AutoPathFunc call from the autopath plugin. It returns a per-query search path or nil indicating no searchpathing should happen.
func (*Kubernetes) Federations ¶
Federations is used from the federations plugin to return the service that should be returned as a CNAME for federation(s) to work.
func (*Kubernetes) IsNameError ¶
func (k *Kubernetes) IsNameError(err error) bool
IsNameError implements the ServiceBackend interface.
func (*Kubernetes) Reverse ¶
func (k *Kubernetes) Reverse(state request.Request, exact bool, opt plugin.Options) ([]msg.Service, error)
Reverse implements the ServiceBackend interface.