kubernetes-sigs / external-dns

Configure external DNS servers (AWS Route53, Google CloudDNS and others) for Kubernetes Ingresses and Services
Apache License 2.0
7.72k stars 2.57k forks source link

ExternalDNS keeps creating records every check (AWS) #1368

Closed kerwanp closed 4 years ago

kerwanp commented 4 years ago

Hi,

The problem is simple. ExternalDNS keeps creating again and again the records every check.

Arguments of externalDNS:

    args:
        - '--log-level=info'
        - '--log-format=text'
        - '--policy=upsert-only'
        - '--provider=aws'
        - '--registry=txt'
        - '--interval=1m'
        - '--source=service'
        - '--source=ingress'
        - '--aws-batch-change-size=1000'

Logs of externalDNS:

2020-01-14T14:19:58.866887355Z time="2020-01-14T14:19:58Z" level=info msg="Desired change: CREATE redmine-tmp.xxxxxxxxxx.com TXT [Id: /hostedzone/ZHASD5BJR9NE1]"
2020-01-14T14:19:58.866901413Z time="2020-01-14T14:19:58Z" level=info msg="Desired change: CREATE wikijs.xxxxxxxxxx.com TXT [Id: /hostedzone/ZHASD5BJR9NE1]"
2020-01-14T14:19:58.866906754Z time="2020-01-14T14:19:58Z" level=info msg="Desired change: CREATE vault.xxxxxxxxxx.com TXT [Id: /hostedzone/ZHASD5BJR9NE1]"
2020-01-14T14:19:59.023307845Z time="2020-01-14T14:19:59Z" level=info msg="6 record(s) in zone xxxxxxxxxx.com. [Id: /hostedzone/ZHASD5BJR9NE1] were successfully updated"
2020-01-14T14:20:58.849573106Z time="2020-01-14T14:20:58Z" level=info msg="Desired change: CREATE vault.xxxxxxxxxx.com A [Id: /hostedzone/ZHASD5BJR9NE1]"
2020-01-14T14:20:58.84966363Z time="2020-01-14T14:20:58Z" level=info msg="Desired change: CREATE redmine-tmp.xxxxxxxxxx.com A [Id: /hostedzone/ZHASD5BJR9NE1]"
2020-01-14T14:20:58.849672861Z time="2020-01-14T14:20:58Z" level=info msg="Desired change: CREATE wikijs.xxxxxxxxxx.com A [Id: /hostedzone/ZHASD5BJR9NE1]"
2020-01-14T14:20:58.849677635Z time="2020-01-14T14:20:58Z" level=info msg="Desired change: CREATE vault.xxxxxxxxxx.com TXT [Id: /hostedzone/ZHASD5BJR9NE1]"
2020-01-14T14:20:58.849682168Z time="2020-01-14T14:20:58Z" level=info msg="Desired change: CREATE redmine-tmp.xxxxxxxxxx.com TXT [Id: /hostedzone/ZHASD5BJR9NE1]"
2020-01-14T14:20:58.849687119Z time="2020-01-14T14:20:58Z" level=info msg="Desired change: CREATE wikijs.xxxxxxxxxx.com TXT [Id: /hostedzone/ZHASD5BJR9NE1]"
2020-01-14T14:20:58.982217786Z time="2020-01-14T14:20:58Z" level=info msg="6 record(s) in zone xxxxxxxxxx.com. [Id: /hostedzone/ZHASD5BJR9NE1] were successfully updated"
2020-01-14T14:21:58.858082309Z time="2020-01-14T14:21:58Z" level=info msg="Desired change: CREATE redmine-tmp.xxxxxxxxxx.com A [Id: /hostedzone/ZHASD5BJR9NE1]"
2020-01-14T14:21:58.858146884Z time="2020-01-14T14:21:58Z" level=info msg="Desired change: CREATE wikijs.xxxxxxxxxx.com A [Id: /hostedzone/ZHASD5BJR9NE1]"
2020-01-14T14:21:58.85815434Z time="2020-01-14T14:21:58Z" level=info msg="Desired change: CREATE vault.xxxxxxxxxx.com A [Id: /hostedzone/ZHASD5BJR9NE1]"
2020-01-14T14:21:58.858159453Z time="2020-01-14T14:21:58Z" level=info msg="Desired change: CREATE redmine-tmp.xxxxxxxxxx.com TXT [Id: /hostedzone/ZHASD5BJR9NE1]"
2020-01-14T14:21:58.858710321Z time="2020-01-14T14:21:58Z" level=info msg="Desired change: CREATE wikijs.xxxxxxxxxx.com TXT [Id: /hostedzone/ZHASD5BJR9NE1]"
2020-01-14T14:21:58.858746866Z time="2020-01-14T14:21:58Z" level=info msg="Desired change: CREATE vault.xxxxxxxxxx.com TXT [Id: /hostedzone/ZHASD5BJR9NE1]"
2020-01-14T14:21:58.99935327Z time="2020-01-14T14:21:58Z" level=info msg="6 record(s) in zone xxxxxxxxxx.com. [Id: /hostedzone/ZHASD5BJR9NE1] were successfully updated"
2020-01-14T14:22:58.85037177Z time="2020-01-14T14:22:58Z" level=info msg="Desired change: CREATE wikijs.xxxxxxxxxx.com A [Id: /hostedzone/ZHASD5BJR9NE1]"
2020-01-14T14:22:58.850424408Z time="2020-01-14T14:22:58Z" level=info msg="Desired change: CREATE redmine-tmp.xxxxxxxxxx.com A [Id: /hostedzone/ZHASD5BJR9NE1]"
2020-01-14T14:22:58.850430995Z time="2020-01-14T14:22:58Z" level=info msg="Desired change: CREATE vault.xxxxxxxxxx.com A [Id: /hostedzone/ZHASD5BJR9NE1]"
2020-01-14T14:22:58.850436024Z time="2020-01-14T14:22:58Z" level=info msg="Desired change: CREATE wikijs.xxxxxxxxxx.com TXT [Id: /hostedzone/ZHASD5BJR9NE1]"
2020-01-14T14:22:58.850440456Z time="2020-01-14T14:22:58Z" level=info msg="Desired change: CREATE redmine-tmp.xxxxxxxxxx.com TXT [Id: /hostedzone/ZHASD5BJR9NE1]"
2020-01-14T14:22:58.850444875Z time="2020-01-14T14:22:58Z" level=info msg="Desired change: CREATE vault.xxxxxxxxxx.com TXT [Id: /hostedzone/ZHASD5BJR9NE1]"
2020-01-14T14:22:59.001229018Z time="2020-01-14T14:22:59Z" level=info msg="6 record(s) in zone xxxxxxxxxx.com. [Id: /hostedzone/ZHASD5BJR9NE1] were successfully updated"

When restarting the ALB Ingress Controller, the first check works but not the others:

2020-01-14T14:25:19.66734398Z time="2020-01-14T14:25:19Z" level=info msg="config: {Master: KubeConfig: RequestTimeout:30s IstioIngressGatewayServices:[istio-system/istio-ingressgateway] ContourLoadBalancerService:heptio-contour/contour Sources:[service ingress] Namespace: AnnotationFilter: FQDNTemplate: CombineFQDNAndAnnotation:false IgnoreHostnameAnnotation:false Compatibility: PublishInternal:false PublishHostIP:false ConnectorSourceServer:localhost:8080 Provider:aws GoogleProject: DomainFilter:[] ExcludeDomains:[] ZoneIDFilter:[] AlibabaCloudConfigFile:/etc/kubernetes/alibaba-cloud.json AlibabaCloudZoneType: AWSZoneType: AWSZoneTagFilter:[] AWSAssumeRole: AWSBatchChangeSize:1000 AWSBatchChangeInterval:1s AWSEvaluateTargetHealth:true AWSAPIRetries:3 AWSPreferCNAME:false AzureConfigFile:/etc/kubernetes/azure.json AzureResourceGroup: CloudflareProxied:false CloudflareZonesPerPage:50 CoreDNSPrefix:/skydns/ RcodezeroTXTEncrypt:false InfobloxGridHost: InfobloxWapiPort:443 InfobloxWapiUsername:admin InfobloxWapiPassword: InfobloxWapiVersion:2.3.1 InfobloxSSLVerify:true InfobloxView: InfobloxMaxResults:0 DynCustomerName: DynUsername: DynPassword: DynMinTTLSeconds:0 OCIConfigFile:/etc/kubernetes/oci.yaml InMemoryZones:[] PDNSServer:http://localhost:8081 PDNSAPIKey: PDNSTLSEnabled:false TLSCA: TLSClientCert: TLSClientCertKey: Policy:upsert-only Registry:txt TXTOwnerID:default TXTPrefix: Interval:1m0s Once:false DryRun:false LogFormat:text MetricsAddress::7979 LogLevel:info TXTCacheInterval:0s ExoscaleEndpoint:https://api.exoscale.ch/dns ExoscaleAPIKey: ExoscaleAPISecret: CRDSourceAPIVersion:externaldns.k8s.io/v1alpha1 CRDSourceKind:DNSEndpoint ServiceTypeFilter:[] CFAPIEndpoint: CFUsername: CFPassword: RFC2136Host: RFC2136Port:0 RFC2136Zone: RFC2136Insecure:false RFC2136TSIGKeyName: RFC2136TSIGSecret: RFC2136TSIGSecretAlg: RFC2136TAXFR:false NS1Endpoint: NS1IgnoreSSL:false TransIPAccountName: TransIPPrivateKeyFile:}"
2020-01-14T14:25:19.669060441Z time="2020-01-14T14:25:19Z" level=info msg="Created Kubernetes client https://172.20.0.1:443"
2020-01-14T14:25:22.886140492Z time="2020-01-14T14:25:22Z" level=info msg="All records are already up to date"
2020-01-14T14:26:22.834586917Z time="2020-01-14T14:26:22Z" level=info msg="Desired change: CREATE redmine-tmp.xxxxxxxxxx.com A [Id: /hostedzone/ZHASD5BJR9NE1]"
2020-01-14T14:26:22.834637742Z time="2020-01-14T14:26:22Z" level=info msg="Desired change: CREATE wikijs.xxxxxxxxxx.com A [Id: /hostedzone/ZHASD5BJR9NE1]"
2020-01-14T14:26:22.834645965Z time="2020-01-14T14:26:22Z" level=info msg="Desired change: CREATE vault.xxxxxxxxxx.com A [Id: /hostedzone/ZHASD5BJR9NE1]"
2020-01-14T14:26:22.834650787Z time="2020-01-14T14:26:22Z" level=info msg="Desired change: CREATE redmine-tmp.xxxxxxxxxx.com TXT [Id: /hostedzone/ZHASD5BJR9NE1]"
2020-01-14T14:26:22.834703481Z time="2020-01-14T14:26:22Z" level=info msg="Desired change: CREATE wikijs.xxxxxxxxxx.com TXT [Id: /hostedzone/ZHASD5BJR9NE1]"
2020-01-14T14:26:22.834710953Z time="2020-01-14T14:26:22Z" level=info msg="Desired change: CREATE vault.xxxxxxxxxx.com TXT [Id: /hostedzone/ZHASD5BJR9NE1]"
2020-01-14T14:26:22.989463459Z time="2020-01-14T14:26:22Z" level=info msg="6 record(s) in zone xxxxxxxxxx.com. [Id: /hostedzone/ZHASD5BJR9NE1] were successfully updated"

Thanks in advance.

kerwanp commented 4 years ago

I found where is the problem. I have an other externalDNS with the policy sync in an other Cluster managing the same zone. One is keeping deleting the records and the other one creates them.