operator

package
v0.1.21 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2026 License: MIT Imports: 40 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AnnotationClientWireGuardPublicKey = meta.AnnotationClientWireGuardPublicKey
	AnnotationServerWireGuardPublicKey = meta.AnnotationServerWireGuardPublicKey
	AnnotationRedfishCertPEM           = meta.AnnotationRedfishCertPEM
	AnnotationIdempotencyKeyHash       = meta.AnnotationIdempotencyKeyHash
	AnnotationRequestHash              = meta.AnnotationRequestHash
	AnnotationClaimedAt                = meta.AnnotationClaimedAt
	AnnotationControlPlaneKubeconfig   = meta.AnnotationControlPlaneKubeconfig
	AnnotationControlPlaneGuestServer  = meta.AnnotationControlPlaneGuestServer

	LabelAllocated         = meta.LabelAllocated
	LabelArchitecture      = meta.LabelArchitecture
	LabelResourceType      = meta.LabelResourceType
	LabelKubernetesVersion = meta.LabelKubernetesVersion

	ArchitectureAMD64 = meta.ArchitectureAMD64
	ArchitectureARM64 = meta.ArchitectureARM64

	ResourceTypeRunner       = meta.ResourceTypeRunner
	ResourceTypeControlPlane = meta.ResourceTypeControlPlane
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AllocRequest

type AllocRequest struct {
	IdempotencyKey     string `json:"idempotencyKey,omitempty"`
	ResourceType       string `json:"resourceType,omitempty"`
	KubernetesVersion  string `json:"kubernetesVersion,omitempty"`
	WireGuardPublicKey string `json:"wireGuardPublicKey,omitempty"`
	Architecture       string `json:"architecture,omitempty"`
}

type AllocResponse

type AllocResponse struct {
	ResourceType string               `json:"resourceType"`
	Pod          PodResponse          `json:"pod"`
	Endpoint     EndpointResponse     `json:"endpoint"`
	WireGuard    WireGuardResponse    `json:"wireGuard"`
	VXLAN        VXLANResponse        `json:"vxlan"`
	Network      NetworkResponse      `json:"network"`
	Redfish      map[string]string    `json:"redfish"`
	ControlPlane ControlPlaneResponse `json:"controlPlane,omitempty"`
}

type Config

type Config struct {
	ListenAddr                         string
	Namespace                          string
	ServiceName                        string
	TLSSecretName                      string
	RunnerNamespace                    string
	RunnerLabelSelector                string
	RunnerImage                        string
	RunnerImagePullPolicy              string
	RunnerServiceAccountName           string
	RunnerAMD64Count                   int
	RunnerARM64Count                   int
	RunnerWireGuardHostPortStart       int32
	RunnerWireGuardHostPortEnd         int32
	RunnerRequireKVM                   bool
	RunnerControlPlaneToleration       bool
	ControlPlaneCount                  int
	ControlPlaneVersions               []string
	ControlPlaneImage                  string
	ControlPlaneServiceAccountName     string
	ControlPlaneAPIServerHostPortStart int32
	ControlPlaneAPIServerHostPortEnd   int32
	PlaypenTTL                         time.Duration
	ReconcileInterval                  time.Duration
	Runner                             runner.Config
}

func DefaultConfig

func DefaultConfig() Config

type ControlPlaneResponse

type ControlPlaneResponse struct {
	KubernetesVersion string `json:"kubernetesVersion"`
	Kubeconfig        string `json:"kubeconfig"`
	APIServerURL      string `json:"apiServerURL"`
	GuestAPIServerURL string `json:"guestAPIServerURL"`
}

type DeallocRequest

type DeallocRequest struct {
	IdempotencyKey string `json:"idempotencyKey,omitempty"`
}

type EndpointResponse

type EndpointResponse struct {
	Host                  string `json:"host"`
	WireGuardUDPPort      int32  `json:"wireGuardUDPPort"`
	APIServerTCPPort      int32  `json:"apiServerTCPPort,omitempty"`
	ExternalTrafficPolicy string `json:"externalTrafficPolicy"`
}

type NetworkResponse

type NetworkResponse struct {
	GuestMAC    string   `json:"guestMAC"`
	GuestIPv4   string   `json:"guestIPv4"`
	SubnetMask  string   `json:"subnetMask"`
	GatewayIPv4 string   `json:"gatewayIPv4"`
	DNS         []string `json:"dns"`
}

type Operator

type Operator struct {
	Client       client.Client
	KubeClient   kubernetes.Interface
	APIRegClient apiregclient.Interface
	Config       Config
	Scheme       *runtime.Scheme
	// contains filtered or unexported fields
}

func (*Operator) Alloc

func (o *Operator) Alloc(ctx context.Context, idempotencyKey string, req AllocRequest) (AllocResponse, int, error)

func (*Operator) Dealloc

func (o *Operator) Dealloc(ctx context.Context, idempotencyKey string) (int, error)

func (*Operator) EnsureTLSSecret

func (o *Operator) EnsureTLSSecret(ctx context.Context) (tls.Certificate, error)

func (*Operator) Handler

func (o *Operator) Handler() http.Handler

func (*Operator) ReconcileRunners

func (o *Operator) ReconcileRunners(ctx context.Context) error

func (*Operator) Run

func (o *Operator) Run(ctx context.Context) error

type PodResponse

type PodResponse struct {
	Namespace         string `json:"namespace"`
	Name              string `json:"name"`
	NodeName          string `json:"nodeName"`
	NodePublicIP      string `json:"nodePublicIP"`
	ResourceType      string `json:"resourceType"`
	Architecture      string `json:"architecture"`
	KubernetesVersion string `json:"kubernetesVersion,omitempty"`
}

type VXLANResponse

type VXLANResponse struct {
	Interface     string `json:"interface"`
	VNI           int    `json:"vni"`
	UDPPort       int    `json:"udpPort"`
	ServerAddress string `json:"serverAddress"`
	ClientAddress string `json:"clientAddress"`
}

type WireGuardResponse

type WireGuardResponse struct {
	Interface       string `json:"interface"`
	ServerPublicKey string `json:"serverPublicKey"`
	ServerAddress   string `json:"serverAddress"`
	ClientAddress   string `json:"clientAddress"`
	ListenPort      int    `json:"listenPort"`
}

Jump to

Keyboard shortcuts

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