ServiceDNSNames returns the possible DNS names for service. The first name is the fully qualified domain name (FQDN).
(ctx context.Context, service *corev1.Service)
| 58 | // ServiceDNSNames returns the possible DNS names for service. The first name |
| 59 | // is the fully qualified domain name (FQDN). |
| 60 | func ServiceDNSNames(ctx context.Context, service *corev1.Service) []string { |
| 61 | domain := KubernetesClusterDomain(ctx) |
| 62 | |
| 63 | return []string{ |
| 64 | service.Name + "." + service.Namespace + ".svc." + domain, |
| 65 | service.Name + "." + service.Namespace + ".svc", |
| 66 | service.Name + "." + service.Namespace, |
| 67 | service.Name, |
| 68 | } |
| 69 | } |
| 70 | |
| 71 | // KubernetesClusterDomain looks up the Kubernetes cluster domain name. |
| 72 | func KubernetesClusterDomain(ctx context.Context) string { |