Documentation ¶
Index ¶
- Constants
- Variables
- func DefaultInterval(ttl time.Duration) time.Duration
- func IsNoSuchHostError(err error) bool
- func NewVerifier(resolver resolver) *verifier
- type ConditionStatus
- type ConfigMapHostResolver
- type Controller
- type ControllerConfig
- type DefaultHostResolver
- type FakeProvider
- func (_ *FakeProvider) Delete(record *v1.DNSRecord, zone v1.DNSZone) error
- func (FakeProvider) DeleteHealthCheck(ctx context.Context, _ *v1.Endpoint) error
- func (_ *FakeProvider) Ensure(record *v1.DNSRecord, zone v1.DNSZone) error
- func (FakeProvider) ReconcileHealthCheck(ctx context.Context, _ v1.HealthCheck, _ *v1.Endpoint) error
- type HealthCheckReconciler
- type HostAddress
- type HostResolver
- type HostsWatcher
- type Provider
- type RecordWatcher
- type SafeHostResolver
- type Target
Constants ¶
const ( TargetTypeHost = "HOST" TargetTypeIP = "IP" )
const ANNOTATION_HEALTH_CHECK_PREFIX = "kuadrant.experimental/health-"
Variables ¶
var (
NoSuchHost = errors.New("no such host")
)
Functions ¶
func IsNoSuchHostError ¶
func NewVerifier ¶
func NewVerifier(resolver resolver) *verifier
Types ¶
type ConditionStatus ¶
type ConditionStatus string
const ( DNSRecordFinalizer = "kuadrant.dev/dns-record" ConditionTrue ConditionStatus = "True" ConditionFalse ConditionStatus = "False" ConditionUnknown ConditionStatus = "Unknown" )
type ConfigMapHostResolver ¶
type ConfigMapHostResolver struct { Client kubernetes.Interface Name, Namespace string }
ConfigMapHostResolver is a HostResolver that looks up the IP address of a host from a ConfigMap. Used for testing purposes
func (*ConfigMapHostResolver) LookupIPAddr ¶
func (r *ConfigMapHostResolver) LookupIPAddr(ctx context.Context, host string) ([]HostAddress, error)
func (*ConfigMapHostResolver) TxtRecordExists ¶
type Controller ¶
type Controller struct { *reconciler.Controller // contains filtered or unexported fields }
func NewController ¶
func NewController(config *ControllerConfig) (*Controller, error)
NewController returns a new Controller which reconciles DNSRecord.
func (*Controller) ReconcileHealthChecks ¶
type ControllerConfig ¶
type ControllerConfig struct { *reconciler.ControllerConfig DnsRecordClient kuadrantv1.ClusterInterface DNSProvider string }
type DefaultHostResolver ¶
func NewDefaultHostResolver ¶
func NewDefaultHostResolver() *DefaultHostResolver
func (*DefaultHostResolver) LookupIPAddr ¶
func (hr *DefaultHostResolver) LookupIPAddr(ctx context.Context, host string) ([]HostAddress, error)
type FakeProvider ¶
type FakeProvider struct {
// contains filtered or unexported fields
}
func (FakeProvider) DeleteHealthCheck ¶
func (FakeProvider) ReconcileHealthCheck ¶
type HealthCheckReconciler ¶
type HealthCheckReconciler interface { ReconcileHealthCheck(ctx context.Context, hc v1.HealthCheck, endpoint *v1.Endpoint) error DeleteHealthCheck(ctx context.Context, endpoint *v1.Endpoint) error }
TODO once we have a specific Health Check API this should have its own controller rather than piggy backing on the DNSRecord
type HostResolver ¶
type HostResolver interface {
LookupIPAddr(ctx context.Context, host string) ([]HostAddress, error)
}
type HostsWatcher ¶
type HostsWatcher struct { Resolver HostResolver Records []RecordWatcher OnChange func(interface{}) WatchInterval func(ttl time.Duration) time.Duration // contains filtered or unexported fields }
HostsWatcher keeps track of changes in host addresses in the background. It associates a host with a key that is passed to the `OnChange` callback whenever a change is detected
func NewHostsWatcher ¶
func NewHostsWatcher(l *logr.Logger, resolver HostResolver, watchInterval func(ttl time.Duration) time.Duration) *HostsWatcher
func (*HostsWatcher) ListHostRecordWatchers ¶
func (w *HostsWatcher) ListHostRecordWatchers(obj interface{}) []RecordWatcher
func (*HostsWatcher) StartWatching ¶
func (w *HostsWatcher) StartWatching(ctx context.Context, obj interface{}, host string) bool
StartWatching begins tracking changes in the addresses for host
func (*HostsWatcher) StopWatching ¶
func (w *HostsWatcher) StopWatching(obj interface{}, host string)
StopWatching stops tracking changes in the addresses associated to obj
type Provider ¶
type Provider interface { // Ensure will create or update record. Ensure(record *v1.DNSRecord, zone v1.DNSZone) error // Delete will delete record. Delete(record *v1.DNSRecord, zone v1.DNSZone) error // Get a health check reconciler for this provider HealthCheckReconciler }
Provider knows how to manage DNS zones only as pertains to routing.
func DNSProvider ¶
type RecordWatcher ¶
type RecordWatcher struct { Host string // contains filtered or unexported fields }
type SafeHostResolver ¶
type SafeHostResolver struct { HostResolver // contains filtered or unexported fields }
func NewSafeHostResolver ¶
func NewSafeHostResolver(inner HostResolver) *SafeHostResolver
func (*SafeHostResolver) LookupIPAddr ¶
func (r *SafeHostResolver) LookupIPAddr(ctx context.Context, host string) ([]HostAddress, error)