Documentation ¶
Index ¶
- func ClearDNSToken(ctx context.Context, client kclient.Client, dnsSecret *corev1.Secret) error
- func IsDomainAuthError(err error) bool
- type AuthErrorResponse
- type AuthFailedNoDomainError
- type Client
- type Daemon
- type DomainResponse
- type FQDNTypePair
- type RecordRequest
- type RecordResponse
- type RecordType
- type RenewRequest
- type RenewResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClearDNSToken ¶
ClearDNSToken deletes the token used to authenticate to the AcornDNS service.
func IsDomainAuthError ¶
IsDomainAuthError checks if the error is a DomainAuthError
Types ¶
type AuthErrorResponse ¶
type AuthFailedNoDomainError ¶
type AuthFailedNoDomainError struct{}
AuthFailedNoDomainError indicates that a request failed authentication because the domain was not found. If encountered, we'll need to reserve a new domain.
func (AuthFailedNoDomainError) Error ¶
func (e AuthFailedNoDomainError) Error() string
Error implements the Error interface
type Client ¶
type Client interface { // ReserveDomain calls AcornDNS to reserve a new domain. It returns the domain, a token for authentication, // and an error ReserveDomain(endpoint string) (string, string, error) // CreateRecords calls AcornDNS to create dns records based on the supplied RecordRequests for the specified domain CreateRecords(endpoint, domain, token string, records []RecordRequest) error // Renew calls AcornDNS to renew the domain and the records specified in the renewRequest. The response will contain // "out of sync" records, which are records that AcornDNS either doesn't know about or has different values for Renew(endpoint, domain, token string, renew RenewRequest) (RenewResponse, error) // DeleteRecord calls AcornDNS to delete the record(s) associated with the supplied prefix DeleteRecord(endpoint, domain, recordPrefix, token string) error // PurgeRecords calls AcornDNS to purge all records for the given domain, but doesn't delete the domain itself PurgeRecords(endpoint, domain, token string) error }
Client handles interactions with the AcornDNS API service and Acorn.
type Daemon ¶
type Daemon struct {
// contains filtered or unexported fields
}
func (*Daemon) RenewAndSync ¶
RenewAndSync will renew the cluster's AcornDNS domain and corresponding records. It sends each ingress's full record (fqdn, type, values). In addition to renewing the records, the DNS service will return "out of sync" records that either don't exist or have different values on the DNS service side. This function will cause the ingresses for such records to resync.
Retries on an exponential backoff until successful
type DomainResponse ¶
type FQDNTypePair ¶
type RecordRequest ¶
type RecordRequest struct { Name string `json:"name,omitempty"` Type RecordType `json:"type,omitempty"` Values []string `json:"values,omitempty"` }
func ToRecordRequestsAndHash ¶
func ToRecordRequestsAndHash(domain string, ingress *v1.Ingress) ([]RecordRequest, string)
ToRecordRequestsAndHash creates DNS records based on the ingress and domain supplied. It also returns a hash of those records, suitable for using overtime to determine if the ingress's records need to change.
type RecordResponse ¶
type RecordResponse struct { RecordRequest FQDN string `json:"fqdn,omitempty"` }
type RecordType ¶
type RecordType string
const ( RecordTypeA RecordType = "A" RecordTypeAAAA RecordType = "AAAA" RecordTypeCname RecordType = "CNAME" RecordTypeTxt RecordType = "TXT" )
func (RecordType) IsValid ¶
func (rt RecordType) IsValid() error
type RenewRequest ¶
type RenewRequest struct { Records []RecordRequest `json:"records,omitempty"` Version string `json:"version,omitempty"` }
type RenewResponse ¶
type RenewResponse struct { Name string `json:"name,omitempty"` OutOfSyncRecords []FQDNTypePair `json:"outOfSyncRecords,omitempty"` }