Documentation ¶
Overview ¶
Package kubernetes provides the kubernetes backend.
Index ¶
- Constants
- type Kubernetes
- func (k *Kubernetes) AutoPath(state request.Request) []string
- func (k *Kubernetes) External(state request.Request) ([]msg.Service, int)
- func (k *Kubernetes) ExternalAddress(state request.Request) []dns.RR
- func (k *Kubernetes) Federations(state request.Request, fname, fzone string) (msg.Service, error)
- func (k *Kubernetes) Health() bool
- func (k *Kubernetes) InitKubeCache() (err 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) MinTTL(state request.Request) uint32
- func (k Kubernetes) Name() string
- func (k *Kubernetes) Records(state request.Request, exact bool) ([]msg.Service, error)
- func (k *Kubernetes) RegisterKubeCache(c *caddy.Controller)
- func (k *Kubernetes) Reverse(state request.Request, exact bool, opt plugin.Options) ([]msg.Service, error)
- func (k *Kubernetes) Serial(state request.Request) uint32
- 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)
- func (k *Kubernetes) Transfer(ctx context.Context, state request.Request) (int, error)
Constants ¶
const ( LabelZone = "failure-domain.beta.kubernetes.io/zone" LabelRegion = "failure-domain.beta.kubernetes.io/region" )
The federation node.Labels keys used.
const ( // DNSSchemaVersion is the schema version: https://github.com/kubernetes/dns/blob/master/docs/specification.md DNSSchemaVersion = "1.0.1" // 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 Kubernetes ¶
type Kubernetes struct { Next plugin.Handler Zones []string Upstream *upstream.Upstream APIServerList []string APIProxy *apiProxy APICertAuth string APIClientCert string APIClientKey string ClientConfig clientcmd.ClientConfig APIConn dnsController Namespaces map[string]struct{} Fall fall.F TransferTo []string // 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 initialized 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 ParseStanza ¶
func ParseStanza(c *caddy.Controller) (*Kubernetes, error)
ParseStanza parses a kubernetes stanza
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) External ¶
External implements the ExternalFunc call from the external plugin. It returns any services matching in the services' ExternalIPs.
func (*Kubernetes) ExternalAddress ¶
func (k *Kubernetes) ExternalAddress(state request.Request) []dns.RR
ExternalAddress returns the external service address(es) for the CoreDNS service.
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) Health ¶
func (k *Kubernetes) Health() bool
Health implements the health.Healther interface.
func (*Kubernetes) InitKubeCache ¶
func (k *Kubernetes) InitKubeCache() (err error)
InitKubeCache initializes a new Kubernetes cache.
func (*Kubernetes) IsNameError ¶
func (k *Kubernetes) IsNameError(err error) bool
IsNameError implements the ServiceBackend interface.
func (*Kubernetes) MinTTL ¶
func (k *Kubernetes) MinTTL(state request.Request) uint32
MinTTL implements the Transferer interface.
func (*Kubernetes) RegisterKubeCache ¶
func (k *Kubernetes) RegisterKubeCache(c *caddy.Controller)
RegisterKubeCache registers KubeCache start and stop functions with Caddy
func (*Kubernetes) Reverse ¶
func (k *Kubernetes) Reverse(state request.Request, exact bool, opt plugin.Options) ([]msg.Service, error)
Reverse implements the ServiceBackend interface.
func (*Kubernetes) Serial ¶
func (k *Kubernetes) Serial(state request.Request) uint32
Serial implements the Transferer interface.
func (Kubernetes) ServeDNS ¶
func (k Kubernetes) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error)
ServeDNS implements the plugin.Handler interface.