-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Description
What would you like to be added:
Currently if you create FQDNs for K8S headless services, a service source will generate DNS record for the source. Also, in addition to that, if pods related to that service has a hostname configured, then FQDNs for each pod will also be created.
I.e. if you have service service-1 resulting into FQDN service-1.some.domain there will also be FQDNs like pod-1.service-1.some.domain be generated.
Currently, you will see such behavior only if you have headless service with pods where .Spec.Hostname is non-empty.
What we need is to be able to configure this behavior. We want a flag where you can explicitly enable or disable per pod FQDNs for headless services. And if you omit this flag, the default behavior is the same like today (based on .Spec.Hostname).
Why is this needed:
Some time we do not control .Spec.Hostname if we don't create static pods. I.e. if pods are created by Deployment it always keeps that field empty. Thus, you can't generate FQDNs for such pods. Also you can't avoid generating such FQDNs for pods created by StatefulSets because StatefulSet always sets some value to .Spec.Hostname.