config

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2020 License: Apache-2.0 Imports: 4 Imported by: 16

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParsePersistTTLConfig added in v1.0.0

func ParsePersistTTLConfig(config *PersistTTLConfig) (*ttlcontroller.TTLconfig, error)

ParsePersistTTLConfig parse PersistTTLConfig to persistTTLConfigParsed.

Types

type ChaosControllerConfig

type ChaosControllerConfig struct {
	// ChaosDaemonPort is the port which grpc server listens on
	ChaosDaemonPort int `envconfig:"CHAOS_DAEMON_PORT" default:"31767"`
	// BPFKIPort is the port which BFFKI grpc server listens on
	BPFKIPort int `envconfig:"BPFKI_PORT" default:"50051"`
	// MetricsAddr is the address the metric endpoint binds to
	MetricsAddr string `envconfig:"METRICS_ADDR" default:":10080"`
	// PprofAddr is the address the pprof endpoint binds to.
	PprofAddr string `envconfig:"PPROF_ADDR" default:"0"`
	// EnableLeaderElection is enable leader election for controller manager
	// Enabling this will ensure there is only one active controller manager
	EnableLeaderElection bool `envconfig:"ENABLE_LEADER_ELECTION" default:"false"`
	// CertsDir is the directory for storing certs key file and cert file
	CertsDir string `envconfig:"CERTS_DIR" default:"/etc/webhook/certs"`
	// AllowedNamespaces is a regular expression, and matching namespace will allow the chaos task to be performed
	AllowedNamespaces string `envconfig:"ALLOWED_NAMESPACES" default:""`
	// AllowedNamespaces is a regular expression, and the chaos task will be ignored by a matching namespace
	IgnoredNamespaces string `envconfig:"IGNORED_NAMESPACES" default:""`
	// RPCTimeout is timeout of RPC between controllers and chaos-operator
	RPCTimeout    time.Duration `envconfig:"RPC_TIMEOUT" default:"1m"`
	WatcherConfig *watcher.Config
	// ClusterScoped means control Chaos Object in cluster level(all namespace),
	ClusterScoped bool `envconfig:"CLUSTER_SCOPED" default:"true"`
	// TargetNamespace is the target namespace to injecting chaos.
	// It only works with ClusterScoped is false;
	TargetNamespace string `envconfig:"TARGET_NAMESPACE" default:""`
}

ChaosControllerConfig defines the configuration for Chaos Controller

func EnvironChaosController

func EnvironChaosController() (ChaosControllerConfig, error)

EnvironChaosController returns the settings from the environment.

type ChaosDashboardConfig

type ChaosDashboardConfig struct {
	ListenHost           string `envconfig:"LISTEN_HOST" default:"0.0.0.0"`
	ListenPort           int    `envconfig:"LISTEN_PORT" default:"2333"`
	MetricAddress        string `envconfig:"METRIC_ADDRESS"`
	EnableLeaderElection bool   `envconfig:"ENABLE_LEADER_ELECTION"`
	Database             *DatabaseConfig
	PersistTTL           *PersistTTLConfig
}

ChaosDashboardConfig defines the configuration for Chaos Dashboard

func EnvironChaosDashboard

func EnvironChaosDashboard() (*ChaosDashboardConfig, error)

EnvironChaosDashboard returns the settings from the environment.

type DatabaseConfig

type DatabaseConfig struct {
	// Archive Chaos Experiments to DB
	Archive    bool
	Driver     string `envconfig:"DATABASE_DRIVER"     default:"sqlite3"`
	Datasource string `envconfig:"DATABASE_DATASOURCE" default:"core.sqlite"`
	Secret     string `envconfig:"DATABASE_SECRET"`
}

DatabaseConfig defines the configuration for databases

type PersistTTLConfig

type PersistTTLConfig struct {
	SyncPeriod string `envconfig:"CLEAN_SYNC_PERIOD" default:"12h"`
	Event      string `envconfig:"TTL_EVENT"       default:"168h"` // one week
	Experiment string `envconfig:"TTL_EXPERIMENT"  default:"336h"` // two weeks
}

PersistTTLConfig defines the configuration of ttl

Jump to

Keyboard shortcuts

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