External-dns: failed to sync cache: timed out waiting for the condition on external-dns 0.7.4

Created on 23 Oct 2020  路  1Comment  路  Source: kubernetes-sigs/external-dns

What happened:
i tried to deploy external-dns (0.7.4) on EKS (1.17) backed by fargate-pod. When external-dns starts i get the following error

time="2020-10-23T09:37:56Z" level=info msg="Instantiating new Kubernetes client"
time="2020-10-23T09:37:56Z" level=info msg="Using inCluster-config based on serviceaccount-token"
time="2020-10-23T09:37:56Z" level=info msg="Created Kubernetes client https://172.20.0.1:443"
time="2020-10-23T09:38:56Z" level=fatal msg="failed to sync cache: timed out waiting for the condition"

What you expected to happen:
from version v0.7.1

time="2020-10-23T09:41:25Z" level=info msg="Instantiating new Kubernetes client"
time="2020-10-23T09:41:25Z" level=info msg="Using inCluster-config based on serviceaccount-token"
time="2020-10-23T09:41:25Z" level=info msg="Created Kubernetes client https://172.20.0.1:443"
time="2020-10-23T09:42:02Z" level=info msg="All records are already up to date"
time="2020-10-23T09:43:00Z" level=info msg="All records are already up to date"
time="2020-10-23T09:44:00Z" level=info msg="All records are already up to date"
time="2020-10-23T09:45:00Z" level=info msg="All records are already up to date"

How to reproduce it (as minimally and precisely as possible):
EKS (with fargate)
k8s-manifests

apiVersion: v1
kind: ServiceAccount
metadata:
  labels:
    app.kubernetes.io/name: external-dns
  name: external-dns
  annotations:                                                                        # Add the annotations line
    eks.amazonaws.com/role-arn:  arn:aws:iam::${ACCOUNT_ID}:role/iam-role-for-external-dns   # Add the IAM role
  namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: external-dns
rules:
- apiGroups: [""]
  resources: ["services"]
  verbs: ["get","watch","list"]
- apiGroups: [""]
  resources: ["pods"]
  verbs: ["get","watch","list"]
- apiGroups: ["extensions"]
  resources: ["ingresses"]
  verbs: ["get","watch","list"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  labels:
    app.kubernetes.io/instance: external-dns
  name: external-dns-viewer
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: external-dns
subjects:
- kind: ServiceAccount
  name: external-dns
  namespace: kube-system
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: external-dns
  namespace: kube-system
spec:
  replicas: 1
  strategy:
    type: Recreate
  selector:
    matchLabels:
      app: external-dns
  template:
    metadata:
      labels:
        app: external-dns
    spec:
      serviceAccountName: external-dns
      securityContext:
        fsGroup: 1000
      containers:
      - name: external-dns
        image: k8s.gcr.io/external-dns/external-dns:v0.7.4
        args:
        - --source=service
        - --source=ingress
        - --provider=aws
        - --aws-zone-type=public
        - --registry=txt
        - --txt-owner-id=external-dns
        resources:
          requests:
            cpu: 250m
            memory: 500Mi
          limits:
            cpu: 250m
            memory: 500Mi

iam-role-policy

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "permissionForExternalDns1",
            "Effect": "Allow",
            "Action": "route53:ChangeResourceRecordSets",
            "Resource": "arn:aws:route53:::hostedzone/*"
        },
        {
            "Sid": "permissionForExternalDns2",
            "Effect": "Allow",
            "Action": [
                "route53:ListResourceRecordSets",
                "route53:ListHostedZones"
            ],
            "Resource": "*"
        }
    ]
}

Anything else we need to know?:
With v.0.7.1 problem is not present.

Environment:

  • External-DNS version (use external-dns --version): v.0.7.4 (also did not work with 0.7.2)
  • DNS provider: route53
  • Others: EKS 1.17 fargate pods
kinbug

Most helpful comment

You also need endpoints as listed in the official manifests: https://github.com/kubernetes-sigs/external-dns/blob/master/kustomize/external-dns-clusterrole.yaml . This will likely resolve your issue. Closing, feel free to reopen if it doesn't resolve it.

>All comments

You also need endpoints as listed in the official manifests: https://github.com/kubernetes-sigs/external-dns/blob/master/kustomize/external-dns-clusterrole.yaml . This will likely resolve your issue. Closing, feel free to reopen if it doesn't resolve it.

Was this page helpful?
0 / 5 - 0 ratings