Skip to main content
Skip table of contents

Verify your External DNS Configuration

This page contains commands to verify that the external-dns service is functioning correctly.

If the external-dns service is not working properly, these commands also provide aids to find the cause or identify the issue.

Verify the Deployment

Verify that the deployment was triggered.

  1. Set the environment variable to the Management/Essential cluster by exporting the kubeconfig file in your terminal window or using the --kubeconfig=${CLUSTER_NAME}.conf as explained in Provide Context for Commands with a kubeconfig File.

  2. Verify that the external-dns deployment is present:
    (info) Replace <target_WORKSPACE_NAMESPACE> in the namespace -n flag with the target cluster’s workspace namespace.

    CODE
    kubectl get appdeployments.apps.kommander.d2iq.io -n <target_WORKSPACE_NAMESPACE> external-dns

    The output should look like this:

    CODE
    NAME           APP                          AGE
    external-dns   external-dns-<app_version>   36s

    The CLI has triggered the deployment of the application. However, this does not mean that the application has been installed completely and successfully.

Verify that the deployment was successful.

  1. Set the environment variable to the target cluster (where you enabled external-dns) by exporting the kubeconfig file in your terminal window or using the --kubeconfig=${CLUSTER_NAME}.conf as explained in Provide Context for Commands with a kubeconfig File.

  2. Verify that the external-dns deployment is ready:
    (info) Replace <target_WORKSPACE_NAMESPACE> in the namespace -n flag with the target cluster’s workspace namespace.

    CODE
    kubectl get deployments.apps -n <target_WORKSPACE_NAMESPACE> external-dns

    The deployment should display a ready state:

    CODE
    NAME           READY   UP-TO-DATE   AVAILABLE   AGE
    external-dns   1/1     1            1           42s

    The CLI has deployed the application completely and successfully.

Examine the Cluster’s Ingress

  1. Set the environment variable to the target cluster (where you enabled external-dns) by exporting the kubeconfig file in your terminal window or using the --kubeconfig=${CLUSTER_NAME}.conf as explained in Provide Context for Commands with a kubeconfig File.

  2. Verify that the cluster’s ingress contains the correct hostname annotation:
    (info) Replace <target_WORKSPACE_NAMESPACE> in the namespace -n flag with the target cluster’s workspace namespace.

    CODE
    kubectl get services -n <target_WORKSPACE_NAMESPACE> kommander-traefik -o yaml

    The output looks like this:
    (info) Ensure that the service object contains the external-dns.alpha.kubernetes.io/hostname: <mycluster.example.com> annotation.

    CODE
    apiVersion: v1
    kind: Service
    metadata:
      annotations:
        meta.helm.sh/release-name: kommander-traefik
        meta.helm.sh/release-namespace: kommander
        external-dns.alpha.kubernetes.io/hostname: <mycluster.example.com>
      creationTimestamp: "2023-06-21T04:52:49Z"
      finalizers:
    [...]

    The external-dns service has been linked to the cluster correctly.

Verify the DNS Record

It can take a few minutes for the external-dns service to create a DNS record. The delay depends on your cloud provider.

Verify that the external-dns service has created a DNS record.

  1. Set the environment variable to the target cluster (where you enabled external-dns) by exporting the kubeconfig file in your terminal window or using the --kubeconfig=${CLUSTER_NAME}.conf as explained in Provide Context for Commands with a kubeconfig File.

  2. Access and execute the required image:

    CODE
    kubectl run -it --image=nicolaka/netshoot --rm test-dns -- /bin/bash
  3. Use the image to check your domain and see the record:
    (info) Replace <mycluster.example.com> with the domain you assigned to your target cluster.

    CODE
    nslookup <mycluster.example.com>

    The output should look like this:

    CODE
    Server:		192.168.178.1
    Address:	192.168.178.1#53
    
    Non-authoritative answer:
    Name:	<mycluster.example.com>
    Address: 134.568.789.12

    The external-dns service is working and the DNS provider recognizes the record created by the service. If the command displays an error, the configuration is failing on the end of the DNS provider.

Trobleshooting

If your deployment has not succeeded and the previous steps have not helped you identify the issue, you can also check the logs for the external-dns deployment:

  1. Set the environment variable to the target cluster (where you enabled external-dns) by exporting the kubeconfig file in your terminal window or using the --kubeconfig=${CLUSTER_NAME}.conf as explained in Provide Context for Commands with a kubeconfig File.

  2. Verify the external-dns logs:

    (info) Replace <target_WORKSPACE_NAMESPACE> in the namespace -n flag with the target cluster’s workspace namespace.

    CODE
    kubectl logs -n kommander deployment/external-dns

    The output displays the pod’s logs for the external-dns deployment. Here is an example:

    CODE
    ...
    time="2023-07-04T06:56:35Z" level=info msg="Instantiating new Kubernetes client"
    time="2023-07-04T06:56:35Z" level=info msg="Using inCluster-config based on serviceaccount-token"
    time="2023-07-04T06:56:35Z" level=info msg="Created Kubernetes client https://10.96.0.1:443"
    time="2023-07-04T06:56:35Z" level=error msg="records retrieval failed: failed to list hosted zones: 
    ...

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.