Documentation
¶
Index ¶
- Constants
- func CalculateSyncInterval(syncPeriod time.Duration) time.Duration
- func DefaultClientFactory(apiKey string) (nextdns.ClientInterface, error)
- type ClientFactory
- type NextDNSAllowlistReconciler
- type NextDNSCoreDNSReconciler
- type NextDNSDenylistReconciler
- type NextDNSProfileReconciler
- type NextDNSTLDListReconciler
- type ResolvedLists
Constants ¶
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" )
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" )
const (
// AllowlistFinalizerName is the finalizer added to NextDNSAllowlist resources
AllowlistFinalizerName = "nextdns.io/allowlist-finalizer"
)
const (
// DenylistFinalizerName is the finalizer added to NextDNSDenylist resources
DenylistFinalizerName = "nextdns.io/denylist-finalizer"
)
const (
// TLDListFinalizerName is the finalizer added to NextDNSTLDList resources
TLDListFinalizerName = "nextdns.io/tldlist-finalizer"
)
Variables ¶
This section is empty.
Functions ¶
func CalculateSyncInterval ¶
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 ¶
func (r *NextDNSAllowlistReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
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
func (r *NextDNSCoreDNSReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
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 ¶
func (r *NextDNSDenylistReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
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 ¶
func (r *NextDNSProfileReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
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 ¶
func (r *NextDNSTLDListReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
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