Documentation
¶
Index ¶
- Constants
- type LbdBuilderImageEnsurer
- type RegistrationServer
- func (s *RegistrationServer) CordonRunner(ctx context.Context, req *runner_v1alpha.RunnerRegistrationCordonRunner) error
- func (s *RegistrationServer) CreateInvite(ctx context.Context, req *runner_v1alpha.RunnerRegistrationCreateInvite) error
- func (s *RegistrationServer) DrainRunner(ctx context.Context, req *runner_v1alpha.RunnerRegistrationDrainRunner) error
- func (s *RegistrationServer) InstallDiskAccelerator(ctx context.Context, ...) error
- func (s *RegistrationServer) IssueSystemWorkloadToken(ctx context.Context, ...) error
- func (s *RegistrationServer) IssueWorkloadToken(ctx context.Context, req *runner_v1alpha.RunnerRegistrationIssueWorkloadToken) error
- func (s *RegistrationServer) Join(ctx context.Context, req *runner_v1alpha.RunnerRegistrationJoin) error
- func (s *RegistrationServer) ListInvites(ctx context.Context, req *runner_v1alpha.RunnerRegistrationListInvites) error
- func (s *RegistrationServer) ListRunners(ctx context.Context, req *runner_v1alpha.RunnerRegistrationListRunners) error
- func (s *RegistrationServer) Query(ctx context.Context, req *runner_v1alpha.RunnerRegistrationQuery) error
- func (s *RegistrationServer) QueryInfo(ctx context.Context, req *runner_v1alpha.RunnerRegistrationQueryInfo) error
- func (s *RegistrationServer) RefreshCertificate(ctx context.Context, req *runner_v1alpha.RunnerRegistrationRefreshCertificate) error
- func (s *RegistrationServer) RemoveRunner(ctx context.Context, req *runner_v1alpha.RunnerRegistrationRemoveRunner) error
- func (s *RegistrationServer) RevokeInvite(ctx context.Context, req *runner_v1alpha.RunnerRegistrationRevokeInvite) error
- func (s *RegistrationServer) SandboxCounts(ctx context.Context, req *runner_v1alpha.RunnerRegistrationSandboxCounts) error
- func (s *RegistrationServer) UncordonRunner(ctx context.Context, req *runner_v1alpha.RunnerRegistrationUncordonRunner) error
- func (s *RegistrationServer) ValidateQuery(ctx context.Context, req *runner_v1alpha.RunnerRegistrationValidateQuery) error
- func (s *RegistrationServer) WorkloadIssuerInfo(ctx context.Context, req *runner_v1alpha.RunnerRegistrationWorkloadIssuerInfo) error
- type RegistrationServerConfig
Constants ¶
const ( DefaultInviteExpiryHours = 1 MaxInviteExpiryHours = 168 // 7 days )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LbdBuilderImageEnsurer ¶ added in v0.17.0
type LbdBuilderImageEnsurer interface {
EnsureLbdBuilderImage(ctx context.Context) (string, error)
}
LbdBuilderImageEnsurer builds the lbd toolchain image into the cluster registry if it is not already there. servers/build.Builder implements it; this is an interface so the runner registration server does not depend on the whole build server to ask one question of it.
type RegistrationServer ¶
type RegistrationServer struct {
RegistrationServerConfig
}
func NewRegistrationServer ¶
func NewRegistrationServer(cfg RegistrationServerConfig) *RegistrationServer
func (*RegistrationServer) CordonRunner ¶ added in v0.11.0
func (s *RegistrationServer) CordonRunner(ctx context.Context, req *runner_v1alpha.RunnerRegistrationCordonRunner) error
CordonRunner marks a runner unschedulable without disrupting its running sandboxes. The scheduler stops placing new work on the node; existing sandboxes keep running.
func (*RegistrationServer) CreateInvite ¶
func (s *RegistrationServer) CreateInvite(ctx context.Context, req *runner_v1alpha.RunnerRegistrationCreateInvite) error
func (*RegistrationServer) DrainRunner ¶ added in v0.11.0
func (s *RegistrationServer) DrainRunner(ctx context.Context, req *runner_v1alpha.RunnerRegistrationDrainRunner) error
DrainRunner cordons a runner and evicts its sandboxes so app controllers reschedule them onto other ready nodes. It marks each scheduled sandbox STOPPED — the same action the sandbox pool takes during a crash cooldown — which makes the owning runner tear down its local container (via its node-scoped watch on the sandbox status) and lets the pool controllers recreate the capacity elsewhere. The sandbox entities themselves are left in place (STOPPED, not deleted), as are disk mounts, volumes, and leases (unlike RemoveRunner --force). It blocks until no live sandboxes remain on the node or the timeout elapses, then reports how many sandboxes were evicted.
func (*RegistrationServer) InstallDiskAccelerator ¶ added in v0.17.0
func (s *RegistrationServer) InstallDiskAccelerator(ctx context.Context, req *runner_v1alpha.RunnerRegistrationInstallDiskAccelerator) error
InstallDiskAccelerator builds and loads the lbd kernel module on a runner.
The work splits across two machines. The toolchain image is built once, here, because the coordinator is where BuildKit and the registry live. The module itself is built on the target node, because it has to be compiled against the kernel running there and loaded into it.
Failures come back in the result rather than as an RPC error, so an operator sees why the install did not happen.
func (*RegistrationServer) IssueSystemWorkloadToken ¶ added in v0.13.0
func (s *RegistrationServer) IssueSystemWorkloadToken(ctx context.Context, req *runner_v1alpha.RunnerRegistrationIssueSystemWorkloadToken) error
IssueSystemWorkloadToken mints a system workload identity token on behalf of a distributed runner, which does not hold the cluster signing key. The caller is an mTLS-authenticated runner, and the workload it may request is constrained by runnerSystemWorkloads.
func (*RegistrationServer) IssueWorkloadToken ¶ added in v0.10.0
func (s *RegistrationServer) IssueWorkloadToken(ctx context.Context, req *runner_v1alpha.RunnerRegistrationIssueWorkloadToken) error
IssueWorkloadToken mints a workload identity token for a sandbox on behalf of a distributed runner, which does not hold the cluster signing key. The caller is an mTLS-authenticated runner.
func (*RegistrationServer) Join ¶
func (s *RegistrationServer) Join(ctx context.Context, req *runner_v1alpha.RunnerRegistrationJoin) error
func (*RegistrationServer) ListInvites ¶
func (s *RegistrationServer) ListInvites(ctx context.Context, req *runner_v1alpha.RunnerRegistrationListInvites) error
func (*RegistrationServer) ListRunners ¶
func (s *RegistrationServer) ListRunners(ctx context.Context, req *runner_v1alpha.RunnerRegistrationListRunners) error
func (*RegistrationServer) Query ¶ added in v0.17.0
func (s *RegistrationServer) Query(ctx context.Context, req *runner_v1alpha.RunnerRegistrationQuery) error
func (*RegistrationServer) QueryInfo ¶ added in v0.17.0
func (s *RegistrationServer) QueryInfo(ctx context.Context, req *runner_v1alpha.RunnerRegistrationQueryInfo) error
func (*RegistrationServer) RefreshCertificate ¶ added in v0.10.0
func (s *RegistrationServer) RefreshCertificate(ctx context.Context, req *runner_v1alpha.RunnerRegistrationRefreshCertificate) error
RefreshCertificate re-issues the calling runner's server certificate with SANs derived from its current listen address. A runner needs this when its listen IP changes but its persisted certificate (e.g. on a disk that outlives the VM) still carries the old IP. The method is public at the RPC layer but authorizes the caller here: the presented client certificate must chain to the cluster CA and be a runner certificate, and the re-issued certificate keeps that certificate's CommonName so a runner can only refresh its own identity.
func (*RegistrationServer) RemoveRunner ¶ added in v0.7.0
func (s *RegistrationServer) RemoveRunner(ctx context.Context, req *runner_v1alpha.RunnerRegistrationRemoveRunner) error
func (*RegistrationServer) RevokeInvite ¶
func (s *RegistrationServer) RevokeInvite(ctx context.Context, req *runner_v1alpha.RunnerRegistrationRevokeInvite) error
func (*RegistrationServer) SandboxCounts ¶ added in v0.18.0
func (s *RegistrationServer) SandboxCounts(ctx context.Context, req *runner_v1alpha.RunnerRegistrationSandboxCounts) error
func (*RegistrationServer) UncordonRunner ¶ added in v0.11.0
func (s *RegistrationServer) UncordonRunner(ctx context.Context, req *runner_v1alpha.RunnerRegistrationUncordonRunner) error
UncordonRunner clears a runner's cordon, making it eligible for scheduling again.
func (*RegistrationServer) ValidateQuery ¶ added in v0.17.0
func (s *RegistrationServer) ValidateQuery(ctx context.Context, req *runner_v1alpha.RunnerRegistrationValidateQuery) error
func (*RegistrationServer) WorkloadIssuerInfo ¶ added in v0.10.0
func (s *RegistrationServer) WorkloadIssuerInfo(ctx context.Context, req *runner_v1alpha.RunnerRegistrationWorkloadIssuerInfo) error
WorkloadIssuerInfo reports the issuer and current coordinator internal address. Distributed runners read both at startup, including when identity is disabled.
type RegistrationServerConfig ¶ added in v0.7.0
type RegistrationServerConfig struct {
Log *slog.Logger
Authority *caauth.Authority
EAC *entityserver_v1alpha.EntityAccessClient
CoordinatorAddr string
CoordinatorInternalIP netip.Addr
EtcdEndpoints []string
EtcdPrefix string
EtcdClient *clientv3.Client
// Observability endpoints provided to runners at join time
VictoriametricsAddress string
VictorialogsAddress string
// WorkloadIssuer mints workload identity tokens. Distributed runners, which
// do not hold the cluster signing key, request tokens from the coordinator
// through this server. May be nil when no issuer is configured.
WorkloadIssuer *workloadidentity.Issuer
// LbdBuilder builds the lbd toolchain image into the cluster registry, so
// a node has something to pull before it compiles the kernel module. Nil
// on a cluster with no BuildKit, where accelerator mode is unavailable.
LbdBuilder LbdBuilderImageEnsurer
// RPC is how the coordinator reaches a specific runner. Installing the
// kernel module has to happen on the node itself, so unlike the rest of
// this server it is not enough to write an entity and wait.
RPC *rpc.State
}