Documentation
¶
Overview ¶
Package elastic reconciles Elasticsearch nodes and their Kibana, Logstash and APM component services. Ownership is established by recorded service IDs, retained-volume IDs, identities returned by the member's own import, a service-bound non-sensitive KARAKORAM_OWNER marker, or readable legacy agent token secrets. Sensitive variables are masked for tokens without sudo mode; masked values and service hostnames alone never establish ownership.
An unrecorded volume service may also be verified by a runtime whose marker or legacy secret proves ownership and whose data directory names that exact volume mount. Markers are backfilled only after every existing service of the member is verified. Expired import processes are reconciled against actual services: missing services are imported again, while existing services still require ownership evidence.
RuntimeSpec and the shared engine service builders describe deployments and imports using the backend's layout, without rendering platform manifests. Optional stack services are declared in an engine.ComponentSet, which supplies defaults, validation and topology information. Its stateless lifecycle helper preserves the import, deploy, readiness and scale stages; Elasticsearch keeps ownership checks, durable operation tracking and database safety decisions.
TCP and Kibana/APM HTTPS admission is persisted independently of runtime route receipts. Resume and runtime repair restore admitted access even outside maintenance windows; deferred policy changes still prevent generation acknowledgement until a window opens or its override is accepted. Legacy TCP digests seed admission only when the applied policy is recoverable; otherwise an unacknowledged legacy generation falls back to private access.
Agent connectivity means a successful status response, independently of child health. Node and pinned component observations retain paused/error diagnostics as Process conditions without losing native roles. Every live component must pass process, configuration and application readiness checks. Paused children keep the member unhealthy and the cluster nonReady; investigate the stop before manually sending SIGCONT to a verified process. Reconciliation never resumes or kills a child in response to these diagnostics.
A dataSource target remains unready until its durable initial snapshot restore completion marker is saved, independently of desired generation and process health. Failed or cancelled initial restores are terminal and never replayed implicitly. Native restore claim fences conflicting mutations; target deletion remains permitted. Snapshot submission waits for an explicit successful native shard result and persists that completion receipt before advancing. Accepted-only legacy receipts and interrupted submissions remain fail-closed without replay. Historical superseded creates without restore evidence remain nonReady and never enqueue a replacement restore. Their ordinary runtime, access, backup storage and exposure reconciliation continues without the old source dependency.
Data MCP uses native, scoped read-only and opt-in document-write identities. Their roles exclude restricted indices, but wildcard grants still match non-restricted dot indices: the native gateway must independently exclude all dot indices and prevent alias or wildcard expansion from reaching them. Agent rollouts freeze their target build. If the control-plane build changes, no new deployment is admitted or retried for that rollout. An already stopped component is started on its existing artifact; an accepted deployment consumes operator-corrected configuration at its existing engine version and waits for service readiness. Elasticsearch allocation and shard health recover before the rolling journal is retired and the operation fails. Recovery never reports the changed artifact as satisfying the old target.
SPDX-License-Identifier: Apache-2.0 Copyright 2026 The Karakoram Authors
SPDX-License-Identifier: Apache-2.0 Copyright 2026 The Karakoram Authors
SPDX-License-Identifier: Apache-2.0 Copyright 2026 The Karakoram Authors
Index ¶
- Constants
- func APMHostname(cluster string) string
- func ArtifactURL(component, version string) string
- func DefaultResources(component string) (domain.Resources, error)
- func ElasticsearchHeapMB(ramGB float64) int
- func FlattenSettings(settings map[string]any) (map[string]any, error)
- func IssueHTTP(ca *CA, node string, dnsNames []string, ips []net.IP) (certPEM, keyPEM []byte, err error)
- func IssueTransport(ca *CA, node string, ips []net.IP) (certPEM, keyPEM []byte, err error)
- func KibanaActiveMinimumRAM(version string) float64
- func KibanaHeapMB(ramGB float64) int
- func KibanaHostname(cluster string) string
- func LogstashHeapMB(ramGB float64) int
- func LogstashHostname(cluster string) string
- func MasterHostname(cluster string, index int) string
- func NeedsRenewal(certPEM []byte, before time.Duration, now time.Time) (bool, error)
- func NodeHostname(cluster string, index int) string
- func NodeRestartToken(version string, heapMB int, roles []string, ...) (string, error)
- func PrepareCommands(component, version, user string) []string
- func ProtectedRoleName(name string) bool
- func ProtectedUserName(name string) bool
- func RenderFileRealm(users map[string]string, roles map[string][]string, previousUsersFile string) (usersFile, usersRolesFile string, err error)
- func RenderFileRoles() (string, error)
- func RepositoryBasePath(storagePrefix, namespace, cluster, uid string) string
- func RepositoryName(storage string) string
- func RestartToken(parts ...string) string
- func RuntimeSpec(layout infra.Layout, in RuntimeInput) (infra.RuntimeSpec, error)
- func S3ClientName(namespace, storage string) string
- func S3ClientSettings(name, endpoint, region string) map[string]any
- func S3SecureSettings(name, accessKey, secret string) map[string]string
- func UpgradeAllowed(from, to string) (ok bool, requiresBackup bool)
- func ValidClusterName(name string) bool
- func ValidHostname(name string) bool
- func ValidateMinimumRAM(component string, ramGB float64) error
- func ValidateRoleName(name string) error
- func ValidateUserName(name string) error
- func VolumeHostname(node string) string
- type APIKey
- type APIKeyCreate
- type APIKeyCreated
- type Access
- type AccessRole
- type ApplicationPrivileges
- type CA
- type FieldSecurity
- type IndexPrivileges
- type Options
- type Provider
- func (*Provider) ApplyDefaults(s *domain.ClusterSpec)
- func (*Provider) Balancer(context.Context, *engine.Context) (domain.BalancerStatus, error)
- func (*Provider) CanCancelOperation(_ context.Context, op *domain.Operation) error
- func (*Provider) CanClaimOperation(c *domain.Cluster) (bool, error)
- func (p *Provider) CancelOperation(ctx context.Context, rc *engine.Context, op *domain.Operation) (engine.OpResult, error)
- func (p *Provider) Cleanup(ctx context.Context, rc *engine.Context, opts domain.DeleteOptions) (done bool, err error)
- func (p *Provider) Connection(ctx context.Context, rc *engine.Context) (domain.ConnectionDetails, error)
- func (p *Provider) CreateAPIKey(ctx context.Context, rc *engine.Context, req APIKeyCreate) (*APIKeyCreated, error)
- func (*Provider) CreateDatabaseRole(context.Context, *engine.Context, domain.DatabaseRole) error
- func (*Provider) CreateDatabaseUser(context.Context, *engine.Context, domain.DatabaseUser, string) (string, error)
- func (p *Provider) CreateUser(ctx context.Context, rc *engine.Context, u UserWrite) error
- func (p *Provider) DataAccessCredentials(ctx context.Context, rc *engine.Context, level engine.DataAccessLevel) (engine.DataAccessCredentials, error)
- func (*Provider) DataMcp(c *domain.Cluster) (engine.DataMcpBackend, error)
- func (*Provider) DeleteDatabaseRole(context.Context, *engine.Context, string, string) error
- func (*Provider) DeleteDatabaseUser(context.Context, *engine.Context, string, string) error
- func (p *Provider) DeleteRetainedBackup(ctx context.Context, storage domain.BackupStorage, b domain.Backup) error
- func (p *Provider) DeleteRole(ctx context.Context, rc *engine.Context, name string) error
- func (p *Provider) DeleteUser(ctx context.Context, rc *engine.Context, name string) error
- func (*Provider) Describe() domain.ProviderInfo
- func (*Provider) GetDatabaseRole(context.Context, *engine.Context, string, string) (*domain.DatabaseRole, error)
- func (*Provider) GetDatabaseUser(context.Context, *engine.Context, string, string) (*domain.DatabaseUser, error)
- func (p *Provider) GetRole(ctx context.Context, rc *engine.Context, name string) (*AccessRole, error)
- func (p *Provider) GetUser(ctx context.Context, rc *engine.Context, name string) (*User, error)
- func (*Provider) InitialDataSourceApplied(c *domain.Cluster) (bool, error)
- func (p *Provider) InvalidateAPIKey(ctx context.Context, rc *engine.Context, id string) error
- func (p *Provider) ListAPIKeys(ctx context.Context, rc *engine.Context) ([]APIKey, error)
- func (*Provider) ListDatabaseRoles(context.Context, *engine.Context) ([]domain.DatabaseRole, error)
- func (*Provider) ListDatabaseUsers(context.Context, *engine.Context) ([]domain.DatabaseUser, error)
- func (p *Provider) ListRoles(ctx context.Context, rc *engine.Context) ([]AccessRole, error)
- func (p *Provider) ListUsers(ctx context.Context, rc *engine.Context) ([]User, error)
- func (p *Provider) MemberConfig(ctx context.Context, rc *engine.Context, name string) (agentapi.MemberConfig, error)
- func (p *Provider) MemberLogs(ctx context.Context, rc *engine.Context, name, process string, lines int) ([]domain.MemberLogLine, error)
- func (*Provider) Metrics() []domain.MetricDescriptor
- func (*Provider) Name() string
- func (*Provider) PITRWindow(context.Context, *engine.Context) ([]domain.TimeWindow, error)
- func (p *Provider) Placement(ctx context.Context, rc *engine.Context) (domain.Placement, error)
- func (p *Provider) PutRole(ctx context.Context, rc *engine.Context, r AccessRole, create bool) error
- func (*Provider) RelayTargets(c *domain.Cluster) []string
- func (*Provider) RequiredCapabilities(spec domain.ClusterSpec) []string
- func (p *Provider) RunOperation(ctx context.Context, rc *engine.Context, op *domain.Operation) (result engine.OpResult, err error)
- func (*Provider) SetBalancer(context.Context, *engine.Context, bool) error
- func (p *Provider) Status(ctx context.Context, rc *engine.Context) (status domain.ClusterStatus, statusErr error)
- func (p *Provider) Sync(ctx context.Context, rc *engine.Context) (result engine.Result, err error)
- func (*Provider) SyncDuringOperation(op *domain.Operation) bool
- func (*Provider) SystemUsers(_ context.Context, rc *engine.Context) ([]domain.SystemUser, error)
- func (*Provider) UpdateDatabaseRole(context.Context, *engine.Context, domain.DatabaseRole) error
- func (*Provider) UpdateDatabaseUser(context.Context, *engine.Context, domain.DatabaseUser, string) error
- func (p *Provider) UpdateUser(ctx context.Context, rc *engine.Context, u UserWrite) error
- func (p *Provider) Validate(ctx context.Context, old, n *domain.Cluster) error
- func (p *Provider) ValidateMemberReplacement(c *domain.Cluster, name string) error
- func (*Provider) VolumeReferences(c *domain.Cluster) ([]engine.VolumeReference, error)
- type ProviderOptions
- type Role
- type RoleDescriptor
- type RuntimeInput
- type User
- type UserWrite
Constants ¶
const ( DataAccessReadRole = "karakoram_mcp_ro" DataAccessReadWriteRole = "karakoram_mcp_rw" )
const ( AdminUser = "karakoram" MonitorUser = "karakoram-monitor" MonitorRole = "karakoram_monitor" LogstashUser = "karakoram_logstash" LogstashWriterRole = "karakoram_logstash_writer" APMUser = "karakoram_apm" APMWriterRole = "karakoram_apm_writer" )
Provider-owned security identities.
Variables ¶
This section is empty.
Functions ¶
func APMHostname ¶
APMHostname names the shared APM Server service.
func ArtifactURL ¶
ArtifactURL returns the official Linux x86_64 archive URL. Invalid product or version text returns an empty URL and is never embedded in shell commands.
func DefaultResources ¶
DefaultResources returns defaults for spec component names (engine, master, kibana, logstash, apm). Unknown components return an error.
func ElasticsearchHeapMB ¶
ElasticsearchHeapMB computes an explicit equal minimum/maximum JVM heap from minimum RAM in GB (1024 MB). Dedicated masters use the same rule.
func FlattenSettings ¶
FlattenSettings converts nested JSON settings to dotted keys. It rejects ambiguous dotted/nested duplicates instead of depending on map iteration order. Empty maps remain values so managed namespaces cannot bypass validation.
func IssueHTTP ¶
func IssueHTTP(ca *CA, node string, dnsNames []string, ips []net.IP) (certPEM, keyPEM []byte, err error)
IssueHTTP issues a server-only HTTP identity covering service discovery, loopback probes and any explicitly supplied public DNS names/IP addresses.
func IssueTransport ¶
IssueTransport issues a node's mutually authenticated transport identity. Bare service hostnames are the Zerops discovery names, as for PSMDB; no undocumented DNS suffix is assumed. Loopback SANs support local probes.
func KibanaActiveMinimumRAM ¶ added in v0.2.0
KibanaActiveMinimumRAM returns the version-dependent active admission floor in GiB. Invalid versions return zero; provider catalog validation rejects them. Structural validation remains separate so persisted smaller specs can be read.
func KibanaHeapMB ¶
KibanaHeapMB computes Node.js' maximum old-space size, with a 512 MB minimum.
func KibanaHostname ¶
KibanaHostname names the shared Kibana service.
func LogstashHeapMB ¶
LogstashHeapMB computes an equal minimum/maximum JVM heap, minimum 384 MB.
func LogstashHostname ¶
LogstashHostname names the shared Logstash service.
func MasterHostname ¶
MasterHostname names a dedicated master using its monotonic member index.
func NeedsRenewal ¶
NeedsRenewal checks a leaf certificate using the shared renewal policy.
func NodeHostname ¶
NodeHostname names a combined or data node using its monotonic member index.
func NodeRestartToken ¶
func NodeRestartToken(version string, heapMB int, roles []string, providerSettings, userSettings map[string]any) (string, error)
NodeRestartToken computes the ES process restart identity from version, heap, the unordered role set and static provider/user settings. Maps are flattened then JSON-encoded (sorted keys), so nested/dotted spelling and insertion order do not affect the token. User settings override provider settings, after the caller has validated them. Seed hosts and initial master nodes are excluded: seed files hot-reload and bootstrap nodes must never trigger a restart when removed after formation. Certificates, file realm and secure settings are intentionally not inputs; their reloads are managed independently.
func PrepareCommands ¶ added in v0.2.0
PrepareCommands returns the verified installation command used by deployments of an Elastic component, or nil for invalid component or version text.
func ProtectedRoleName ¶
ProtectedRoleName identifies built-in and provider-owned roles.
func ProtectedUserName ¶
ProtectedUserName identifies built-in and provider-owned identities.
func RenderFileRealm ¶
func RenderFileRealm(users map[string]string, roles map[string][]string, previousUsersFile string) (usersFile, usersRolesFile string, err error)
RenderFileRealm renders users (name -> password) and roles (role -> usernames). previousUsersFile is the persisted prior rendering: matching bcrypt hashes are reused to prevent salted-hash churn. New hashes use $2a$ at cost 10, the format demonstrated by Elastic's file-realm documentation: https://www.elastic.co/docs/deploy-manage/users-roles/cluster-or-deployment-auth/file-based Internal/reserved identities are allowed here, but all names remain file-safe.
func RenderFileRoles ¶
RenderFileRoles renders roles.yml for the provider-owned monitoring role.
func RepositoryBasePath ¶
RepositoryBasePath scopes a snapshot repository to one cluster lifetime. Persisted bindings retain their historical empty-component normalization.
func RepositoryName ¶
RepositoryName returns the cluster-local repository name for a storage.
func RestartToken ¶
RestartToken hashes a canonical JSON array of ordered restart-relevant parts. JSON framing prevents ambiguous concatenations; callers canonicalize any structured parts first. The digest contains no raw configuration or secrets.
func RuntimeSpec ¶ added in v0.2.0
func RuntimeSpec(layout infra.Layout, in RuntimeInput) (infra.RuntimeSpec, error)
RuntimeSpec describes a member without depending on a backend manifest. Data and master nodes share the Elasticsearch product runtime.
func S3ClientName ¶
S3ClientName returns a stable, bounded node client name scoped by namespace and storage. JSON array framing avoids collisions between differently split names.
func S3ClientSettings ¶
S3ClientSettings builds static elasticsearch.yml client settings. endpoint must be the storage's full URL including scheme; the deprecated protocol setting is never emitted. These values require a rolling restart when changed.
func S3SecureSettings ¶
S3SecureSettings builds reloadable keystore credentials. Never log this map.
func UpgradeAllowed ¶
UpgradeAllowed accepts strictly newer releases of the same major, or the supported 8.19.x to 9.1+ bridge. Cross-major upgrades require a fresh backup. It describes compatibility, not membership in the offered version catalog.
func ValidClusterName ¶
ValidClusterName checks the cluster naming contract shared with Zerops.
func ValidHostname ¶
ValidHostname checks Zerops' lowercase alphanumeric service hostname limit.
func ValidateMinimumRAM ¶
ValidateMinimumRAM checks each spec component's minimum RAM requirement in GB.
func ValidateRoleName ¶
ValidateRoleName validates names for user-managed roles, excluding built-ins.
func ValidateUserName ¶
ValidateUserName validates names for user-managed native users, excluding reserved identities. Karakoram deliberately accepts a narrower ES-safe set.
func VolumeHostname ¶
VolumeHostname names the local storage service belonging to a node.
Types ¶
type APIKey ¶
type APIKey struct {
ID string `json:"id"`
Name string `json:"name"`
Creation int64 `json:"creation"`
Expiration int64 `json:"expiration,omitempty"`
Invalidated bool `json:"invalidated"`
Username string `json:"username"`
}
APIKey is the non-secret inventory of a Karakoram-created key.
type APIKeyCreate ¶
type APIKeyCreate struct {
Name string `json:"name"`
Expiration string `json:"expiration,omitempty"`
RoleDescriptors map[string]RoleDescriptor `json:"roleDescriptors"`
}
APIKeyCreate requests a key owned by the control-plane identity.
type APIKeyCreated ¶
type APIKeyCreated struct {
ID string `json:"id"`
Name string `json:"name"`
APIKey string `json:"apiKey"`
Encoded string `json:"encoded"`
Expiration int64 `json:"expiration,omitempty"`
}
APIKeyCreated contains a secret returned only when a key is created.
type Access ¶
type Access interface {
ListUsers(context.Context, *engine.Context) ([]User, error)
GetUser(context.Context, *engine.Context, string) (*User, error)
CreateUser(context.Context, *engine.Context, UserWrite) error
UpdateUser(context.Context, *engine.Context, UserWrite) error
DeleteUser(context.Context, *engine.Context, string) error
ListRoles(context.Context, *engine.Context) ([]AccessRole, error)
GetRole(context.Context, *engine.Context, string) (*AccessRole, error)
PutRole(context.Context, *engine.Context, AccessRole, bool) error
DeleteRole(context.Context, *engine.Context, string) error
ListAPIKeys(context.Context, *engine.Context) ([]APIKey, error)
CreateAPIKey(context.Context, *engine.Context, APIKeyCreate) (*APIKeyCreated, error)
InvalidateAPIKey(context.Context, *engine.Context, string) error
}
Access is Elasticsearch-specific native user, role and API-key management.
type AccessRole ¶
AccessRole is a named security role. Built-ins are readable but immutable.
type ApplicationPrivileges ¶
type ApplicationPrivileges struct {
Application string `json:"application" yaml:"application"`
Privileges []string `json:"privileges" yaml:"privileges"`
Resources []string `json:"resources" yaml:"resources"`
}
ApplicationPrivileges grants application-defined privileges.
type CA ¶
CA is the shared certificate authority type. Its signing key is secret.
type FieldSecurity ¶
type FieldSecurity struct {
Grant *[]string `json:"grant,omitempty" yaml:"grant,omitempty"`
Except *[]string `json:"except,omitempty" yaml:"except,omitempty"`
}
FieldSecurity distinguishes omitted field lists from explicit empty lists.
type IndexPrivileges ¶
type IndexPrivileges struct {
Names []string `json:"names" yaml:"names"`
Privileges []string `json:"privileges" yaml:"privileges"`
AllowRestrictedIndices bool `json:"allow_restricted_indices" yaml:"allow_restricted_indices"`
Query *string `json:"query,omitempty" yaml:"query,omitempty"`
FieldSecurity *FieldSecurity `json:"field_security,omitempty" yaml:"field_security,omitempty"`
}
IndexPrivileges grants privileges over a set of index patterns.
type Options ¶
type Options struct {
Kibana struct {
Public bool `json:"public"`
AllowAllAddresses bool `json:"allowAllAddresses,omitempty"`
Settings map[string]any `json:"settings,omitempty"`
} `json:"kibana"`
APM struct {
Public bool `json:"public"`
AllowAllAddresses bool `json:"allowAllAddresses,omitempty"`
APIKeys *bool `json:"apiKeys,omitempty"`
} `json:"apm"`
Logstash struct {
Pipelines []agentspec.Pipeline `json:"pipelines,omitempty"`
PersistentQueue bool `json:"persistentQueue"`
} `json:"logstash"`
Elasticsearch struct {
Settings map[string]any `json:"settings,omitempty"`
} `json:"elasticsearch"`
}
Options contains spec.engineOptions. Elasticsearch does not consume spec.engineConfig: the provider must reject non-empty engineConfig rather than silently ignore it. User settings belong in these typed options instead.
func ParseOptions ¶
ParseOptions decodes exactly one JSON object, rejects unknown fields, defaults APM API-key authentication to true, and validates user-controlled content.
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider reconciles Elasticsearch and its optional stack components.
func (*Provider) ApplyDefaults ¶
func (*Provider) ApplyDefaults(s *domain.ClusterSpec)
ApplyDefaults fills omitted spec values without enabling optional components.
func (*Provider) CanCancelOperation ¶ added in v0.4.0
func (*Provider) CanClaimOperation ¶ added in v0.2.0
func (*Provider) CancelOperation ¶ added in v0.4.0
func (*Provider) Cleanup ¶
func (p *Provider) Cleanup(ctx context.Context, rc *engine.Context, opts domain.DeleteOptions) (done bool, err error)
Cleanup retires all runtime writers and optional volumes before bounded, control-plane cleanup of exact owned repository prefixes.
func (*Provider) Connection ¶
func (p *Provider) Connection(ctx context.Context, rc *engine.Context) (domain.ConnectionDetails, error)
Connection returns credentials only through the protected data-plane endpoint.
func (*Provider) CreateAPIKey ¶
func (p *Provider) CreateAPIKey(ctx context.Context, rc *engine.Context, req APIKeyCreate) (*APIKeyCreated, error)
CreateAPIKey creates a managed key and returns its one-time secret.
func (*Provider) CreateDatabaseRole ¶
CreateDatabaseRole rejects MongoDB-shaped requests; use native Elasticsearch access.
func (*Provider) CreateDatabaseUser ¶
func (*Provider) CreateDatabaseUser(context.Context, *engine.Context, domain.DatabaseUser, string) (string, error)
CreateDatabaseUser rejects MongoDB-shaped requests; use native Elasticsearch access.
func (*Provider) CreateUser ¶
CreateUser creates a native realm user, rejecting an existing identity.
func (*Provider) DataAccessCredentials ¶ added in v0.3.0
func (p *Provider) DataAccessCredentials(ctx context.Context, rc *engine.Context, level engine.DataAccessLevel) (engine.DataAccessCredentials, error)
DataAccessCredentials returns private HTTPS endpoints and a scoped native identity.
func (*Provider) DataMcp ¶ added in v0.3.0
DataMcp selects the native gateway and validates Elasticsearch-only scope.
func (*Provider) DeleteDatabaseRole ¶
DeleteDatabaseRole rejects MongoDB-shaped requests; use native Elasticsearch access.
func (*Provider) DeleteDatabaseUser ¶
DeleteDatabaseUser rejects MongoDB-shaped requests; use native Elasticsearch access.
func (*Provider) DeleteRetainedBackup ¶
func (p *Provider) DeleteRetainedBackup(ctx context.Context, storage domain.BackupStorage, b domain.Backup) error
DeleteRetainedBackup removes a retired repository only when its last snapshot is the requested backup. Individual snapshots share blobs; without a running Elasticsearch writer, deleting per-snapshot objects can corrupt other backups. For a multi-snapshot repository, register it in another cluster and delete the snapshot through Elasticsearch instead. No writer may use a retired base path.
func (*Provider) DeleteRole ¶
DeleteRole removes a user-managed native role.
func (*Provider) DeleteUser ¶
DeleteUser removes an existing native realm user.
func (*Provider) Describe ¶
func (*Provider) Describe() domain.ProviderInfo
Describe returns the supported catalog and lifecycle capabilities.
func (*Provider) GetDatabaseRole ¶
func (*Provider) GetDatabaseRole(context.Context, *engine.Context, string, string) (*domain.DatabaseRole, error)
GetDatabaseRole rejects MongoDB-shaped requests; use native Elasticsearch access.
func (*Provider) GetDatabaseUser ¶
func (*Provider) GetDatabaseUser(context.Context, *engine.Context, string, string) (*domain.DatabaseUser, error)
GetDatabaseUser rejects MongoDB-shaped requests; use native Elasticsearch access.
func (*Provider) GetRole ¶
func (p *Provider) GetRole(ctx context.Context, rc *engine.Context, name string) (*AccessRole, error)
GetRole reads a user role or built-in role.
func (*Provider) InitialDataSourceApplied ¶ added in v0.2.0
InitialDataSourceApplied is generation-independent: process health and an applied spec generation are not evidence that the initial snapshot restored.
func (*Provider) InvalidateAPIKey ¶
InvalidateAPIKey revokes only a key created through Karakoram.
func (*Provider) ListAPIKeys ¶
ListAPIKeys lists only keys created through Karakoram, without their secrets.
func (*Provider) ListDatabaseRoles ¶
ListDatabaseRoles rejects MongoDB-shaped requests; use native Elasticsearch access.
func (*Provider) ListDatabaseUsers ¶
ListDatabaseUsers rejects MongoDB-shaped requests; use native Elasticsearch access.
func (*Provider) ListRoles ¶
ListRoles lists user roles and readable built-ins, hiding managed roles.
func (*Provider) MemberConfig ¶
func (p *Provider) MemberConfig(ctx context.Context, rc *engine.Context, name string) (agentapi.MemberConfig, error)
MemberConfig renders a member's currently activated secret-bearing payload.
func (*Provider) MemberLogs ¶
func (p *Provider) MemberLogs(ctx context.Context, rc *engine.Context, name, process string, lines int) ([]domain.MemberLogLine, error)
MemberLogs reads a bounded, allowlisted member process log.
func (*Provider) Metrics ¶
func (*Provider) Metrics() []domain.MetricDescriptor
Metrics maps the engine's exposition families to canonical monitoring series.
func (*Provider) PITRWindow ¶
PITRWindow is unsupported; Elasticsearch recovery uses snapshots.
func (*Provider) Placement ¶
Placement uses the same authoritative groups or agent evidence as status.
func (*Provider) PutRole ¶
func (p *Provider) PutRole(ctx context.Context, rc *engine.Context, r AccessRole, create bool) error
PutRole creates (create=true) or replaces an existing role (create=false).
func (*Provider) RelayTargets ¶
RelayTargets lists observed and planned member destinations.
func (*Provider) RequiredCapabilities ¶ added in v0.2.0
func (*Provider) RequiredCapabilities(spec domain.ClusterSpec) []string
RequiredCapabilities reports optional backend features needed by a validated spec.
func (*Provider) RunOperation ¶
func (p *Provider) RunOperation(ctx context.Context, rc *engine.Context, op *domain.Operation) (result engine.OpResult, err error)
RunOperation advances a durable provider operation.
func (*Provider) SetBalancer ¶
SetBalancer is unsupported; Elasticsearch manages shard allocation itself.
func (*Provider) Status ¶
func (p *Provider) Status(ctx context.Context, rc *engine.Context) (status domain.ClusterStatus, statusErr error)
Status combines Elasticsearch health, member agents and infrastructure placement.
func (*Provider) SyncDuringOperation ¶
SyncDuringOperation permits convergence only at operation-safe checkpoints.
func (*Provider) SystemUsers ¶
SystemUsers lists the managed identities that the rotate-system-user operation accepts, without credential material. The control-plane admin user is internal to the file realm and is not rotated through this list.
func (*Provider) UpdateDatabaseRole ¶
UpdateDatabaseRole rejects MongoDB-shaped requests; use native Elasticsearch access.
func (*Provider) UpdateDatabaseUser ¶
func (*Provider) UpdateDatabaseUser(context.Context, *engine.Context, domain.DatabaseUser, string) error
UpdateDatabaseUser rejects MongoDB-shaped requests; use native Elasticsearch access.
func (*Provider) UpdateUser ¶
UpdateUser replaces an existing native realm user.
func (*Provider) Validate ¶
Validate rejects unsupported configurations and unsafe simultaneous changes.
func (*Provider) ValidateMemberReplacement ¶ added in v0.4.0
ValidateMemberReplacement rejects components and singleton native clusters.
func (*Provider) VolumeReferences ¶ added in v0.4.1
VolumeReferences exposes persistent identities for backend sizing observation.
type ProviderOptions ¶
type ProviderOptions struct {
ControlPlaneURL, InternalCAPEM string
Store engine.ClusterStore
Logger *slog.Logger
}
ProviderOptions supplies control-plane endpoints and inventory lookups.
type Role ¶
type Role struct {
Cluster []string `json:"cluster" yaml:"cluster"`
Indices []IndexPrivileges `json:"indices" yaml:"indices"`
Applications []ApplicationPrivileges `json:"applications,omitempty" yaml:"applications,omitempty"`
}
Role is the provider's JSON/YAML security privilege definition.
func APMRoleDefinition ¶
func APMRoleDefinition() Role
APMRoleDefinition returns the managed event writer and configuration reader.
func DataAccessRoleDefinition ¶ added in v0.3.0
func DataAccessRoleDefinition(patterns []string, level engine.DataAccessLevel) Role
DataAccessRoleDefinition grants document access, never index or user management. Restricted-index exclusion is defense in depth: Elasticsearch's '*' also matches non-restricted dot indices. The native gateway must exclude every dot index independently, including when resolving wildcards and aliases.
func LogstashRoleDefinition ¶
func LogstashRoleDefinition() Role
LogstashRoleDefinition returns the managed Logstash writer privileges.
func MonitorRoleDefinition ¶
func MonitorRoleDefinition() Role
MonitorRoleDefinition returns fresh slices for the least-privilege monitor.
type RoleDescriptor ¶
type RoleDescriptor = Role
RoleDescriptor defines API-key permissions without a role name.
type RuntimeInput ¶ added in v0.2.0
type RuntimeInput struct {
Hostname string
Cluster string
Component string // agentspec component, not the spec component name.
Version string
Volume string // Empty for stateless stack components.
AgentURL string
InternalCAPEM string
}
RuntimeInput contains non-secret deployment inputs for one member. AgentURL is already resolved for its namespace; agent tokens are imported separately.
Source Files
¶
- access.go
- backup_cleanup.go
- cancel.go
- capabilities.go
- catalog.go
- cleanup.go
- components.go
- config.go
- dataaccess.go
- doc.go
- exposure.go
- kibana_resources.go
- metrics_catalog.go
- naming.go
- operations.go
- options.go
- pki.go
- provider.go
- relay.go
- repository.go
- restore.go
- rolling.go
- rotate.go
- runtime.go
- runtime_fence.go
- runtime_recovery.go
- scale.go
- scale_unplaced.go
- secrets.go
- security.go
- security_ensure.go
- settings.go
- sizing.go
- snapshot.go
- snapshot_retained.go
- state.go
- status.go
- sync.go
- volume_sizes.go
Directories
¶
| Path | Synopsis |
|---|---|
|
Package agentspec defines the Elasticsearch engine payload carried in agentapi.MemberConfig.EngineSpec.
|
Package agentspec defines the Elasticsearch engine payload carried in agentapi.MemberConfig.EngineSpec. |
|
Package esapi implements Elasticsearch administration over CA-pinned HTTPS.
|
Package esapi implements Elasticsearch administration over CA-pinned HTTPS. |