1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//! DNS utilities for Kubernetes service discovery.
//!
//! This module provides functions for generating standard Kubernetes DNS names
//! for services, pods, and headless services.
/// Generate the fully qualified domain name for a Kubernetes service.
///
/// # Arguments
///
/// * `service` - The name of the service
/// * `namespace` - The namespace of the service
///
/// # Returns
///
/// The FQDN for the service in the format: `<service>.<namespace>.svc.cluster.local`
/// Generate the fully qualified domain name for a Kubernetes pod.
///
/// # Arguments
///
/// * `pod` - The name of the pod
/// * `namespace` - The namespace of the pod
///
/// # Returns
///
/// The FQDN for the pod in the format: `<pod>.<namespace>.pod.cluster.local`
/// Generate the wildcard DNS pattern for a headless service.
///
/// # Arguments
///
/// * `service` - The name of the headless service
/// * `namespace` - The namespace of the service
///
/// # Returns
///
/// The wildcard DNS pattern in the format: `*.<service>.<namespace>.svc.cluster.local`