Assign FQDN for Internal Services in a Private Kubernetes Cluster
Currently, there is no ready solution for this.
Only thing comes to my mind is to use MutatingAdmissionWebhook. It would need catch moment, when new Kubernetes service
was created and then modify ConfigMap
for CoreDNS
as it's described in CoreDNS documentation.
After that, you would need to reload CoreDNS
configuration to apply new configuration from ConfigMap
. To achieve that, you can use reload plugin
for CoreDNS
. More details about this plugin can be found here.
Instead of above you can consider using sidecarContainer
for CoreDNS
, which will send SIGUSR1
signal to CoreDNS
conatiner.Example of this method can be found in this Github thread.