InstancePodDNSNames returns the possible DNS names for instance. The first name is the fully qualified domain name (FQDN).
(ctx context.Context, instance *appsv1.StatefulSet)
| 18 | // InstancePodDNSNames returns the possible DNS names for instance. The first |
| 19 | // name is the fully qualified domain name (FQDN). |
| 20 | func InstancePodDNSNames(ctx context.Context, instance *appsv1.StatefulSet) []string { |
| 21 | var ( |
| 22 | domain = KubernetesClusterDomain(ctx) |
| 23 | namespace = instance.Namespace |
| 24 | name = instance.Name + "-0." + instance.Spec.ServiceName |
| 25 | ) |
| 26 | |
| 27 | // We configure our instances with a subdomain so that Pods get stable DNS |
| 28 | // names in the form "{pod}.{service}.{namespace}.svc.{cluster-domain}". |
| 29 | // - https://docs.k8s.io/concepts/services-networking/dns-pod-service/#pods |
| 30 | return []string{ |
| 31 | name + "." + namespace + ".svc." + domain, |
| 32 | name + "." + namespace + ".svc", |
| 33 | name + "." + namespace, |
| 34 | name, |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | // RepoHostPodDNSNames returns the possible DNS names for a pgBackRest repository host Pod. |
| 39 | // The first name is the fully qualified domain name (FQDN). |