How to add custom Domain Name System records in Tanzu Kubernetes Grid clusters.
book
Article ID: 337404
calendar_today
Updated On:
Products
Tanzu Kubernetes Grid
Issue/Introduction
This article covers how to test out which DNS record which has not been injected in the external name server and how to reach some custom host from inside a pod.
Symptoms: You are not able to reach to the custom host from inside a pod in a cluster in Tanzu Kubernetes Grid (TKG).
Environment
VMware Tanzu Kubernetes Grid 1.x
Cause
You keep hitting custom hosts, from inside a pod in your cluster but the custom host is not reachable. As a result, if you need to reach some custom host from inside a pod, you are unable to.
Resolution
There is no resolution. However, there is a workaround available.
Workaround: To work around this issue, follow these steps:
1. You need to edit the ConfigMap of the coredns using the following command:
kubectl -n kube-system edit configmap/coredns
2. Add a section called hosts where you define the address you want to use for yourcustom.host in the example and point it to the IP address you need 1.2.3.4 in the example below.
For example, your ConfigMap should look like this: