Documentation
¶
Index ¶
- Constants
- func SeedBuiltinNamespaces(ctx context.Context, st store.Store) error
- func SeedBuiltinPolicies(ctx context.Context, st store.Store) error
- type APIServer
- type AuthInfo
- type Option
- func WithAuth(_ []string) Option
- func WithDockerRunner(runner runner.Runner) Option
- func WithEventLog(eventLog events.EventLog) Option
- func WithExtraGRPCRegistrar(reg func(grpc.ServiceRegistrar)) Option
- func WithGRPCAddr(addr string) Option
- func WithHTTPAddr(addr string) Option
- func WithInitialMountResolver(resolver controllers.MountResolver) Option
- func WithLogger(logger log.Logger) Option
- func WithNetworkStatusProvider(p service.NetworkStatusProvider) Option
- func WithObserveStore(store observe.LogStore) Option
- func WithOrchestrator(orchestrator orchestrator.Orchestrator) Option
- func WithProcessRunner(runner runner.Runner) Option
- func WithSession(s SessionOptions) Option
- func WithStorageDefaultStorageClass(name *string) Option
- func WithStorageDriverConfigs(cfg map[string]map[string]any) Option
- func WithStoragePreserveOnDelete(preserve bool) Option
- func WithStorageSecretLookup(lookup driverparams.SecretLookup) Option
- func WithStore(store store.Store) Option
- func WithTLS(certFile, keyFile string) Option
- func WithUI(ui UIOptions) Option
- func WithVIPAllocator(a service.VIPAllocator) Option
- type Options
- type SessionOptions
- type UIOptions
Constants ¶
const ( // AuthorizationHeader is the header key for API key authentication. AuthorizationHeader = "authorization" // APIKeyPrefix is the prefix for API key values in the Authorization header. APIKeyPrefix = "Bearer " )
Variables ¶
This section is empty.
Functions ¶
func SeedBuiltinNamespaces ¶
SeedBuiltinNamespaces ensures the built-in namespaces exist (idempotent).
Types ¶
type APIServer ¶
type APIServer struct {
// contains filtered or unexported fields
}
APIServer represents the gRPC API server for Rune.
func (*APIServer) GetObserveService ¶
func (s *APIServer) GetObserveService() *service.ObserveService
GetObserveService returns the native observability service, or nil if the server has not started yet. Used by runed to wire the agent forwarder's in-process ingest path (single-node) to LogStore.Write. Returns nil when observability is disabled is the caller's responsibility to check via ObserveService.Enabled.
func (*APIServer) GetOrchestrator ¶
func (s *APIServer) GetOrchestrator() orchestrator.Orchestrator
GetOrchestrator returns the orchestrator instance. Used by runed to wire post-construction collaborators (e.g. RUNE-063 networking data plane endpoint publisher).
func (*APIServer) GetRunnerManager ¶
func (s *APIServer) GetRunnerManager() *manager.RunnerManager
GetRunnerManager returns the runner manager. Used by runed to wire post-construction collaborators that need to talk to the container runtime — notably DNS injection (RUNE-063): once the agent's embedded DNS subsystem is up, runed calls `runnerManager.SetDNSInjection([]string{"127.0.0.123"}, ...)` so every subsequently-created container is told to ask Rune's resolver for `<service>.<namespace>.rune` names.
type AuthInfo ¶
type AuthInfo struct {
SubjectID string
// SubjectType is "user" | "service"; carried so authorization errors can
// name the kind of identity that was denied (useful for debugging CI
// service-account tokens).
SubjectType string
}
AuthInfo holds minimal identity used by handlers for RBAC checks
type Option ¶
type Option func(*Options)
Option is a function that configures options.
func WithDockerRunner ¶
WithDockerRunner sets the Docker runner.
func WithEventLog ¶
WithEventLog wires the persisted resource event log (RUNE-126 Phase 2) so the orchestrator's controllers emit status-transition events that `rune describe` surfaces. Nil disables emission.
func WithExtraGRPCRegistrar ¶
func WithExtraGRPCRegistrar(reg func(grpc.ServiceRegistrar)) Option
WithExtraGRPCRegistrar appends a function that registers an additional gRPC service when the server starts. Callers (e.g. runed wiring up WatchService) use this to inject services without the API server package having to import them.
func WithInitialMountResolver ¶
func WithInitialMountResolver(resolver controllers.MountResolver) Option
WithInitialMountResolver pre-installs a MountResolver on the instance controller before the orchestrator's first reconcile. cmd/runed passes a never-ready stub so the production startup window between orchestrator start and agent.volumes registering the real resolver returns transient "not yet mounted" errors — rather than falling back to Volume.Handle as the bind source, which is a UUID for cloud drivers and a fast-path that's correct only for local-driver tests.
func WithNetworkStatusProvider ¶
func WithNetworkStatusProvider(p service.NetworkStatusProvider) Option
WithNetworkStatusProvider plugs the live VIP allocator into the AdminService.NetworkStatus RPC.
func WithObserveStore ¶
WithObserveStore wires the native observability (RuneSight) log store selected by the runefile [observability] block. When set, the ObserveService serves history queries and the agent forwarder's in-process ingest writes to it. Nil disables observability (the service still registers but reports enabled=false).
func WithOrchestrator ¶
func WithOrchestrator(orchestrator orchestrator.Orchestrator) Option
WithOrchestrator sets the orchestrator.
func WithProcessRunner ¶
WithProcessRunner sets the process runner.
func WithSession ¶
func WithSession(s SessionOptions) Option
WithSession sets RUNE-201 token-lifetime overrides.
func WithStorageDefaultStorageClass ¶
WithStorageDefaultStorageClass threads the runefile [storage].defaultStorageClass knob through to the orchestrator. Nil means "keep built-in default"; pointer-to-empty-string means "no cluster default — error on missing storageClassName".
func WithStorageDriverConfigs ¶
WithStorageDriverConfigs threads per-driver opaque configuration from the runefile through to the orchestrator that the API server constructs internally. No-op when the caller also supplies an already-built orchestrator via WithOrchestrator.
func WithStoragePreserveOnDelete ¶
WithStoragePreserveOnDelete threads the runefile [storage].preserveOnDelete knob through to the orchestrator.
func WithStorageSecretLookup ¶
func WithStorageSecretLookup(lookup driverparams.SecretLookup) Option
WithStorageSecretLookup threads a SecretLookup function through to the orchestrator's volume + snapshot controllers, where it resolves `secret:...` references inside StorageClass / Volume parameter maps before drivers see them. cmd/runed wires a store-backed implementation here; tests typically pass nil (literal token paths only). See RUNE-200 PR 3.
func WithUI ¶
WithUI configures the embedded dashboard HTTP layer (RUNE-200). When ui.Enabled is true the server starts an HTTP listener on Options.HTTPAddr serving the vanguard transcoder under /grpc, the dashboard under ui.Path, and the CLI handoff endpoint.
func WithVIPAllocator ¶
func WithVIPAllocator(a service.VIPAllocator) Option
WithVIPAllocator plugs the VIP allocator into ServiceService so CreateService assigns a stable VIP from the cluster pool.
type Options ¶
type Options struct {
// Server addresses
GRPCAddr string
HTTPAddr string
// TLS configuration
EnableTLS bool
TLSCertFile string
TLSKeyFile string
// Authentication (token-only)
EnableAuth bool
// Logging
Logger log.Logger
// State store
Store store.Store
// Runner manager
RunnerManager *manager.RunnerManager
// Orchestrator
Orchestrator orchestrator.Orchestrator
// ExtraGRPCRegistrars are invoked during gRPC server startup to
// register additional services beyond the built-in set. Used by
// runed to plug in WatchService (RUNE-028) without forcing the
// API server to depend on every networking-layer package.
ExtraGRPCRegistrars []func(grpc.ServiceRegistrar)
// NetworkStatusProvider, if set, is wired into AdminService so
// the NetworkStatus RPC can report ClusterNetwork CIDR + VIP
// allocations. Supplied by runed alongside the VIP allocator
// (RUNE-040).
NetworkStatusProvider service.NetworkStatusProvider
// VIPAllocator, if set, is plugged into ServiceService so each
// CreateService call assigns a stable VIP from the pool.
// Supplied by runed at startup.
VIPAllocator service.VIPAllocator
// StorageDriverConfigs is the per-driver opaque configuration
// map (driver name → key/value) passed to the orchestrator when
// the server constructs one itself (i.e. when WithOrchestrator
// was not used). Sourced from the runefile [storage.drivers]
// table by runed. Nil-safe — drivers fall back to their own
// defaults.
StorageDriverConfigs map[string]map[string]any
// StorageDefaultStorageClass mirrors the runefile [storage].
// defaultStorageClass knob. *string so empty-string ("no cluster
// default") is distinguishable from unset.
StorageDefaultStorageClass *string
// StorageSecretLookup resolves `secret:...` references inside
// StorageClass / Volume parameters before they reach the storage
// drivers. Wired by cmd/runed against the store-backed SecretRepo.
// See RUNE-200 PR 3 / pkg/storage/driverparams.
StorageSecretLookup driverparams.SecretLookup
// StoragePreserveOnDelete mirrors the runefile [storage].
// preserveOnDelete knob. When true the local driver treats
// ReclaimPolicy:delete as retain.
StoragePreserveOnDelete bool
// InitialMountResolver, if set, is installed on the instance
// controller before the orchestrator's first reconcile tick. Lets
// cmd/runed pre-seed a never-ready stub so the production window
// between orchestrator start and agent.volumes registering the
// real resolver returns transient "not yet mounted" errors instead
// of falling back to Volume.Handle.
InitialMountResolver controllers.MountResolver
// EventLog is the persisted resource event log (RUNE-126 Phase 2).
// When set, the orchestrator wires it into the instance and volume
// controllers so status transitions surface in `rune describe`.
// Nil disables emission.
EventLog events.EventLog
// ObserveStore is the native observability (RuneSight) log store
// selected by the runefile [observability] block. When set, the
// ObserveService serves history queries and the agent forwarder's
// in-process ingest path writes to it. Nil means observability is
// disabled — ObserveService still registers but reports enabled=false
// so `rune logs` falls back to the live ephemeral stream. Wired by
// cmd/runed via WithObserveStore.
ObserveStore observe.LogStore
// UI configures the embedded dashboard and the HTTP serving layer it
// rides on (RUNE-200). When UI.Enabled is false the HTTP server is not
// started at all. Zero value disables the UI; runed populates this from
// the runefile [ui] block via WithUI.
UI UIOptions
// Session tunes RUNE-201 refresh/access lifetimes. Zero fields fall back to
// the session package defaults.
Session SessionOptions
}
Options defines the options for the API server.
type SessionOptions ¶
type SessionOptions struct {
AccessTTL time.Duration // short-lived access token lifetime (default 15m)
RefreshTTL time.Duration // sliding refresh idle window (default 30d)
GraceWindow time.Duration // concurrent-refresh grace (default 30s)
}
SessionOptions configures RUNE-201 token lifetimes. Server-package mirror of the auth session_* config keys; runed maps one onto the other.
type UIOptions ¶
type UIOptions struct {
// Enabled starts the HTTP server (vanguard transcoder + /ui + handoff).
Enabled bool
// Path is the dashboard mount point (default "/ui").
Path string
// HandoffEnabled enables POST/GET /v1/ui/handoff/{code}.
HandoffEnabled bool
// HandoffTTL bounds a one-time handoff code's lifetime.
HandoffTTL time.Duration
// RequireTLS, when set with EnableTLS=false, binds the HTTP server to
// loopback only and logs a warning instead of exposing bearer-token
// traffic on the wire.
RequireTLS bool
}
UIOptions configures the embedded dashboard HTTP layer (RUNE-200). It is the server-package mirror of the runefile config.UI block; cmd/runed maps one onto the other so this package needn't import internal/config.