server

package
v1.1.9 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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 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,
	admissionControlPolicy string,
	admissionControlPolicyLimitMaxConcurrentTxn int64,
	admissionControlOnlyWriteQueries bool,
) (*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 kine machinery.

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"`
	} `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"`

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

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

TuningConfiguration is configuration for tuning dqlite and kine 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