Documentation
¶
Index ¶
- Constants
- type ClusterInterface
- type Config
- type Fish
- func (f *Fish) CleanupDB(ctx context.Context)
- func (f *Fish) Close(ctx context.Context)
- func (f *Fish) DB() *database.Database
- func (f *Fish) GetCfg() Config
- func (f *Fish) GetMonitor() *monitoring.Monitor
- func (f *Fish) Init() error
- func (f *Fish) MaintenanceSet(value bool)
- func (f *Fish) SetMonitor(monitor *monitoring.Monitor)
- func (f *Fish) ShutdownDelaySet(delay time.Duration)
- func (f *Fish) ShutdownSet(value bool)
- func (f *Fish) StorageVotesAdd(votes []typesv2.Vote)
- func (f *Fish) VoteActiveList() (votes []typesv2.Vote)
- type MonitoringConfig
Constants ¶
const DefaultDBCleanupInterval = 10 * time.Minute
const DefaultDBCompactInterval = time.Hour
const ElectionRoundTime = 30
ElectionRoundTime defines how long the voting round will take in seconds - so cluster nodes will be able to interchange their responses
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClusterInterface ¶ added in v0.8.0
type ClusterInterface interface {
// Requesting send of Vote to cluster, since it's not a part of DB
SendVote(vote *typesv2.Vote) error
}
ClusterInterface defines required functions for Fish to run on the cluster
type Config ¶
type Config struct {
Directory string `json:"directory"` // Where to store database and other useful data (if relative - to CWD)
APIAddress string `json:"api_address"` // Where to serve Web UI, API & Meta API
NodeAddress string `json:"node_address"` // What is the external address of the node
CPULimit uint16 `json:"cpu_limit"` // How many CPU threads Node allowed to use (serve API, ...)
MemTarget util.HumanSize `json:"mem_target"` // What's the target memory utilization by the Node (GC target where it becomes more aggressive)
ClusterJoin []string `json:"cluster_join"` // The node addresses to join the cluster
TLSKey string `json:"tls_key"` // TLS PEM private key (if relative - to directory)
TLSCrt string `json:"tls_crt"` // TLS PEM public certificate (if relative - to directory)
TLSCaCrt string `json:"tls_ca_crt"` // TLS PEM certificate authority certificate (if relative - to directory)
NodeName string `json:"node_name"` // Last resort in case you need to override the default host node name
NodeLocation string `json:"node_location"` // Specify cluster node location for multi-dc configurations
NodeIdentifiers []string `json:"node_identifiers"` // The list of node identifiers which could be used to find the right Node for Resource
NodeSlotsLimit uint `json:"node_slots_limit"` // Limits the amount of Applications to be executed simultaneously on the node
DefaultResourceLifetime util.Duration `json:"default_resource_lifetime"` // Sets the lifetime of the resource which will be used if label definition one is not set
AllocationRetry uint `json:"allocation_retry"` // How many times to retry the allocation in case error happened, default: 3
ElectedRoundsToWait uint8 `json:"elected_rounds_to_wait"` // Preventive measure for Node failure on ELECTED state, recovers election after this amount of rounds, default: 10
DBCleanupInterval util.Duration `json:"db_cleanup_interval"` // Defines the database item cleanup interval when Application reached the end of life (by error or deallocated)
DBCompactInterval util.Duration `json:"db_compact_interval"` // Defines the database compaction interval to get rid of old data on disk periodically
DisableAuth bool `json:"disable_auth"` // WARNING! For performance testing only
// Configuration for the node drivers, if defined - only the listed ones will be available.
// Each configuration could instantinate the same driver multiple times by adding instance name
// separated from driver by slash symbol (like "<driver>/prod" - will create "prod" instance).
Drivers drivers.ConfigDrivers `json:"drivers"`
// Monitoring configuration for OpenTelemetry observability
Monitoring MonitoringConfig `json:"monitoring"`
}
Config defines Fish node configuration
func (*Config) ReadConfigFile ¶
ReadConfigFile needed to read the config file
type Fish ¶
type Fish struct {
// Signal to stop the fish
Quit chan os.Signal
// contains filtered or unexported fields
}
Fish structure is used to store the node internal state
func (*Fish) CleanupDB ¶ added in v0.8.0
CleanupDB removing stale Applications and data from database to keep it slim
func (*Fish) GetMonitor ¶ added in v0.9.0
func (f *Fish) GetMonitor() *monitoring.Monitor
GetMonitor returns the monitoring instance for instrumentation
func (*Fish) MaintenanceSet ¶ added in v0.7.0
MaintenanceSet sets/unsets the maintenance mode which will not allow to accept the additional Applications
func (*Fish) SetMonitor ¶ added in v0.9.0
func (f *Fish) SetMonitor(monitor *monitoring.Monitor)
SetMonitor sets the monitoring instance for the Fish node
func (*Fish) ShutdownDelaySet ¶ added in v0.7.0
ShutdownDelaySet set of how much time to wait before executing the node shutdown operation
func (*Fish) ShutdownSet ¶ added in v0.7.0
ShutdownSet tells node it need to execute graceful shutdown operation
func (*Fish) StorageVotesAdd ¶ added in v0.8.0
StorageVotesAdd puts received votes from the cluster to the list
func (*Fish) VoteActiveList ¶ added in v0.8.0
VoteAll returns active and related storage votes
type MonitoringConfig ¶ added in v0.9.0
type MonitoringConfig = monitoring.Config
MonitoringConfig is an alias for monitoring.Config