controller

package
v0.0.0-...-b140060 Latest Latest
Warning

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

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

Documentation

Overview

Package controller implements the designate-operator Kubernetes controllers.

Package controller implements the DesignateBackendbind9 controller.

Core reconciliation logic for DesignateBackendbind9. For multipool-specific resource management (ConfigMaps, Services, StatefulSets, TSIG), see designatebackendbind9_multipool.go.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrACSecretNotFound    = errors.New("ApplicationCredential secret not found")
	ErrACSecretMissingKeys = errors.New("ApplicationCredential secret missing required keys")
)

Static errors for Application Credential handling

View Source
var (
	// ErrPoolsYamlMissing is returned when pools.yaml is not found in ConfigMap
	ErrPoolsYamlMissing = errors.New("pools.yaml not found in ConfigMap")
	// ErrPoolNotFoundInConfig is returned when a pool is not found in pools.yaml
	ErrPoolNotFoundInConfig = errors.New("pool not found in pools.yaml")
	// ErrNoDesignateCRFound is returned when no Designate CR is found in the namespace
	ErrNoDesignateCRFound = errors.New("no Designate CR found in namespace")
)
View Source
var (
	// ErrPoolsKeyMissing is returned when the ConfigMap doesn't have a 'pools' key
	ErrPoolsKeyMissing = errors.New("ConfigMap must contain 'pools' key")
	// ErrNoPoolsDefined is returned when no pools are defined
	ErrNoPoolsDefined = errors.New("at least one pool must be defined")
	// ErrDefaultPoolMissing is returned when the default pool is not present
	ErrDefaultPoolMissing = errors.New("default pool 'default' must be present in multipool configuration")
	// ErrEmptyPoolName is returned when a pool has an empty name
	ErrEmptyPoolName = errors.New("pool has empty name")
	// ErrDuplicatePoolName is returned when duplicate pool names are found
	ErrDuplicatePoolName = errors.New("duplicate pool name")
	// ErrInvalidBindReplicas is returned when bindReplicas is invalid
	ErrInvalidBindReplicas = errors.New("pool has invalid bindReplicas (must be greater than 0)")
	// ErrPoolMissingNSRecords is returned when a pool is missing NS records
	ErrPoolMissingNSRecords = errors.New("pool does not have NS records defined (each pool must define nsRecords)")
)

Functions

This section is empty.

Types

type DesignateAPIReconciler

type DesignateAPIReconciler struct {
	client.Client
	Kclient kubernetes.Interface
	Scheme  *runtime.Scheme
}

DesignateAPIReconciler reconciles a DesignateAPI object

func (*DesignateAPIReconciler) GetClient

func (r *DesignateAPIReconciler) GetClient() client.Client

GetClient -

func (*DesignateAPIReconciler) GetKClient

GetKClient -

func (*DesignateAPIReconciler) GetLogger

func (r *DesignateAPIReconciler) GetLogger(ctx context.Context) logr.Logger

GetLogger returns a logger object with a prefix of "controller.name" and additional controller context fields

func (*DesignateAPIReconciler) GetScheme

func (r *DesignateAPIReconciler) GetScheme() *runtime.Scheme

GetScheme -

func (*DesignateAPIReconciler) Reconcile

func (r *DesignateAPIReconciler) Reconcile(ctx context.Context, req ctrl.Request) (result ctrl.Result, _err 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. TODO(user): Modify the Reconcile function to compare the state specified by the DesignateAPI object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.12.2/pkg/reconcile

func (*DesignateAPIReconciler) SetupWithManager

func (r *DesignateAPIReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type DesignateBackendbind9Reconciler

type DesignateBackendbind9Reconciler struct {
	client.Client
	Kclient kubernetes.Interface
	Scheme  *runtime.Scheme
}

DesignateBackendbind9Reconciler reconciles a DesignateBackendbind9 object

func (*DesignateBackendbind9Reconciler) GetClient

GetClient -

func (*DesignateBackendbind9Reconciler) GetKClient

GetKClient -

func (*DesignateBackendbind9Reconciler) GetLogger

GetLogger returns a logger object with a prefix of "controller.name" and additional controller context fields

func (*DesignateBackendbind9Reconciler) GetScheme

GetScheme -

func (*DesignateBackendbind9Reconciler) Reconcile

func (r *DesignateBackendbind9Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (result ctrl.Result, _err 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. TODO(user): Modify the Reconcile function to compare the state specified by the DesignateBackendbind9 object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

func (*DesignateBackendbind9Reconciler) SetupWithManager

func (r *DesignateBackendbind9Reconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type DesignateCentralReconciler

type DesignateCentralReconciler struct {
	client.Client
	Kclient kubernetes.Interface
	Scheme  *runtime.Scheme
}

DesignateCentralReconciler reconciles a DesignateCentral object

func (*DesignateCentralReconciler) GetClient

func (r *DesignateCentralReconciler) GetClient() client.Client

GetClient -

func (*DesignateCentralReconciler) GetKClient

GetKClient -

func (*DesignateCentralReconciler) GetLogger

GetLogger returns a logger object with a prefix of "controller.name" and additional controller context fields

func (*DesignateCentralReconciler) GetScheme

func (r *DesignateCentralReconciler) GetScheme() *runtime.Scheme

GetScheme -

func (*DesignateCentralReconciler) Reconcile

func (r *DesignateCentralReconciler) Reconcile(ctx context.Context, req ctrl.Request) (result ctrl.Result, _err 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. TODO(user): Modify the Reconcile function to compare the state specified by the DesignateCentral object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.12.2/pkg/reconcile

func (*DesignateCentralReconciler) SetupWithManager

func (r *DesignateCentralReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type DesignateMdnsReconciler

type DesignateMdnsReconciler struct {
	client.Client
	Kclient kubernetes.Interface
	Scheme  *runtime.Scheme
}

DesignateMdnsReconciler reconciles a DesignateMdns object

func (*DesignateMdnsReconciler) GetClient

func (r *DesignateMdnsReconciler) GetClient() client.Client

GetClient -

func (*DesignateMdnsReconciler) GetKClient

GetKClient -

func (*DesignateMdnsReconciler) GetLogger

GetLogger returns a logger object with a prefix of "controller.name" and additional controller context fields

func (*DesignateMdnsReconciler) GetScheme

func (r *DesignateMdnsReconciler) GetScheme() *runtime.Scheme

GetScheme -

func (*DesignateMdnsReconciler) Reconcile

func (r *DesignateMdnsReconciler) Reconcile(ctx context.Context, req ctrl.Request) (result ctrl.Result, _err 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. TODO(user): Modify the Reconcile function to compare the state specified by the DesignateMdns object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.12.2/pkg/reconcile

func (*DesignateMdnsReconciler) SetupWithManager

func (r *DesignateMdnsReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type DesignateProducerReconciler

type DesignateProducerReconciler struct {
	client.Client
	Kclient kubernetes.Interface
	Scheme  *runtime.Scheme
}

DesignateProducerReconciler reconciles a DesignateProducer object

func (*DesignateProducerReconciler) GetClient

func (r *DesignateProducerReconciler) GetClient() client.Client

GetClient -

func (*DesignateProducerReconciler) GetKClient

GetKClient -

func (*DesignateProducerReconciler) GetLogger

GetLogger returns a logger object with a prefix of "controller.name" and additional controller context fields

func (*DesignateProducerReconciler) GetScheme

func (r *DesignateProducerReconciler) GetScheme() *runtime.Scheme

GetScheme -

func (*DesignateProducerReconciler) Reconcile

func (r *DesignateProducerReconciler) Reconcile(ctx context.Context, req ctrl.Request) (result ctrl.Result, _err 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. TODO(user): Modify the Reconcile function to compare the state specified by the DesignateProducer object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.12.2/pkg/reconcile

func (*DesignateProducerReconciler) SetupWithManager

func (r *DesignateProducerReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type DesignateReconciler

type DesignateReconciler struct {
	client.Client
	Kclient kubernetes.Interface
	Scheme  *runtime.Scheme
}

DesignateReconciler reconciles a Designate object

func (*DesignateReconciler) GetClient

func (r *DesignateReconciler) GetClient() client.Client

GetClient -

func (*DesignateReconciler) GetKClient

func (r *DesignateReconciler) GetKClient() kubernetes.Interface

GetKClient -

func (*DesignateReconciler) GetLogger

func (r *DesignateReconciler) GetLogger(ctx context.Context) logr.Logger

GetLogger returns a logger object with a prefix of "controller.name" and additional controller context fields

func (*DesignateReconciler) GetScheme

func (r *DesignateReconciler) GetScheme() *runtime.Scheme

GetScheme -

func (*DesignateReconciler) Reconcile

func (r *DesignateReconciler) Reconcile(ctx context.Context, req ctrl.Request) (result ctrl.Result, _err error)

Reconcile -

func (*DesignateReconciler) SetupWithManager

func (r *DesignateReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type DesignateWorkerReconciler

type DesignateWorkerReconciler struct {
	client.Client
	Kclient kubernetes.Interface
	Scheme  *runtime.Scheme
}

DesignateWorkerReconciler reconciles a DesignateWorker object

func (*DesignateWorkerReconciler) GetClient

func (r *DesignateWorkerReconciler) GetClient() client.Client

GetClient -

func (*DesignateWorkerReconciler) GetKClient

GetKClient -

func (*DesignateWorkerReconciler) GetLogger

GetLogger returns a logger object with a prefix of "controller.name" and additional controller context fields

func (*DesignateWorkerReconciler) GetScheme

func (r *DesignateWorkerReconciler) GetScheme() *runtime.Scheme

GetScheme -

func (*DesignateWorkerReconciler) Reconcile

func (r *DesignateWorkerReconciler) Reconcile(ctx context.Context, req ctrl.Request) (result ctrl.Result, _err 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. TODO(user): Modify the Reconcile function to compare the state specified by the DesignateWorker object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.12.2/pkg/reconcile

func (*DesignateWorkerReconciler) SetupWithManager

func (r *DesignateWorkerReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type MultipoolConfigMapValidator

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

MultipoolConfigMapValidator validates the designate-multipool-config ConfigMap

func (*MultipoolConfigMapValidator) Handle

Handle validates the ConfigMap

func (*MultipoolConfigMapValidator) InjectDecoder

func (v *MultipoolConfigMapValidator) InjectDecoder(d *admission.Decoder) error

InjectDecoder injects the decoder

type NSRecord

type NSRecord struct {
	Hostname string `yaml:"hostname"`
	Priority int    `yaml:"priority"`
}

NSRecord represents a nameserver record

type PoolConfig

type PoolConfig struct {
	Name         string            `yaml:"name"`
	Description  string            `yaml:"description,omitempty"`
	Attributes   map[string]string `yaml:"attributes,omitempty"`
	BindReplicas int32             `yaml:"bindReplicas"`
	NSRecords    []NSRecord        `yaml:"nsRecords,omitempty"`
}

PoolConfig represents a pool configuration from the ConfigMap

type StubZoneTmplRec

type StubZoneTmplRec struct {
	Name    string
	Options map[string]string
	Servers []string
}

StubZoneTmplRec represents a stub zone template record configuration

type UnboundReconciler

type UnboundReconciler struct {
	client.Client
	Kclient kubernetes.Interface
	Scheme  *runtime.Scheme
}

UnboundReconciler -

func (*UnboundReconciler) GetLogger

func (r *UnboundReconciler) GetLogger(ctx context.Context) logr.Logger

GetLogger returns a logger object with a prefix of "controller.name" and additional controller context fields

func (*UnboundReconciler) Reconcile

func (r *UnboundReconciler) Reconcile(ctx context.Context, req ctrl.Request) (result ctrl.Result, _err error)

Reconcile implementation for designate's Unbound resolver

func (*UnboundReconciler) SetupWithManager

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

SetupWithManager for setting up the reconciler for the unbound resolver.

Jump to

Keyboard shortcuts

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