Documentation ¶
Overview ¶
Package dns provides the capability to modify DNS records for swarms.
Index ¶
- Variables
- func CreateSwarmEntries(service DNSService, pattern NamingPattern, s *swarm.Swarm) error
- func DeleteEntries(service DNSService, pattern NamingPattern, stackName string) error
- func Update(service DNSService, pattern NamingPattern, s *swarm.Swarm, ...) (bool, error)
- type CloudFlareConfig
- type CloudFlareDNS
- type DNSService
- type Entries
- type NamingPattern
- type NoopDNS
Constants ¶
This section is empty.
Variables ¶
var (
DefaultNamingPattern = NamingPattern{
Zone: "example.com",
Catchall: "*.{{.Stack}}",
CatchallPrivate: "*.{{.Stack}}.private",
Public: "{{.Stack}}",
Private: "{{.Stack}}.private",
Fleet: "{{.Stack}}.fleet",
}
)
Functions ¶
func CreateSwarmEntries ¶
func CreateSwarmEntries(service DNSService, pattern NamingPattern, s *swarm.Swarm) error
CreateSwarmEntries creates DNS entries, given a NamingPattern and Swarm.
func DeleteEntries ¶
func DeleteEntries(service DNSService, pattern NamingPattern, stackName string) error
DeleteEntries deletes DNS entries, given a NamingPattern and stack name.
func Update ¶
func Update(service DNSService, pattern NamingPattern, s *swarm.Swarm, instances []swarmtypes.Instance) (bool, error)
Update ensures that necessary DNS records that might have changed are updated.
NOTE: This currently only checks the fleet entry. Returns false if no update was necessary.
Types ¶
type CloudFlareConfig ¶
type CloudFlareConfig struct {
Email, Token string
}
CloudFlareConfig provides the static configuration for a CloudFlareDNS service.
type CloudFlareDNS ¶
type CloudFlareDNS struct { CloudFlareConfig // contains filtered or unexported fields }
CloudFlareDNS represents a client to the CloudFlare API.
func NewCloudFlareDNS ¶
func NewCloudFlareDNS(config CloudFlareConfig) *CloudFlareDNS
NewCloudFlareDNS creates a new CloudFlareDNS object based on the given config. If the config is invalid, a panic will be raised.
type DNSService ¶
type DNSService interface {
// contains filtered or unexported methods
}
DNSService provides mangement of a swarm's DNS entries.
type Entries ¶
type Entries struct { // The root domain for all entries, e.g. giantswarm.io or giantswarm.co.uk Zone string // Endpoint domains Catchall string CatchallPrivate string Public string Private string Fleet string }
Entries represents a set of DNS entries.
type NamingPattern ¶
type NamingPattern struct { // The name of the zone to create the domains in Zone string // Golang templates Catchall string CatchallPrivate string Public string Private string Fleet string }
NamingPattern defines the template to use when generating the domain names to create. Assume the value 'Stack' can be used to reference the cluster name.
The generated domain here will always be postfixed with the zone, so this is not part of the template.
func (NamingPattern) GetEntries ¶
func (np NamingPattern) GetEntries(stackName string) *Entries
GetEntries returns Entries, given a stack name.