Documentation
¶
Index ¶
- func BuildScheme() *runtime.Scheme
- func DefaultCacheDir() string
- func InterfaceForIP(ip net.IP) (string, error)
- func InterfaceIPv4(name string) (net.IP, error)
- func LeaderElectionID(site string) string
- func OutboundIP() (net.IP, error)
- func PrintConfig(key, value string)
- func PrintReady()
- func PrintService(protocol, address string)
- func PrintStep(msg string)
- func ResolveApiserverURL(ctx context.Context, clientset kubernetes.Interface) (string, error)deprecated
- func ServePXECmd() *cobra.Command
- func SiteSelector(site string) (labels.Selector, error)
- type ClusterInfo
- type ClusterInfoWatcher
- type StatusUpdater
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildScheme ¶
func DefaultCacheDir ¶
func DefaultCacheDir() string
func InterfaceForIP ¶
InterfaceForIP returns the name of the network interface that holds the given IP address.
func LeaderElectionID ¶
func OutboundIP ¶
func PrintConfig ¶
func PrintConfig(key, value string)
func PrintReady ¶
func PrintReady()
func PrintService ¶
func PrintService(protocol, address string)
func ResolveApiserverURL
deprecated
ResolveApiserverURL reads the standard cluster-info ConfigMap from the kube-public namespace and returns the Kubernetes API server URL contained in the embedded kubeconfig. Every conformant cluster publishes this ConfigMap, making it the canonical way to discover the external API server endpoint.
Deprecated: Use ResolveClusterInfo instead, which also returns the CA certificate from the same kubeconfig.
func ServePXECmd ¶
ServePXECmd returns a cobra.Command that runs PXE servers and the BMC control loop.
Types ¶
type ClusterInfo ¶
type ClusterInfo struct {
// ApiserverURL is the external API server URL (e.g. "https://10.0.0.1:6443").
ApiserverURL string
// CACertPEM is the PEM-encoded cluster CA certificate.
CACertPEM []byte
}
ClusterInfo holds the API server URL and CA certificate discovered from the standard cluster-info ConfigMap in kube-public.
func ResolveClusterInfo ¶
func ResolveClusterInfo(ctx context.Context, clientset kubernetes.Interface) (*ClusterInfo, error)
ResolveClusterInfo reads the standard cluster-info ConfigMap from the kube-public namespace and returns both the API server URL and the CA certificate from the embedded kubeconfig. Every conformant cluster publishes this ConfigMap, making it the canonical way to discover the external API server endpoint and trust anchor.
type ClusterInfoWatcher ¶
type ClusterInfoWatcher struct {
// contains filtered or unexported fields
}
ClusterInfoWatcher watches the cluster-info ConfigMap in the kube-public namespace and provides up-to-date API server URL and CA certificate to the FileResolver through the ClusterInfoProvider interface.
It uses a shared informer so that changes at runtime (e.g. API server URL rotation) are picked up automatically.
func NewClusterInfoWatcher ¶
func NewClusterInfoWatcher( ctx context.Context, clientset kubernetes.Interface, log *slog.Logger, ) (*ClusterInfoWatcher, error)
NewClusterInfoWatcher creates a watcher that resolves the API server URL and CA certificate from the cluster-info ConfigMap in kube-public. It performs an initial synchronous resolve so that values are available before the first template render.
If the METALMAN_APISERVER_URL environment variable is set, its value overrides the API server URL from the ConfigMap on every refresh. The CA certificate is always read from the ConfigMap.
func (*ClusterInfoWatcher) ClusterInfo ¶
func (w *ClusterInfoWatcher) ClusterInfo() netboot.ClusterInfo
ClusterInfo returns the current cluster-info snapshot. Safe for concurrent use.