controller

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2026 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CoreDNSFinalizerName is the finalizer used by the CoreDNS controller
	CoreDNSFinalizerName = "nextdns.io/coredns-finalizer"

	// ConditionTypeProfileResolved indicates the referenced profile is resolved
	ConditionTypeProfileResolved = "ProfileResolved"

	// ConditionTypeMultusIPWarning indicates Multus IP configuration issues
	ConditionTypeMultusIPWarning = "MultusIPWarning"

	// ConditionTypeDeviceNameIgnored warns that deviceName has no effect with plain DNS
	ConditionTypeDeviceNameIgnored = "DeviceNameIgnored"

	// ConditionTypeGatewayReady indicates the Gateway is programmed
	ConditionTypeGatewayReady = "GatewayReady"

	// ConditionTypeTCPRouteReady indicates the TCPRoute is accepted
	ConditionTypeTCPRouteReady = "TCPRouteReady"

	// ConditionTypeUDPRouteReady indicates the UDPRoute is accepted
	ConditionTypeUDPRouteReady = "UDPRouteReady"

	// CorefileKey is the key in the ConfigMap for the Corefile
	CorefileKey = "Corefile"
)
View Source
const (
	// FinalizerName is the finalizer used by this controller
	FinalizerName = "nextdns.io/profile-finalizer"

	// ConditionTypeReady indicates the profile is ready
	ConditionTypeReady = "Ready"

	// ConditionTypeSynced indicates the profile is synced with NextDNS
	ConditionTypeSynced = "Synced"

	// ConditionTypeReferencesResolved indicates all references are resolved
	ConditionTypeReferencesResolved = "ReferencesResolved"

	// ConditionTypeObserveOnly indicates the profile is in observe-only mode
	ConditionTypeObserveOnly = "ObserveOnly"
)
View Source
const (
	// AllowlistFinalizerName is the finalizer added to NextDNSAllowlist resources
	AllowlistFinalizerName = "nextdns.io/allowlist-finalizer"
)
View Source
const (
	// DenylistFinalizerName is the finalizer added to NextDNSDenylist resources
	DenylistFinalizerName = "nextdns.io/denylist-finalizer"
)
View Source
const (
	// TLDListFinalizerName is the finalizer added to NextDNSTLDList resources
	TLDListFinalizerName = "nextdns.io/tldlist-finalizer"
)

Variables

This section is empty.

Functions

func CalculateSyncInterval

func CalculateSyncInterval(syncPeriod time.Duration) time.Duration

CalculateSyncInterval calculates the next sync interval with ±10% jitter to prevent thundering herd when multiple resources sync simultaneously. Returns 0 if syncPeriod is 0 (periodic sync disabled).

func DefaultClientFactory

func DefaultClientFactory(apiKey string) (nextdns.ClientInterface, error)

DefaultClientFactory creates a real NextDNS client

Types

type ClientFactory

type ClientFactory func(apiKey string) (nextdns.ClientInterface, error)

ClientFactory is a function that creates a NextDNS client

type NextDNSAllowlistReconciler

type NextDNSAllowlistReconciler struct {
	client.Client
	Scheme     *runtime.Scheme
	SyncPeriod time.Duration
}

NextDNSAllowlistReconciler reconciles a NextDNSAllowlist object

func (*NextDNSAllowlistReconciler) Reconcile

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.

func (*NextDNSAllowlistReconciler) SetupWithManager

func (r *NextDNSAllowlistReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type NextDNSCoreDNSReconciler added in v0.5.0

type NextDNSCoreDNSReconciler struct {
	client.Client
	Scheme              *runtime.Scheme
	SyncPeriod          time.Duration
	GatewayAPIAvailable bool
	GatewayClassName    string
}

NextDNSCoreDNSReconciler reconciles a NextDNSCoreDNS object

func (*NextDNSCoreDNSReconciler) Reconcile added in v0.5.0

Reconcile is part of the main kubernetes reconciliation loop

func (*NextDNSCoreDNSReconciler) SetupWithManager added in v0.5.0

func (r *NextDNSCoreDNSReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager

type NextDNSDenylistReconciler

type NextDNSDenylistReconciler struct {
	client.Client
	Scheme     *runtime.Scheme
	SyncPeriod time.Duration
}

NextDNSDenylistReconciler reconciles a NextDNSDenylist object

func (*NextDNSDenylistReconciler) Reconcile

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.

func (*NextDNSDenylistReconciler) SetupWithManager

func (r *NextDNSDenylistReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type NextDNSProfileReconciler

type NextDNSProfileReconciler struct {
	client.Client
	Scheme        *runtime.Scheme
	ClientFactory ClientFactory
	SyncPeriod    time.Duration
	// contains filtered or unexported fields
}

NextDNSProfileReconciler reconciles a NextDNSProfile object

func (*NextDNSProfileReconciler) Reconcile

Reconcile is part of the main kubernetes reconciliation loop

func (*NextDNSProfileReconciler) SetupWithManager

func (r *NextDNSProfileReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager

type NextDNSTLDListReconciler

type NextDNSTLDListReconciler struct {
	client.Client
	Scheme     *runtime.Scheme
	SyncPeriod time.Duration
}

NextDNSTLDListReconciler reconciles a NextDNSTLDList object

func (*NextDNSTLDListReconciler) Reconcile

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.

func (*NextDNSTLDListReconciler) SetupWithManager

func (r *NextDNSTLDListReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type ResolvedLists

type ResolvedLists struct {
	Allowlist      []nextdns.DomainEntry
	Denylist       []nextdns.DomainEntry
	TLDs           []string // TLDs stay as strings - NextDNS API doesn't support active field for TLDs
	ResourceStatus *nextdnsv1alpha1.ReferencedResources
}

ResolvedLists contains the merged lists from all sources

Jump to

Keyboard shortcuts

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