Documentation ¶
Overview ¶
Package kubernetes provides the kubernetes backend.
Index ¶
- Constants
- func NormalizeZoneList(zones []string) []string
- type Kubernetes
- func (k *Kubernetes) Debug() string
- func (k *Kubernetes) InitKubeCache() 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) PTR(zone string, state request.Request) ([]dns.RR, error)
- func (k *Kubernetes) PrimaryZone() string
- func (k *Kubernetes) Records(r recordRequest) ([]msg.Service, error)
- func (k *Kubernetes) Reverse(state request.Request, exact bool, opt middleware.Options) ([]msg.Service, []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 middleware.Options) ([]msg.Service, []msg.Service, error)
Constants ¶
const ( // PodModeDisabled is the default value where pod requests are ignored PodModeDisabled = "disabled" // PodModeVerified is where Pod requests are answered only if they exist PodModeVerified = "verified" // PodModeInsecure is where pod requests are answered without verfying they exist PodModeInsecure = "insecure" // DNSSchemaVersion is the schema version: https://github.com/kubernetes/dns/blob/master/docs/specification.md DNSSchemaVersion = "1.0.0" )
Variables ¶
This section is empty.
Functions ¶
func NormalizeZoneList ¶
NormalizeZoneList filters the zones argument to remove array items that conflict with other items in zones. For example, providing the following zones array:
[ "a.b.c", "b.c", "a", "e.d.f", "a.b" ]
Returns:
[ "a.b.c", "a", "e.d.f", "a.b" ]
Zones filted out:
- "b.c" because "a.b.c" and "b.c" share the common top level "b.c". First listed zone wins if there is a conflict.
Note: This may prove to be too restrictive in practice.
Need to find counter-example use-cases.
Types ¶
type Kubernetes ¶
type Kubernetes struct { Next middleware.Handler Zones []string Proxy proxy.Proxy // Proxy for looking up names during the resolution process APIEndpoint string APICertAuth string APIClientCert string APIClientKey string APIConn *dnsController ResyncPeriod time.Duration Namespaces []string LabelSelector *unversionedapi.LabelSelector Selector *labels.Selector PodMode string ReverseCidrs []net.IPNet // contains filtered or unexported fields }
Kubernetes implements a middleware that connects to a Kubernetes cluster.
func (*Kubernetes) Debug ¶
func (k *Kubernetes) Debug() string
Debug implements the ServiceBackend interface.
func (*Kubernetes) InitKubeCache ¶
func (k *Kubernetes) InitKubeCache() error
InitKubeCache initializes a new Kubernetes cache.
func (*Kubernetes) IsNameError ¶
func (k *Kubernetes) IsNameError(err error) bool
IsNameError implements the ServiceBackend interface.
func (*Kubernetes) PrimaryZone ¶
func (k *Kubernetes) PrimaryZone() string
PrimaryZone will return the first non-reverse zone being handled by this middleware
func (*Kubernetes) Records ¶
func (k *Kubernetes) Records(r recordRequest) ([]msg.Service, error)
Records looks up services in kubernetes. If exact is true, it will lookup just this name. This is used when find matches when completing SRV lookups for instance.
func (*Kubernetes) Reverse ¶
func (k *Kubernetes) Reverse(state request.Request, exact bool, opt middleware.Options) ([]msg.Service, []msg.Service, error)
Reverse implements the ServiceBackend interface.