podnames

package
v0.0.0-...-0c53b8b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 30, 2020 License: Apache-2.0 Imports: 18 Imported by: 0

README

podnames

Name

podnames - Serve A/AAAA/PTR records for Pods by Pod Name.

Description

Enables Pod lookup by pod name/namespace. e.g. mypod.mynamespace.mydomain..

This does not follow the Kubernetes DNS-Based Service Discovery Specification.

This plugin requires the k8s_api and companion kubernetes plugin in https://github.com/chrisohaver/k8s_api/tree/master/examples. The kubernetes plugin must have the pods verified option.

Syntax

podnames [ZONES...] {
    ttl TTL
}
  • ttl allows you to set a custom TTL for responses. The default is 5 seconds. The minimum TTL allowed is 0 seconds, and the maximum is capped at 3600 seconds. Setting TTL to 0 will prevent records from being cached.

Examples

Create records for Pods by pod name in the domain pod.cluster.local. e.g. mypod.mynamespace.pod.cluster.local.. This example eclipses the existing ip based pod.cluster.local. records that kubernetes plugin creates.

  .:53 {
    podnames pod.cluster.local in-addr.arpa ip6.arpa

    kubernetes cluster.local in-addr.arpa ip6.arpa {
      pods verified
    }

    k8s_api
  }

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PodNames

type PodNames struct {
	Next  plugin.Handler
	Zones []string
	// contains filtered or unexported fields
}

func (*PodNames) Informers

func (p *PodNames) Informers() map[string]k8sapi.InformerFunc

func (PodNames) Name

func (p PodNames) Name() string

Name implements the plugin.Handler interface.

func (PodNames) ServeDNS

func (p PodNames) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error)

ServeDNS implements the plugin.Handler interface.

func (*PodNames) SetHasSynced

func (p *PodNames) SetHasSynced(syncedFunc k8sapi.HasSyncedFunc)

func (*PodNames) SetIndexer

func (p *PodNames) SetIndexer(name string, lister cache.KeyListerGetter) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL