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) 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) SetWatchChan(c watch.Chan)
- func (k *Kubernetes) StopWatching(qname string)
- func (k *Kubernetes) Transfer(ctx context.Context, state request.Request) (int, error)
- func (k *Kubernetes) Watch(qname string) 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 APIConn dnsController Namespaces map[string]bool 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 ¶ added in v1.0.6
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) 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 ¶ added in v1.0.0
func (k *Kubernetes) Health() bool
Health implements the health.Healther interface.
func (*Kubernetes) InitKubeCache ¶ added in v1.0.6
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 ¶ added in v0.9.10
func (k *Kubernetes) MinTTL(state request.Request) uint32
MinTTL implements the Transferer interface.
func (*Kubernetes) RegisterKubeCache ¶ added in v1.0.6
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 ¶ added in v0.9.10
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.
func (*Kubernetes) Services ¶
func (k *Kubernetes) Services(state request.Request, exact bool, opt plugin.Options) (svcs []msg.Service, err error)
Services implements the ServiceBackend interface.
func (*Kubernetes) SetWatchChan ¶ added in v1.2.0
func (k *Kubernetes) SetWatchChan(c watch.Chan)
SetWatchChan implements watch.Watchable
func (*Kubernetes) StopWatching ¶ added in v1.2.0
func (k *Kubernetes) StopWatching(qname string)
StopWatching is called when no more watches remain for a name
func (*Kubernetes) Watch ¶ added in v1.2.0
func (k *Kubernetes) Watch(qname string) error
Watch is called when a watch is started for a name.