commands

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 27, 2026 License: MIT Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildScheme

func BuildScheme() *runtime.Scheme

func DefaultCacheDir

func DefaultCacheDir() string

func InterfaceForIP

func InterfaceForIP(ip net.IP) (string, error)

InterfaceForIP returns the name of the network interface that holds the given IP address.

func InterfaceIPv4

func InterfaceIPv4(name string) (net.IP, error)

func LeaderElectionID

func LeaderElectionID(site string) string

func OutboundIP

func OutboundIP() (net.IP, error)

func PrintConfig

func PrintConfig(key, value string)

func PrintReady

func PrintReady()

func PrintService

func PrintService(protocol, address string)

func PrintStep

func PrintStep(msg string)

func ResolveApiserverURL deprecated

func ResolveApiserverURL(ctx context.Context, clientset kubernetes.Interface) (string, error)

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

func ServePXECmd() *cobra.Command

ServePXECmd returns a cobra.Command that runs PXE servers and the BMC control loop.

func SiteSelector

func SiteSelector(site string) (labels.Selector, error)

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.

func (*ClusterInfoWatcher) Start

func (w *ClusterInfoWatcher) Start(ctx context.Context) error

Start implements manager.Runnable. It sets up an informer for the cluster-info ConfigMap in kube-public and re-resolves the API server URL and CA certificate whenever that ConfigMap changes.

type StatusUpdater

type StatusUpdater struct {
	Client client.Client
}

StatusUpdater implements attestation.StatusUpdater using a controller-runtime client.

func (*StatusUpdater) Update

func (u *StatusUpdater) Update(ctx context.Context, node *v1alpha3.Machine) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL