racer

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: Apache-2.0 Imports: 46 Imported by: 0

Documentation

Overview

Package racer composes the Racer controllers and replica observer. Constructors compose only; serving requires locally validated replicated state. Authority owns accepted state, server owns HTTPS serving, members owns workload discovery and builders, and wire owns protocol encoding.

Index

Constants

View Source
const ReplicationAudience = authority.ReplicationAudience

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, cfg Config) error

Run uses standard manager leader election. On leadership loss the process exits; Lease release-on-cancel stays disabled to avoid overlapping writers.

Types

type Application

type Application struct {
	Topology    *TopologyReconciler
	Keyring     *KeyringReconciler
	Server      *server.Server
	Lifecycle   *server.Lifecycle
	Replication *Replication
	// contains filtered or unexported fields
}

func Assemble

func Assemble(cfg Config, c client.Client, reader client.Reader) *Application

Assemble performs no Kubernetes calls, I/O, cryptography, or goroutine startup. c supplies indexed discovery (configured by SetupWithManager in production); reader must bypass the cache for authorization and durable-state validation.

func (*Application) Recover

func (a *Application) Recover(ctx context.Context, writer client.Writer) error

Recover runs the production startup guard before any manager runnable starts. The writer need not have a running cache; all reads use the authoritative reader supplied to Assemble. Constructors and recovery never grant serving authority.

func (*Application) SetupWithManager

func (a *Application) SetupWithManager(mgr ctrl.Manager) error

type Config

type Config struct {
	Cluster                   wire.ClusterID
	Namespace                 string
	ControlAddress            string
	MetricsAddress            string
	ProbeAddress              string
	TLSCertificateFile        string
	TLSPrivateKeyFile         string
	PeerPort                  uint16
	DataplaneServiceAccount   string
	DaemonSetName             string
	CredentialsSecretName     string
	VersionConfigMapName      string
	InstallationConfigMapName string
	Limits                    server.Limits
	Rotation                  authority.RotationPolicy
	CertificateLifetime       time.Duration
	PodName                   string
	PodUID                    string
	ControllerServiceAccount  string
	ReplicationTokenFile      string
	ReplicationTrustFile      string
	ReplicationServerName     string
	ReplicationPort           uint16
	SnapshotMaxAge            time.Duration
}

Config contains controller runtime settings, not operator workload inputs.

func ConfigFromLookup

func ConfigFromLookup(lookup func(string) (string, bool)) (Config, error)

ConfigFromLookup parses the controller configuration without process-global state.

func LoadConfig

func LoadConfig() (Config, error)

LoadConfig reads deployment configuration. Initialization state is deliberately not an environment setting: it is read authoritatively on every recovery.

func (Config) Validate

func (c Config) Validate() error

type KeyringReconciler

type KeyringReconciler struct {
	// contains filtered or unexported fields
}

func (*KeyringReconciler) Reconcile

func (r *KeyringReconciler) Reconcile(ctx context.Context, _ ctrl.Request) (ctrl.Result, error)

func (*KeyringReconciler) SetupWithManager

func (r *KeyringReconciler) SetupWithManager(mgr ctrl.Manager) error

type Replication

type Replication struct {
	Client    client.Client
	APIReader client.Reader
	// contains filtered or unexported fields
}

Replication observes durable authority on every replica. No request from a dataplane performs these reads. Only the elected publisher supplies image bytes.

func (*Replication) AuthenticateReplica

func (r *Replication) AuthenticateReplica(ctx context.Context, request *http.Request) (string, time.Time, error)

func (*Replication) LeaderContext

func (r *Replication) LeaderContext() (context.Context, bool)

LeaderContext snapshots publisher lifetime and leadership under the same lock.

func (*Replication) NeedLeaderElection

func (*Replication) NeedLeaderElection() bool

func (*Replication) PollInterval

func (r *Replication) PollInterval() time.Duration

func (*Replication) Start

func (r *Replication) Start(ctx context.Context) error

type TopologyReconciler

type TopologyReconciler struct {
	client.Client
	APIReader client.Reader
	// contains filtered or unexported fields
}

func (*TopologyReconciler) Reconcile

func (r *TopologyReconciler) Reconcile(ctx context.Context, request ctrl.Request) (ctrl.Result, error)

Reconcile builds from the synchronized cache, reads the version ConfigMap authoritatively, commits counters/hashes with CAS, then installs the result. Conflicts requeue from fresh inputs; missing established counters fail closed.

func (*TopologyReconciler) SetupWithManager

func (r *TopologyReconciler) SetupWithManager(mgr ctrl.Manager) error

Directories

Path Synopsis
Package members derives deterministic membership candidates from observed Kubernetes values.
Package members derives deterministic membership candidates from observed Kubernetes values.
Package server serves Racer HTTPS endpoints from locally validated authority.
Package server serves Racer HTTPS endpoints from locally validated authority.
Package testutil provides workload fixtures for controller tests.
Package testutil provides workload fixtures for controller tests.
Package wire declares Racer's HTTPS/JSON contracts.
Package wire declares Racer's HTTPS/JSON contracts.
Package workload builds dataplane workloads.
Package workload builds dataplane workloads.

Jump to

Keyboard shortcuts

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