Verify ExternalDNS with CoreDNS back end after deployment

Verify ExternalDNS with CoreDNS back end after deploymentΒΆ

After you complete the steps described in Deploy ExternalDNS, verify that ExternalDNS is successfully deployed with CoreDNS back end using the procedure below.

To verify ExternalDNS with CoreDNS back end:

  1. Log in to any Kubernetes Master node.

  2. Start my-nginx:

    kubectl run my-nginx --image=nginx --port=80
    

    Example of system response:

    deployment "my-nginx" created
    
  3. Expose my-nginx:

    kubectl expose deployment my-nginx --port=80 --type=ClusterIP
    

    Example of system response:

    service "my-nginx" exposed
    
  4. Annotate my-nginx:

    kubectl annotate service my-nginx \
    "external-dns.alpha.kubernetes.io/hostname=nginx.<your_domain>.local."
    

    Example of system response:

    service "my-nginx" annotated
    
  5. Get the IP of DNS service:

    kubectl get svc coredns -n kube-system | awk '{print $2}' | tail -1
    

    Example of system response:

    10.254.203.8
    
  6. Select from the following options:

    • If your Kubernetes networking is Calico, run the following command from any Kubernetes Master node.

    • If your Kubernetes networking is OpenContrail, run the following command from any Kubernetes pod.

    nslookup nginx.<your_domain>.local. <coredns_ip>
    

    Example of system response:

    Server: 10.254.203.8 Address: 10.254.203.8#53
    Name: test.my_domain.local Address: 10.254.42.128