coredns

package
v0.0.0-...-89e5b94 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 28 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewEndpointsController

func NewEndpointsController(ctx context.Context, kubeClient kubernetes.Interface, instance *KusciaCoreDNS, namespace string) controllers.IController

NewEndpointsController create a new *EndpointsController

func NewPodController

func NewPodController(ctx context.Context, kubeClient kubernetes.Interface, instance *KusciaCoreDNS, namespace string) controllers.IController

NewPodController create a new *PodController.

Types

type EndpointsController

type EndpointsController struct {
	// contains filtered or unexported fields
}

EndpointsController sync namespaces' services. For each service - If `ObjectMeta.Annotations` contains `cname: gateway`, insert A record with gateway IP. - Otherwise, insert A records with endpoints IPs.

func (*EndpointsController) Name

func (c *EndpointsController) Name() string

func (*EndpointsController) Run

func (c *EndpointsController) Run(workers int) error

Run begins watching and syncing.

func (*EndpointsController) Stop

func (c *EndpointsController) Stop()

type KusciaCoreDNS

type KusciaCoreDNS struct {
	Next plugin.Handler
	Fall fall.F

	Zones     []string
	Namespace string
	EnvoyIP   string

	Upstream *upstream.Upstream
	Cache    *cache.Cache
	// contains filtered or unexported fields
}

KusciaCoreDNS is a plugin talk to kubernetes.

func KusciaParse

func KusciaParse(c *caddy.Controller, namespace, envoyIP string) (*KusciaCoreDNS, error)

func (*KusciaCoreDNS) IsNameError

func (e *KusciaCoreDNS) IsNameError(err error) bool

IsNameError implements the ServiceBackend interface.

func (*KusciaCoreDNS) Lookup

func (e *KusciaCoreDNS) Lookup(ctx context.Context, state request.Request, name string, typ uint16) (*dns.Msg, error)

Lookup implements the ServiceBackend interface.

func (*KusciaCoreDNS) MinTTL

func (e *KusciaCoreDNS) MinTTL(state request.Request) uint32

MinTTL implements the Transferer interface.

func (*KusciaCoreDNS) Name

func (e *KusciaCoreDNS) Name() string

Name implements the Handler interface.

func (*KusciaCoreDNS) Records

func (e *KusciaCoreDNS) Records(ctx context.Context, state request.Request, exact bool) ([]msg.Service, error)

Records looks up records in cache. If exact is true, it will lookup just this name. This is used when find matches when completing SRV lookups for instance.

func (*KusciaCoreDNS) Reverse

func (e *KusciaCoreDNS) Reverse(ctx context.Context, state request.Request, exact bool, opt plugin.Options) (services []msg.Service, err error)

Reverse implements the ServiceBackend interface.

func (*KusciaCoreDNS) Serial

func (e *KusciaCoreDNS) Serial(state request.Request) uint32

Serial implements the Transferer interface.

func (*KusciaCoreDNS) ServeDNS

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

ServeDNS implements the plugin.Handler interface.

func (*KusciaCoreDNS) Services

func (e *KusciaCoreDNS) Services(ctx context.Context, state request.Request, exact bool, opt plugin.Options) (services []msg.Service, err error)

Services implements the ServiceBackend interface.

func (*KusciaCoreDNS) Start

func (e *KusciaCoreDNS) Start(ctx context.Context, kubeClient kubernetes.Interface) error

Start create and run controllers to list-watch resources.

func (*KusciaCoreDNS) StartControllers

func (e *KusciaCoreDNS) StartControllers(ctx context.Context, kubeclient kubernetes.Interface) error

func (*KusciaCoreDNS) Transfer

func (e *KusciaCoreDNS) Transfer(ctx context.Context, state request.Request) (int, error)

Transfer implements the Transferer interface.

type PodController

type PodController struct {
	// contains filtered or unexported fields
}

PodController sync namespace's pods. For each pod, if `PodSpec.subdomain` is specified, insert A record with FQDN "<hostname>.<subdomain>.<namespace>".

func (*PodController) Name

func (c *PodController) Name() string

func (*PodController) Run

func (c *PodController) Run(int) error

func (*PodController) Stop

func (c *PodController) Stop()

Jump to

Keyboard shortcuts

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