config

package
v6.8.0 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConfigSchema = config.Schema{

	"acme.ca_url": {},

	"acme.domain": {},

	"acme.email": {},

	"acme.agree_tos": {Type: config.Bool, Default: "false"},

	"authorization.scriptlet": {Validator: validate.Optional(scriptletLoad.AuthorizationValidate)},

	"backups.compression_algorithm": {Default: "gzip", Validator: validate.IsCompressionAlgorithm},

	"cluster.offline_threshold": {Type: config.Int64, Default: offlineThresholdDefault(), Validator: offlineThresholdValidator},

	"cluster.images_minimal_replica": {Type: config.Int64, Default: "3", Validator: imageMinimalReplicaValidator},

	"cluster.healing_threshold": {Type: config.Int64, Default: "0"},

	"cluster.join_token_expiry": {Type: config.String, Default: "3H", Validator: expiryValidator},

	"cluster.max_voters": {Type: config.Int64, Default: "3", Validator: maxVotersValidator},

	"cluster.max_standby": {Type: config.Int64, Default: "2", Validator: maxStandByValidator},

	"cluster.rebalance.batch": {Type: config.Int64, Default: "1"},

	"cluster.rebalance.cooldown": {Type: config.String, Default: "6H", Validator: validate.Optional(expiryValidator)},

	"cluster.rebalance.interval": {Type: config.Int64, Default: "0"},

	"cluster.rebalance.threshold": {Type: config.Int64, Default: "20", Validator: validate.Optional(rebalanceThresholdValidator)},

	"core.metrics_authentication": {Type: config.Bool, Default: "true"},

	"core.bgp_asn": {Type: config.Int64, Default: "0", Validator: validate.Optional(validate.IsInRange(0, 4294967294))},

	"core.https_allowed_headers": {},

	"core.https_allowed_methods": {},

	"core.https_allowed_origin": {},

	"core.https_allowed_credentials": {Type: config.Bool, Default: "false"},

	"core.https_trusted_proxy": {},

	"core.proxy_http": {},

	"core.proxy_https": {},

	"core.proxy_ignore_hosts": {},

	"core.remote_token_expiry": {Type: config.String, Validator: validate.Optional(expiryValidator)},

	"core.shutdown_timeout": {Type: config.Int64, Default: "5"},

	"core.trust_ca_certificates": {Type: config.Bool, Default: "false"},

	"images.auto_update_cached": {Type: config.Bool, Default: "true"},

	"images.auto_update_interval": {Type: config.Int64, Default: "6"},

	"images.compression_algorithm": {Default: "gzip", Validator: validate.IsCompressionAlgorithm},

	"images.default_architecture": {Validator: validate.Optional(validate.IsArchitecture)},

	"images.remote_cache_expiry": {Type: config.Int64, Default: "10"},

	"instances.lxcfs.per_instance": {Type: config.Bool, Validator: validate.Optional(validate.IsBool)},

	"instances.nic.host_name": {Validator: validate.Optional(validate.IsOneOf("random", "mac"))},

	"instances.placement.scriptlet": {Validator: validate.Optional(scriptletLoad.InstancePlacementValidate)},

	"loki.auth.username": {},

	"loki.auth.password": {},

	"loki.api.ca_cert": {},

	"loki.api.url": {},

	"loki.instance": {},

	"loki.labels": {},

	"loki.loglevel": {Validator: logLevelValidator, Default: logrus.InfoLevel.String()},

	"loki.types": {Validator: validate.Optional(validate.IsListOf(validate.IsOneOf("lifecycle", "logging", "network-acl"))), Default: "lifecycle,logging"},

	"openfga.api.token": {},

	"openfga.api.url": {},

	"openfga.store.id": {},

	"oidc.client.id": {},

	"oidc.issuer": {},

	"oidc.scopes": {Default: "openid, offline_access"},

	"oidc.audience": {},

	"oidc.claim": {},

	"network.ovn.integration_bridge": {Default: "br-int"},

	"network.ovn.northbound_connection": {Default: "unix:/run/ovn/ovnnb_db.sock"},

	"network.ovn.ca_cert": {Default: ""},

	"network.ovn.client_cert": {Default: ""},

	"network.ovn.client_key": {Default: ""},
}

ConfigSchema defines available server configuration keys.

Functions

This section is empty.

Types

type Config

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

Config holds cluster-wide configuration values.

func Load

func Load(ctx context.Context, tx *db.ClusterTx) (*Config, error)

Load loads a new Config object with the current cluster configuration values fetched from the database.

func (*Config) ACME

func (c *Config) ACME() (string, string, string, bool)

ACME returns all ACME settings needed for certificate renewal.

func (*Config) AuthorizationScriptlet added in v6.8.0

func (c *Config) AuthorizationScriptlet() string

AuthorizationScriptlet returns the authorization scriptlet source code.

func (*Config) BGPASN

func (c *Config) BGPASN() int64

BGPASN returns the BGP ASN setting.

func (*Config) BackupsCompressionAlgorithm

func (c *Config) BackupsCompressionAlgorithm() string

BackupsCompressionAlgorithm returns the compression algorithm to use for backups.

func (*Config) ClusterHealingThreshold

func (c *Config) ClusterHealingThreshold() time.Duration

ClusterHealingThreshold returns the configured healing threshold, i.e. the number of seconds after which an offline node will be evacuated automatically. If the config key is set but its value is lower than cluster.offline_threshold it returns the value of cluster.offline_threshold instead. If this feature is disabled, it returns 0.

func (*Config) ClusterJoinTokenExpiry

func (c *Config) ClusterJoinTokenExpiry() string

ClusterJoinTokenExpiry returns the cluster join token expiry.

func (*Config) ClusterRebalanceBatch added in v6.7.0

func (c *Config) ClusterRebalanceBatch() int64

ClusterRebalanceBatch returns maximum number of instances to move during one re-balancing run.

func (*Config) ClusterRebalanceCooldown added in v6.7.0

func (c *Config) ClusterRebalanceCooldown() string

ClusterRebalanceCooldown returns amount of time during which an instance will not be moved again.

func (*Config) ClusterRebalanceInterval added in v6.7.0

func (c *Config) ClusterRebalanceInterval() int64

ClusterRebalanceInterval returns the interval at which to evaluate re-balanicng.

func (*Config) ClusterRebalanceThreshold added in v6.7.0

func (c *Config) ClusterRebalanceThreshold() int64

ClusterRebalanceThreshold returns load difference between most and least busy server needed to trigger a migration.

func (*Config) Dump

func (c *Config) Dump() map[string]string

Dump current configuration keys and their values. Keys with values matching their defaults are omitted.

func (*Config) HTTPSAllowedCredentials

func (c *Config) HTTPSAllowedCredentials() bool

HTTPSAllowedCredentials returns the relevant CORS setting.

func (*Config) HTTPSAllowedHeaders

func (c *Config) HTTPSAllowedHeaders() string

HTTPSAllowedHeaders returns the relevant CORS setting.

func (*Config) HTTPSAllowedMethods

func (c *Config) HTTPSAllowedMethods() string

HTTPSAllowedMethods returns the relevant CORS setting.

func (*Config) HTTPSAllowedOrigin

func (c *Config) HTTPSAllowedOrigin() string

HTTPSAllowedOrigin returns the relevant CORS setting.

func (*Config) HTTPSTrustedProxy

func (c *Config) HTTPSTrustedProxy() string

HTTPSTrustedProxy returns the configured HTTPS trusted proxy setting, if any.

func (*Config) ImagesAutoUpdateCached

func (c *Config) ImagesAutoUpdateCached() bool

ImagesAutoUpdateCached returns whether or not to auto update cached images.

func (*Config) ImagesAutoUpdateIntervalHours

func (c *Config) ImagesAutoUpdateIntervalHours() int64

ImagesAutoUpdateIntervalHours returns interval in hours at which to look for update to cached images.

func (*Config) ImagesCompressionAlgorithm

func (c *Config) ImagesCompressionAlgorithm() string

ImagesCompressionAlgorithm returns the compression algorithm to use for images.

func (*Config) ImagesDefaultArchitecture

func (c *Config) ImagesDefaultArchitecture() string

ImagesDefaultArchitecture returns the default architecture.

func (*Config) ImagesMinimalReplica

func (c *Config) ImagesMinimalReplica() int64

ImagesMinimalReplica returns the numbers of nodes for cluster images replication.

func (*Config) ImagesRemoteCacheExpiryDays

func (c *Config) ImagesRemoteCacheExpiryDays() int64

ImagesRemoteCacheExpiryDays returns the number of days after which an unused cached remote image will be flushed.

func (*Config) InstancesLXCFSPerInstance added in v6.0.2

func (c *Config) InstancesLXCFSPerInstance() bool

InstancesLXCFSPerInstance returns whether LXCFS should be run on a per-instance basis.

func (*Config) InstancesNICHostname

func (c *Config) InstancesNICHostname() string

InstancesNICHostname returns hostname mode to use for instance NICs.

func (*Config) InstancesPlacementScriptlet

func (c *Config) InstancesPlacementScriptlet() string

InstancesPlacementScriptlet returns the instances placement scriptlet source code.

func (*Config) LokiServer

func (c *Config) LokiServer() (string, string, string, string, string, string, []string, []string)

LokiServer returns all the Loki settings needed to connect to a server.

func (*Config) MaxStandBy

func (c *Config) MaxStandBy() int64

MaxStandBy returns the maximum number of standby members in a cluster that will be assigned the stand-by role.

func (*Config) MaxVoters

func (c *Config) MaxVoters() int64

MaxVoters returns the maximum number of members in a cluster that will be assigned the voter role.

func (*Config) MetricsAuthentication

func (c *Config) MetricsAuthentication() bool

MetricsAuthentication checks whether metrics API requires authentication.

func (*Config) NetworkOVNIntegrationBridge

func (c *Config) NetworkOVNIntegrationBridge() string

NetworkOVNIntegrationBridge returns the integration OVS bridge to use for OVN networks.

func (*Config) NetworkOVNNorthboundConnection

func (c *Config) NetworkOVNNorthboundConnection() string

NetworkOVNNorthboundConnection returns the OVN northbound database connection string for OVN networks.

func (*Config) NetworkOVNSSL

func (c *Config) NetworkOVNSSL() (string, string, string)

NetworkOVNSSL returns all three SSL configuration keys needed for a connection.

func (*Config) OIDCServer

func (c *Config) OIDCServer() (string, string, string, string, string)

OIDCServer returns all the OpenID Connect settings needed to connect to a server.

func (*Config) OfflineThreshold

func (c *Config) OfflineThreshold() time.Duration

OfflineThreshold returns the configured heartbeat threshold, i.e. the number of seconds before after which an unresponsive node is considered offline..

func (*Config) OpenFGA

func (c *Config) OpenFGA() (apiURL string, apiToken string, storeID string)

OpenFGA returns all OpenFGA settings need to interact with an OpenFGA server.

func (*Config) Patch

func (c *Config) Patch(patch map[string]string) (map[string]string, error)

Patch changes only the configuration keys in the given map.

Return what has actually changed.

func (*Config) ProxyHTTP

func (c *Config) ProxyHTTP() string

ProxyHTTP returns the configured HTTP proxy, if any.

func (*Config) ProxyHTTPS

func (c *Config) ProxyHTTPS() string

ProxyHTTPS returns the configured HTTPS proxy, if any.

func (*Config) ProxyIgnoreHosts

func (c *Config) ProxyIgnoreHosts() string

ProxyIgnoreHosts returns the configured ignore-hosts proxy setting, if any.

func (*Config) RemoteTokenExpiry

func (c *Config) RemoteTokenExpiry() string

RemoteTokenExpiry returns the time after which a remote add token expires.

func (*Config) Replace

func (c *Config) Replace(values map[string]string) (map[string]string, error)

Replace the current configuration with the given values.

Return what has actually changed.

func (*Config) ShutdownTimeout

func (c *Config) ShutdownTimeout() time.Duration

ShutdownTimeout returns the number of minutes to wait for running operation to complete before the server shuts down.

func (*Config) TrustCACertificates

func (c *Config) TrustCACertificates() bool

TrustCACertificates returns whether client certificates are checked against a CA.

Jump to

Keyboard shortcuts

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