Skip to content
Closed
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions controller/execute.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,13 +199,18 @@ func Execute() {
zoneIDFilter,
cfg.CloudflareProxied,
cfg.DryRun,
cfg.CloudflareDNSRecordsPerPage,
cfg.CloudflareRegionKey,
cloudflare.CustomHostnamesConfig{
Enabled: cfg.CloudflareCustomHostnames,
MinTLSVersion: cfg.CloudflareCustomHostnamesMinTLSVersion,
CertificateAuthority: cfg.CloudflareCustomHostnamesCertificateAuthority,
})
},
cloudflare.DNSRecordsConfig{
PerPage: cfg.CloudflareDNSRecordsPerPage,
Comment: cfg.CloudflareRecordComment,
Tags: cfg.CloudflareRecordTags,
},
)
case "google":
p, err = google.NewGoogleProvider(ctx, cfg.GoogleProject, domainFilter, zoneIDFilter, cfg.GoogleBatchChangeSize, cfg.GoogleBatchChangeInterval, cfg.GoogleZoneVisibility, cfg.DryRun)
case "digitalocean":
Expand Down
2 changes: 2 additions & 0 deletions docs/flags.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@
| `--cloudflare-custom-hostnames-certificate-authority=google` | When using the Cloudflare provider with the Custom Hostnames, specify which Cerrtificate Authority will be used by default. (default: google, options: google, ssl_com, lets_encrypt) |
| `--cloudflare-dns-records-per-page=100` | When using the Cloudflare provider, specify how many DNS records listed per page, max possible 5,000 (default: 100) |
| `--cloudflare-region-key=CLOUDFLARE-REGION-KEY` | When using the Cloudflare provider, specify the region (default: earth) |
| `--cloudflare-record-comment=""` | When using the Cloudflare provider, specify the comment for the DNS records (default: '') |
| `--cloudflare-record-tags=""` | When using the Cloudflare provider, specify the tags for the DNS records as a comma-separated string (default: '') |
| `--coredns-prefix="/skydns/"` | When using the CoreDNS provider, specify the prefix name |
| `--akamai-serviceconsumerdomain=""` | When using the Akamai provider, specify the base URL (required when --provider=akamai and edgerc-path not specified) |
| `--akamai-client-token=""` | When using the Akamai provider, specify the client token (required when --provider=akamai and edgerc-path not specified) |
Expand Down
253 changes: 130 additions & 123 deletions pkg/apis/externaldns/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ type Config struct {
CloudflareCustomHostnamesCertificateAuthority string
CloudflareDNSRecordsPerPage int
CloudflareRegionKey string
CloudflareRecordComment string
CloudflareRecordTags string
CoreDNSPrefix string
AkamaiServiceConsumerDomain string
AkamaiClientToken string
Expand Down Expand Up @@ -256,129 +258,130 @@ var defaultConfig = &Config{
CloudflareDNSRecordsPerPage: 100,
CloudflareProxied: false,
CloudflareRegionKey: "earth",

CombineFQDNAndAnnotation: false,
Compatibility: "",
ConnectorSourceServer: "localhost:8080",
CoreDNSPrefix: "/skydns/",
CRDSourceAPIVersion: "externaldns.k8s.io/v1alpha1",
CRDSourceKind: "DNSEndpoint",
DefaultTargets: []string{},
DigitalOceanAPIPageSize: 50,
DomainFilter: []string{},
DryRun: false,
ExcludeDNSRecordTypes: []string{},
ExcludeDomains: []string{},
ExcludeTargetNets: []string{},
ExcludeUnschedulable: true,
ExoscaleAPIEnvironment: "api",
ExoscaleAPIKey: "",
ExoscaleAPISecret: "",
ExoscaleAPIZone: "ch-gva-2",
ExposeInternalIPV6: true,
FQDNTemplate: "",
GatewayLabelFilter: "",
GatewayName: "",
GatewayNamespace: "",
GlooNamespaces: []string{"gloo-system"},
GoDaddyAPIKey: "",
GoDaddyOTE: false,
GoDaddySecretKey: "",
GoDaddyTTL: 600,
GoogleBatchChangeInterval: time.Second,
GoogleBatchChangeSize: 1000,
GoogleProject: "",
GoogleZoneVisibility: "",
IBMCloudConfigFile: "/etc/kubernetes/ibmcloud.json",
IBMCloudProxied: false,
IgnoreHostnameAnnotation: false,
IgnoreIngressRulesSpec: false,
IgnoreIngressTLSSpec: false,
IngressClassNames: nil,
InMemoryZones: []string{},
Interval: time.Minute,
KubeConfig: "",
LabelFilter: labels.Everything().String(),
LogFormat: "text",
LogLevel: logrus.InfoLevel.String(),
ManagedDNSRecordTypes: []string{endpoint.RecordTypeA, endpoint.RecordTypeAAAA, endpoint.RecordTypeCNAME},
MetricsAddress: ":7979",
MinEventSyncInterval: 5 * time.Second,
Namespace: "",
NAT64Networks: []string{},
NS1Endpoint: "",
NS1IgnoreSSL: false,
OCIConfigFile: "/etc/kubernetes/oci.yaml",
OCIZoneCacheDuration: 0 * time.Second,
OCIZoneScope: "GLOBAL",
Once: false,
OVHApiRateLimit: 20,
OVHEnableCNAMERelative: false,
OVHEndpoint: "ovh-eu",
PDNSAPIKey: "",
PDNSServer: "http://localhost:8081",
PDNSServerID: "localhost",
PDNSSkipTLSVerify: false,
PiholeApiVersion: "5",
PiholePassword: "",
PiholeServer: "",
PiholeTLSInsecureSkipVerify: false,
PluralCluster: "",
PluralProvider: "",
PodSourceDomain: "",
Policy: "sync",
Provider: "",
ProviderCacheTime: 0,
PublishHostIP: false,
PublishInternal: false,
RegexDomainExclusion: regexp.MustCompile(""),
RegexDomainFilter: regexp.MustCompile(""),
Registry: "txt",
RequestTimeout: time.Second * 30,
RFC2136BatchChangeSize: 50,
RFC2136GSSTSIG: false,
RFC2136Host: []string{""},
RFC2136Insecure: false,
RFC2136KerberosPassword: "",
RFC2136KerberosRealm: "",
RFC2136KerberosUsername: "",
RFC2136LoadBalancingStrategy: "disabled",
RFC2136MinTTL: 0,
RFC2136Port: 0,
RFC2136SkipTLSVerify: false,
RFC2136TAXFR: true,
RFC2136TSIGKeyName: "",
RFC2136TSIGSecret: "",
RFC2136TSIGSecretAlg: "",
RFC2136UseTLS: false,
RFC2136Zone: []string{},
ServiceTypeFilter: []string{},
SkipperRouteGroupVersion: "zalando.org/v1",
Sources: nil,
TargetNetFilter: []string{},
TencentCloudConfigFile: "/etc/kubernetes/tencent-cloud.json",
TencentCloudZoneType: "",
TLSCA: "",
TLSClientCert: "",
TLSClientCertKey: "",
TraefikDisableLegacy: false,
TraefikDisableNew: false,
TransIPAccountName: "",
TransIPPrivateKeyFile: "",
TXTCacheInterval: 0,
TXTEncryptAESKey: "",
TXTEncryptEnabled: false,
TXTNewFormatOnly: false,
TXTOwnerID: "default",
TXTPrefix: "",
TXTSuffix: "",
TXTWildcardReplacement: "",
UpdateEvents: false,
WebhookProviderReadTimeout: 5 * time.Second,
WebhookProviderURL: "http://localhost:8888",
WebhookProviderWriteTimeout: 10 * time.Second,
WebhookServer: false,
ZoneIDFilter: []string{},
CloudflareRecordComment: "",
CloudflareRecordTags: "",
CombineFQDNAndAnnotation: false,
Compatibility: "",
ConnectorSourceServer: "localhost:8080",
CoreDNSPrefix: "/skydns/",
CRDSourceAPIVersion: "externaldns.k8s.io/v1alpha1",
CRDSourceKind: "DNSEndpoint",
DefaultTargets: []string{},
DigitalOceanAPIPageSize: 50,
DomainFilter: []string{},
DryRun: false,
ExcludeDNSRecordTypes: []string{},
ExcludeDomains: []string{},
ExcludeTargetNets: []string{},
ExcludeUnschedulable: true,
ExoscaleAPIEnvironment: "api",
ExoscaleAPIKey: "",
ExoscaleAPISecret: "",
ExoscaleAPIZone: "ch-gva-2",
ExposeInternalIPV6: true,
FQDNTemplate: "",
GatewayLabelFilter: "",
GatewayName: "",
GatewayNamespace: "",
GlooNamespaces: []string{"gloo-system"},
GoDaddyAPIKey: "",
GoDaddyOTE: false,
GoDaddySecretKey: "",
GoDaddyTTL: 600,
GoogleBatchChangeInterval: time.Second,
GoogleBatchChangeSize: 1000,
GoogleProject: "",
GoogleZoneVisibility: "",
IBMCloudConfigFile: "/etc/kubernetes/ibmcloud.json",
IBMCloudProxied: false,
IgnoreHostnameAnnotation: false,
IgnoreIngressRulesSpec: false,
IgnoreIngressTLSSpec: false,
IngressClassNames: nil,
InMemoryZones: []string{},
Interval: time.Minute,
KubeConfig: "",
LabelFilter: labels.Everything().String(),
LogFormat: "text",
LogLevel: logrus.InfoLevel.String(),
ManagedDNSRecordTypes: []string{endpoint.RecordTypeA, endpoint.RecordTypeAAAA, endpoint.RecordTypeCNAME},
MetricsAddress: ":7979",
MinEventSyncInterval: 5 * time.Second,
Namespace: "",
NAT64Networks: []string{},
NS1Endpoint: "",
NS1IgnoreSSL: false,
OCIConfigFile: "/etc/kubernetes/oci.yaml",
OCIZoneCacheDuration: 0 * time.Second,
OCIZoneScope: "GLOBAL",
Once: false,
OVHApiRateLimit: 20,
OVHEnableCNAMERelative: false,
OVHEndpoint: "ovh-eu",
PDNSAPIKey: "",
PDNSServer: "http://localhost:8081",
PDNSServerID: "localhost",
PDNSSkipTLSVerify: false,
PiholeApiVersion: "5",
PiholePassword: "",
PiholeServer: "",
PiholeTLSInsecureSkipVerify: false,
PluralCluster: "",
PluralProvider: "",
PodSourceDomain: "",
Policy: "sync",
Provider: "",
ProviderCacheTime: 0,
PublishHostIP: false,
PublishInternal: false,
RegexDomainExclusion: regexp.MustCompile(""),
RegexDomainFilter: regexp.MustCompile(""),
Registry: "txt",
RequestTimeout: time.Second * 30,
RFC2136BatchChangeSize: 50,
RFC2136GSSTSIG: false,
RFC2136Host: []string{""},
RFC2136Insecure: false,
RFC2136KerberosPassword: "",
RFC2136KerberosRealm: "",
RFC2136KerberosUsername: "",
RFC2136LoadBalancingStrategy: "disabled",
RFC2136MinTTL: 0,
RFC2136Port: 0,
RFC2136SkipTLSVerify: false,
RFC2136TAXFR: true,
RFC2136TSIGKeyName: "",
RFC2136TSIGSecret: "",
RFC2136TSIGSecretAlg: "",
RFC2136UseTLS: false,
RFC2136Zone: []string{},
ServiceTypeFilter: []string{},
SkipperRouteGroupVersion: "zalando.org/v1",
Sources: nil,
TargetNetFilter: []string{},
TencentCloudConfigFile: "/etc/kubernetes/tencent-cloud.json",
TencentCloudZoneType: "",
TLSCA: "",
TLSClientCert: "",
TLSClientCertKey: "",
TraefikDisableLegacy: false,
TraefikDisableNew: false,
TransIPAccountName: "",
TransIPPrivateKeyFile: "",
TXTCacheInterval: 0,
TXTEncryptAESKey: "",
TXTEncryptEnabled: false,
TXTNewFormatOnly: false,
TXTOwnerID: "default",
TXTPrefix: "",
TXTSuffix: "",
TXTWildcardReplacement: "",
UpdateEvents: false,
WebhookProviderReadTimeout: 5 * time.Second,
WebhookProviderURL: "http://localhost:8888",
WebhookProviderWriteTimeout: 10 * time.Second,
WebhookServer: false,
ZoneIDFilter: []string{},
}

// NewConfig returns new Config object
Expand Down Expand Up @@ -530,12 +533,16 @@ func App(cfg *Config) *kingpin.Application {
app.Flag("tencent-cloud-config-file", "When using the Tencent Cloud provider, specify the Tencent Cloud configuration file (required when --provider=tencentcloud)").Default(defaultConfig.TencentCloudConfigFile).StringVar(&cfg.TencentCloudConfigFile)
app.Flag("tencent-cloud-zone-type", "When using the Tencent Cloud provider, filter for zones with visibility (optional, options: public, private)").Default(defaultConfig.TencentCloudZoneType).EnumVar(&cfg.TencentCloudZoneType, "", "public", "private")

// Flags related to Cloudflare
app.Flag("cloudflare-proxied", "When using the Cloudflare provider, specify if the proxy mode must be enabled (default: disabled)").BoolVar(&cfg.CloudflareProxied)
app.Flag("cloudflare-custom-hostnames", "When using the Cloudflare provider, specify if the Custom Hostnames feature will be used. Requires \"Cloudflare for SaaS\" enabled. (default: disabled)").BoolVar(&cfg.CloudflareCustomHostnames)
app.Flag("cloudflare-custom-hostnames-min-tls-version", "When using the Cloudflare provider with the Custom Hostnames, specify which Minimum TLS Version will be used by default. (default: 1.0, options: 1.0, 1.1, 1.2, 1.3)").Default("1.0").EnumVar(&cfg.CloudflareCustomHostnamesMinTLSVersion, "1.0", "1.1", "1.2", "1.3")
app.Flag("cloudflare-custom-hostnames-certificate-authority", "When using the Cloudflare provider with the Custom Hostnames, specify which Cerrtificate Authority will be used by default. (default: google, options: google, ssl_com, lets_encrypt)").Default("google").EnumVar(&cfg.CloudflareCustomHostnamesCertificateAuthority, "google", "ssl_com", "lets_encrypt")
app.Flag("cloudflare-dns-records-per-page", "When using the Cloudflare provider, specify how many DNS records listed per page, max possible 5,000 (default: 100)").Default(strconv.Itoa(defaultConfig.CloudflareDNSRecordsPerPage)).IntVar(&cfg.CloudflareDNSRecordsPerPage)
app.Flag("cloudflare-region-key", "When using the Cloudflare provider, specify the region (default: earth)").StringVar(&cfg.CloudflareRegionKey)
app.Flag("cloudflare-record-comment", "When using the Cloudflare provider, specify the comment for the DNS records (default: '')").Default("").StringVar(&cfg.CloudflareRecordComment)
app.Flag("cloudflare-record-tags", "When using the Cloudflare provider, specify the tags for the DNS records as a comma-separated string (default: '')").Default("").StringVar(&cfg.CloudflareRecordTags)

app.Flag("coredns-prefix", "When using the CoreDNS provider, specify the prefix name").Default(defaultConfig.CoreDNSPrefix).StringVar(&cfg.CoreDNSPrefix)
app.Flag("akamai-serviceconsumerdomain", "When using the Akamai provider, specify the base URL (required when --provider=akamai and edgerc-path not specified)").Default(defaultConfig.AkamaiServiceConsumerDomain).StringVar(&cfg.AkamaiServiceConsumerDomain)
app.Flag("akamai-client-token", "When using the Akamai provider, specify the client token (required when --provider=akamai and edgerc-path not specified)").Default(defaultConfig.AkamaiClientToken).StringVar(&cfg.AkamaiClientToken)
Expand Down
Loading
Loading