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.
Set the environment variable to the Management/Essential cluster by exporting the
kubeconfigfile in your terminal window or using the--kubeconfig=${CLUSTER_NAME}.confas explained in Provide Context for Commands with a kubeconfig File.Verify that the
external-dnsdeployment is present:
Replace <target_WORKSPACE_NAMESPACE>in the namespace-nflag with the target cluster’s workspace namespace.CODEkubectl get appdeployments.apps.kommander.d2iq.io -n <target_WORKSPACE_NAMESPACE> external-dnsThe output should look like this:
CODENAME APP AGE external-dns external-dns-<app_version> 36sThe 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.
Set the environment variable to the target cluster (where you enabled
external-dns) by exporting thekubeconfigfile in your terminal window or using the--kubeconfig=${CLUSTER_NAME}.confas explained in Provide Context for Commands with a kubeconfig File.Verify that the
external-dnsdeployment is ready:
Replace <target_WORKSPACE_NAMESPACE>in the namespace-nflag with the target cluster’s workspace namespace.CODEkubectl get deployments.apps -n <target_WORKSPACE_NAMESPACE> external-dnsThe deployment should display a ready state:
CODENAME READY UP-TO-DATE AVAILABLE AGE external-dns 1/1 1 1 42sThe CLI has deployed the application completely and successfully.
Examine the Cluster’s Ingress
Set the environment variable to the target cluster (where you enabled
external-dns) by exporting thekubeconfigfile in your terminal window or using the--kubeconfig=${CLUSTER_NAME}.confas explained in Provide Context for Commands with a kubeconfig File.Verify that the cluster’s ingress contains the correct hostname annotation:
Replace <target_WORKSPACE_NAMESPACE>in the namespace-nflag with the target cluster’s workspace namespace.CODEkubectl get services -n <target_WORKSPACE_NAMESPACE> kommander-traefik -o yamlThe output looks like this:
Ensure that the service object contains the external-dns.alpha.kubernetes.io/hostname: <mycluster.example.com>annotation.CODEapiVersion: 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-dnsservice 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.
Set the environment variable to the target cluster (where you enabled
external-dns) by exporting thekubeconfigfile in your terminal window or using the--kubeconfig=${CLUSTER_NAME}.confas explained in Provide Context for Commands with a kubeconfig File.Access and execute the required image:
CODEkubectl run -it --image=nicolaka/netshoot --rm test-dns -- /bin/bashUse the image to check your domain and see the record:
Replace <mycluster.example.com>with the domain you assigned to your target cluster.CODEnslookup <mycluster.example.com>The output should look like this:
CODEServer: 192.168.178.1 Address: 192.168.178.1#53 Non-authoritative answer: Name: <mycluster.example.com> Address: 134.568.789.12The
external-dnsservice 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.