Documentation ¶
Index ¶
Constants ¶
const ( // RecordTypeAlias is unusual: the controller will try to resolve the target locally RecordTypeAlias = "_alias" RecordTypeA = "A" RecordTypeCNAME = "CNAME" RoleTypeExternal = "external" RoleTypeInternal = "internal" )
const DefaultTTL = time.Minute
Variables ¶
This section is empty.
Functions ¶
func AliasForNodesInRole ¶ added in v1.10.0
AliasForNodesInRole returns the alias for nodes in the given role
func EnsureDotSuffix ¶
func FixWildcards ¶ added in v1.10.0
Types ¶
type Context ¶
type Context interface { // CreateScope creates a new scope, which holds a set of records. // MarkReady must be called on every scope before any changes will be applied. // Records from all the scopes will be merged CreateScope(name string) (Scope, error) }
Context represents a state of the world for DNS. It is grouped by scopes & named keys, and controllers will replace those groups The DNS controller will then merge all those record sets, resolve aliases etc, and then call into a dns backend to match the desired state of the world.
type DNSController ¶
DNSController applies the desired DNS state to the DNS backend
func NewDNSController ¶
func NewDNSController(dnsProviders []dnsprovider.Interface, zoneRules *ZoneRules, updateInterval int) (*DNSController, error)
NewDnsController creates a DnsController
func (*DNSController) CreateScope ¶
func (c *DNSController) CreateScope(scopeName string) (Scope, error)
CreateScope creates a scope object.
type DNSControllerScope ¶
type DNSControllerScope struct { // ScopeName is the string id for this scope ScopeName string // Ready is set if the populating controller has performed an initial synchronization of records Ready bool // Records is the map of actual records for this scope Records map[string][]Record // contains filtered or unexported fields }
scope is a group of record objects
func (*DNSControllerScope) AllKeys ¶ added in v1.10.0
func (s *DNSControllerScope) AllKeys() []string
AllKeys implements Scope::AllKeys, returns all the keys in the current scope
func (*DNSControllerScope) MarkReady ¶
func (s *DNSControllerScope) MarkReady()
func (*DNSControllerScope) Replace ¶
func (s *DNSControllerScope) Replace(recordName string, records []Record)
type Record ¶
type Record struct { RecordType RecordType FQDN string Value string // If AliasTarget is set, this entry will not actually be set in DNS, // but will be used as an expansion for Records with type=RecordTypeAlias, // where the referring record has Value = our FQDN AliasTarget bool }
type RecordType ¶
type RecordType string
type Scope ¶
type Scope interface { // Replace sets the records for recordName to the provided set of records. Replace(recordName string, records []Record) // MarkReady should be called when a controller has populated all the records for a particular scope MarkReady() // AllKeys gets the set of all keys currently in the scope AllKeys() []string }
type ZoneRules ¶ added in v1.4.1
type ZoneRules struct { // We don't use a map so we can support e.g. *.example.com later Zones []*ZoneSpec Wildcard bool }
func ParseZoneRules ¶ added in v1.4.1
func (*ZoneRules) MatchesExplicitly ¶ added in v1.4.1
func (r *ZoneRules) MatchesExplicitly(zone dnsprovider.Zone) bool
MatchesExplicitly returns true if this matches an explicit rule (not a wildcard)