sigs.k8s.io/external-dns@v0.14.1/docs/tutorials/nodes.md (about)

     1  # Configuring ExternalDNS to use Cluster Nodes as Source
     2  
     3  This tutorial describes how to configure ExternalDNS to use the cluster nodes as source.
     4  Using nodes (`--source=node`) as source is possible to synchronize a DNS zone with the nodes of a cluster.
     5  
     6  The node source adds an `A` record per each node `externalIP` (if not found, any IPv4 `internalIP` is used instead).
     7  It also adds an `AAAA` record per each node IPv6 `internalIP`.
     8  The TTL of the records can be set with the `external-dns.alpha.kubernetes.io/ttl` node annotation.
     9  
    10  ## Manifest (for cluster without RBAC enabled)
    11  
    12  ```
    13  ---
    14  apiVersion: apps/v1
    15  kind: Deployment
    16  metadata:
    17    name: external-dns
    18  spec:
    19    strategy:
    20      type: Recreate
    21    selector:
    22      matchLabels:
    23        app: external-dns
    24    template:
    25      metadata:
    26        labels:
    27          app: external-dns
    28      spec:
    29        serviceAccountName: external-dns
    30        containers:
    31        - name: external-dns
    32          image: registry.k8s.io/external-dns/external-dns:v0.14.0
    33          args:
    34          - --source=node # will use nodes as source
    35          - --provider=aws
    36          - --zone-name-filter=external-dns-test.my-org.com # will make ExternalDNS see only the hosted zones matching provided domain, omit to process all available hosted zones
    37          - --domain-filter=external-dns-test.my-org.com
    38          - --aws-zone-type=public
    39          - --registry=txt
    40          - --fqdn-template={{.Name}}.external-dns-test.my-org.com
    41          - --txt-owner-id=my-identifier
    42          - --policy=sync
    43          - --log-level=debug
    44  ```
    45  
    46  ## Manifest (for cluster with RBAC enabled)
    47  
    48  ```
    49  apiVersion: v1
    50  kind: ServiceAccount
    51  metadata:
    52    name: external-dns
    53  ---
    54  apiVersion: rbac.authorization.k8s.io/v1
    55  kind: ClusterRole
    56  metadata:
    57    name: external-dns
    58  rules:
    59  - apiGroups: ["route.openshift.io"]
    60    resources: ["routes"]
    61    verbs: ["get", "watch", "list"]
    62  - apiGroups: [""]
    63    resources: ["services","endpoints","pods"]
    64    verbs: ["get","watch","list"]
    65  - apiGroups: ["extensions","networking.k8s.io"]
    66    resources: ["ingresses"]
    67    verbs: ["get","watch","list"]
    68  - apiGroups: [""]
    69    resources: ["nodes"]
    70    verbs: ["get", "watch", "list"]
    71  ---
    72  apiVersion: rbac.authorization.k8s.io/v1
    73  kind: ClusterRoleBinding
    74  metadata:
    75    name: external-dns-viewer
    76  roleRef:
    77    apiGroup: rbac.authorization.k8s.io
    78    kind: ClusterRole
    79    name: external-dns
    80  subjects:
    81  - kind: ServiceAccount
    82    name: external-dns
    83    namespace: external-dns
    84  ---
    85  apiVersion: apps/v1
    86  kind: Deployment
    87  metadata:
    88    name: external-dns
    89  spec:
    90    strategy:
    91      type: Recreate
    92    selector:
    93      matchLabels:
    94        app: external-dns
    95    template:
    96      metadata:
    97        labels:
    98          app: external-dns
    99      spec:
   100        serviceAccountName: external-dns
   101        containers:
   102        - name: external-dns
   103          image: registry.k8s.io/external-dns/external-dns:v0.14.0
   104          args:
   105          - --source=node # will use nodes as source
   106          - --provider=aws
   107          - --zone-name-filter=external-dns-test.my-org.com # will make ExternalDNS see only the hosted zones matching provided domain, omit to process all available hosted zones
   108          - --domain-filter=external-dns-test.my-org.com
   109          - --aws-zone-type=public
   110          - --registry=txt
   111          - --fqdn-template={{.Name}}.external-dns-test.my-org.com
   112          - --txt-owner-id=my-identifier
   113          - --policy=sync
   114          - --log-level=debug
   115  ```