server

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2025 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectionPoolConfig added in v1.4.1

type ConnectionPoolConfig struct {
	MaxIdle     int
	MaxOpen     int
	MaxLifetime time.Duration
	MaxIdleTime time.Duration
}

type FailureDomainConfiguration

type FailureDomainConfiguration uint64

FailureDomainConfiguration is the configuration format for failure-domain (just an integer)

type InitConfiguration

type InitConfiguration struct {
	// Address is the bind address to use for this node.
	Address string `yaml:"Address"`
	// Cluster is a list of "host:port" addresses of existing cluster nodes.
	Cluster []string `yaml:"Cluster"`
}

InitConfiguration is the configuration format for init.yaml

type Instance added in v1.1.10

type Instance interface {
	Start(context.Context) error
	MustStop() <-chan struct{}
	Shutdown(context.Context) error
}

type Server

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

Server is the main k8s-dqlite server.

func New

func New(
	dir string,
	listen string,
	enableTLS bool,
	diskMode bool,
	clientSessionCacheSize uint,
	minTLSVersion string,
	watchAvailableStorageInterval time.Duration,
	watchAvailableStorageMinBytes uint64,
	lowAvailableStorageAction string,
	connectionPoolConfig *ConnectionPoolConfig,
	watchQueryTimeout time.Duration,
	watchProgressNotifyInterval time.Duration,

) (*Server, error)

New creates a new instance of Server based on configuration.

func (*Server) MustStop

func (s *Server) MustStop() <-chan struct{}

MustStop returns a channel that can be used to check whether the server must stop.

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) error

Shutdown cleans up any resources and attempts to hand-over and shutdown the dqlite application.

func (*Server) Start

func (s *Server) Start(ctx context.Context) error

Start the dqlite node and the k8s-dqlite machinery.

type ServerConfig added in v1.4.1

type ServerConfig struct {
	ListenAddress string

	CompactInterval   time.Duration
	PollInterval      time.Duration
	WatchQueryTimeout time.Duration
	NotifyInterval    time.Duration

	TlsConfig k8s_dqlite_tls.Config
}

type TuningConfiguration

type TuningConfiguration struct {
	// Snapshot is tuning for the raft snapshot parameters.
	// If non-nil, it is set with app.WithSnapshotParams() when starting dqlite.
	Snapshot *struct {
		Threshold uint64 `yaml:"threshold"`
		Trailing  uint64 `yaml:"trailing"`
		Strategy  string `yaml:"strategy"`
	} `yaml:"snapshot"`

	// NetworkLatency is the average one-way network latency between dqlite nodes.
	// If non-nil, it is passed as app.WithNetworkLatency() when starting dqlite.
	NetworkLatency *time.Duration `yaml:"network-latency"`

	// K8sDqliteCompactInterval is the interval between k8s-dqlite database compaction operations.
	K8sDqliteCompactInterval *time.Duration `yaml:"kine-compact-interval"`

	// K8sDqlitePollInterval is the k8s-dqite poll interval.
	K8sDqlitePollInterval *time.Duration `yaml:"kine-poll-interval"`
}

TuningConfiguration is configuration for tuning dqlite and k8s-dqlite parameters

type UpdateConfiguration

type UpdateConfiguration struct {
	// Address is the new bind address to use for this node.
	Address string `yaml:"Address"`
}

UpdateConfiguration is the configuration format for update.yaml

Jump to

Keyboard shortcuts

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