I'm trying to move my development environment to Kubernetes to be more in line with existing deployment stages. In that context I need to call a service by its Ingress DNS name internally, while this DNS name resolves to an IP unreachable from the cluster itself. I would like to create a DNS alias inside the cluster which would point to the service, basically a reversal of a ExternalName
service.
Example:
- The external DNS name is
my-service.my-domain.local
, resolving to 127.0.0.1 - Internal service is
my-service.my-namespace.svc.cluster.local
- A process running in a pod can't reach
my-service.my-domain.local
because of the resolved IP, but could reachmy-service.my-namespace.svc.cluster.local
, but needs to be accessing the former by name - I would like to have a cluster-internal DNS name
my-service.my-domain.local
, resolving to the servicemy-service.my-namespace.svc.cluster.local
(ExternalName
service would do the exact opposite).
Is there a way to implement this in Kubernetes?