Documentation
¶
Overview ¶
Package dns provides utilities for detecting Kubernetes DNS configuration.
Index ¶
Constants ¶
View Source
const ( // DefaultClusterDomain is the default Kubernetes cluster domain. DefaultClusterDomain = "cluster.local" // ResolvConfPath is the default path to resolv.conf. ResolvConfPath = "/etc/resolv.conf" )
Variables ¶
This section is empty.
Functions ¶
func DetectClusterDomain ¶
DetectClusterDomain attempts to detect the Kubernetes cluster domain from /etc/resolv.conf search domains.
It looks for a search domain matching the pattern "*.svc.<domain>" and extracts the cluster domain suffix.
Returns the detected domain and true if successful, or empty string and false if detection failed.
func DetectClusterDomainFromFile ¶
DetectClusterDomainFromFile reads resolv.conf from a given path and extracts the cluster domain from search domains. Exported for testing purposes.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.