Documentation ¶
Overview ¶
Package siderolink provides server-side implementation of the SideroLink API.
Index ¶
Constants ¶
const EventsSinkPort = 4002
EventsSinkPort is the port of the events sink container.
EventsSinkPort is working only over wireguard.
const LogReceiverPort = 4001
LogReceiverPort is the port of the log receiver container.
LogReceiverPort is working only over Wireguard.
const SecretName = "siderolink"
SecretName is the name of the Secret Sidero stores information about siderolink installation.
Secret holds private Sidero Wireguard key and installation ID.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Annotation ¶
type Annotation struct { ServerUUID string Namespace string MetalMachineName string MachineName string ClusterName string }
Annotation describes the source server by SideroLink IP address.
type Annotator ¶
type Annotator struct {
// contains filtered or unexported fields
}
Annotator keeps a cache of annotations per SideroLink IP address.
func NewAnnotator ¶
func NewAnnotator(metalClient runtimeclient.Client, kubeconfig *rest.Config, logger *zap.Logger) *Annotator
NewAnnotator initializes new server.
type Config ¶
type Config struct { InstallationID string PrivateKey wgtypes.Key PublicKey wgtypes.Key WireguardEndpoint string Subnet netip.Prefix ServerAddress netip.Prefix }
Config is the internal SideroLink configuration.
var Cfg Config
Cfg is a default global instance of the SideroLink configuration.
Cfg should be initialized first with `LoadOrCreate`.
func (*Config) LoadOrCreate ¶
type PeerState ¶
type PeerState struct {
// contains filtered or unexported fields
}
PeerState syncs data from Kubernetes ServerBinding as peer state.
func NewPeerState ¶
NewPeerState initializes PeerState.
type Server ¶
type Server struct { pb.UnimplementedProvisionServiceServer // contains filtered or unexported fields }
Server implements gRPC API.
func NewServer ¶
func NewServer(cfg *Config, metalClient runtimeclient.Client) *Server
NewServer initializes new server.
func (*Server) Provision ¶
func (srv *Server) Provision(ctx context.Context, req *pb.ProvisionRequest) (*pb.ProvisionResponse, error)
Provision the SideroLink for the server by UUID.