dnsnameresolver

package
v0.0.0-...-9b0b672 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewUnmanaged

func NewUnmanaged(mgr manager.Manager, config Config) (controller.Controller, []cache.Cache, error)

NewUnmanaged creates and returns a controller that watches DNSNameResolver objects. The controller re-resolves the DNS names which get added to the status of the DNSNameResolver objects. It also removes IP addresses of DNS names, whose TTLs have expired, from the status. This is an unmanaged controller, which means that the manager does not start it.

Types

type Config

type Config struct {
	OperandNamespace         string
	ServiceName              string
	DNSNameResolverNamespace string
}

type Resolver

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

Resolver keeps track of the DNS names, the corresponding IP addresses and TTLs. It sends DNS resolution requests to CoreDNS pods whenever TTL of any IP address associated to a DNS name expires.

func NewResolver

func NewResolver(cache cache.Cache, serviceName string) *Resolver

NewResolver initializes and returns a new resolver instance.

func (*Resolver) Add

func (resolver *Resolver) Add(
	dnsName string,
	resolvedAddresses []networkv1alpha1.DNSNameResolverResolvedAddress,
	matchesRegular bool,
	objName string,
)

Add is called whenever a DNSNameResolver object is added or updated.

func (*Resolver) Delete

func (resolver *Resolver) Delete(objName string)

Delete is called whenever a DNSNameResolver object is deleted.

func (*Resolver) Start

func (resolver *Resolver) Start()

Start starts a goroutine for sending DNS lookup requests of the DNS names on expiration of the corresponding TTLs.

Jump to

Keyboard shortcuts

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