diff --git a/source/service.go b/source/service.go index a0fbc5d..e82e94d 100644 --- a/source/service.go +++ b/source/service.go @@ -92,8 +92,14 @@ func (s *ServiceSource) buildRecord(obj interface{}, action string) (resource.Re return advertiseObj, nil } - advertiseObj.Name = service.Name advertiseObj.Namespace = service.Namespace + + if hostname, ok := service.Annotations["external-mdns.blakecovarrubias.com/hostname"]; ok { + advertiseObj.Name = hostname + } else { + advertiseObj.Name = service.Name + } + advertiseObj.IPs = []string{} if service.Spec.Type == "ClusterIP" && s.publishInternal {