Documentation
¶
Overview ¶
Package status reports agent status back to the hub.
Index ¶
Constants ¶
const ( // HeartbeatInterval is how often the agent sends heartbeats to the hub. HeartbeatInterval = 30 * time.Second )
const (
// PlacementLabel identifies local Deployments managed by a railgrid Placement.
PlacementLabel = edgesGroup + "/placement"
)
Variables ¶
This section is empty.
Functions ¶
func DarwinHostFacts ¶
DarwinHostFacts returns the runtime facts that identify a macOS worker. It intentionally returns no values on other platforms: a Linux container running the agent for a Kubernetes edge must not be inferred as the host OS of that edge.
func DialAndFetchSSHHostKey ¶
DialAndFetchSSHHostKey connects to the SSH server on the given local port and captures its public host key by performing a handshake with a capturing HostKeyCallback. The key is returned in authorized_keys format ("<type> <base64>"). An empty string is returned on any error.
This approach is correct for both production (real sshd on port 22) and e2e tests (embedded TestSSHServer with an in-memory random key), because it asks the actual server for its key rather than reading a file that may belong to a different sshd instance.
Types ¶
type EdgeReporter ¶
type EdgeReporter struct {
// contains filtered or unexported fields
}
EdgeReporter sends heartbeats for a connectable edge resource. It works for Kubernetes, LinuxServer, and service-only MacOSServer agents.
func NewEdgeReporter ¶
func NewEdgeReporter(edgeName string, gvr schema.GroupVersionResource, hubClient *railgridclient.Client, tunnelState <-chan bool, sshProxyPort int) *EdgeReporter
NewEdgeReporter creates a new EdgeReporter. tunnelState is the channel produced by tunnel.StartProxyTunnel; pass nil to skip tunnel-state tracking (tunnelConnected will always report false). sshProxyPort is the local SSH daemon port to probe for its host key (server mode only); pass 0 to skip SSH host key reporting.
func (*EdgeReporter) Run ¶
func (r *EdgeReporter) Run(ctx context.Context) error
Run starts the edge heartbeat reporter and blocks until ctx is cancelled.
func (*EdgeReporter) SetAllowedAddons ¶ added in v0.2.6
func (r *EdgeReporter) SetAllowedAddons(types []string)
SetAllowedAddons records the add-on types this edge will materialize. The value is copied, and an empty list is meaningful: it tells the hub (and any portal reading the edge) that this machine accepts no add-on, so a tenant is never offered one that would sit Blocked forever.
func (*EdgeReporter) SetHostFacts ¶
func (r *EdgeReporter) SetHostFacts(labels map[string]string)
SetHostFacts enables OS-aware status reporting without changing the legacy constructor used by existing callers. The values are copied so a caller can safely reuse its input map after setup.
type PlacementReporter ¶
type PlacementReporter struct {
// contains filtered or unexported fields
}
PlacementReporter watches local Deployments and reports their status back to the corresponding Placement resources in the tenant workspace.
func NewPlacementReporter ¶
func NewPlacementReporter( hubDynamic dynamic.Interface, informerFactory informers.SharedInformerFactory, ) *PlacementReporter
NewPlacementReporter creates a PlacementReporter. hubDynamic is scoped to the edge's tenant workspace; informerFactory watches the local cluster.