Documentation
¶
Overview ¶
Package etcd provides a component for managing an etcd server using containerd. The component uses host networking with non-default ports (12379 for client, 12380 for peer) to avoid conflicts with existing etcd installations.
Index ¶
- type EtcdComponent
- func (e *EtcdComponent) ClientEndpoint() string
- func (e *EtcdComponent) PeerEndpoint() string
- func (e *EtcdComponent) SetMetricsWriter(w *metrics.VictoriaMetricsWriter)
- func (e *EtcdComponent) Start(ctx context.Context, config EtcdConfig) error
- func (e *EtcdComponent) StartMaintenanceLoop(ctx context.Context)
- func (e *EtcdComponent) TLSEnabled() bool
- type EtcdConfig
- type TLSConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EtcdComponent ¶
type EtcdComponent struct {
*base.BaseComponent
// contains filtered or unexported fields
}
func NewEtcdComponent ¶
func NewEtcdComponent(log *slog.Logger, cc *containerd.Client, namespace, dataPath string) *EtcdComponent
func (*EtcdComponent) ClientEndpoint ¶
func (e *EtcdComponent) ClientEndpoint() string
func (*EtcdComponent) PeerEndpoint ¶
func (e *EtcdComponent) PeerEndpoint() string
func (*EtcdComponent) SetMetricsWriter ¶ added in v0.12.0
func (e *EtcdComponent) SetMetricsWriter(w *metrics.VictoriaMetricsWriter)
SetMetricsWriter configures the metrics sink for the maintenance loop's health gauges. Safe to call with nil or at any time (the maintenance loop reads it atomically each tick).
func (*EtcdComponent) Start ¶
func (e *EtcdComponent) Start(ctx context.Context, config EtcdConfig) error
func (*EtcdComponent) StartMaintenanceLoop ¶ added in v0.7.0
func (e *EtcdComponent) StartMaintenanceLoop(ctx context.Context)
StartMaintenanceLoop runs a background goroutine that periodically checks etcd database health and triggers defragmentation when the BoltDB file has grown significantly larger than its live data. Compaction (already configured as periodic/1h) marks old revisions as deleted, but BoltDB never releases pages without an explicit defrag.
func (*EtcdComponent) TLSEnabled ¶ added in v0.4.0
func (e *EtcdComponent) TLSEnabled() bool
TLSEnabled returns whether TLS is enabled for client connections.
type EtcdConfig ¶
type EtcdConfig struct {
Name string
DataDir string
ClientPort int
HTTPClientPort int
PeerPort int
InitialToken string
ClusterState string
TLS *TLSConfig // If set, enables mTLS for client connections
// QuotaBackendBytes, when > 0, sets --quota-backend-bytes explicitly. When 0 the
// value is auto-derived from system RAM (see computeTuning).
QuotaBackendBytes int64
}