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:""` // IgnoredNamespaces 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:""` // DNSServiceName is the name of DNS service, which is used for DNS chaos DNSServiceName string `envconfig:"CHAOS_DNS_SERVICE_NAME" default:""` DNSServicePort int `envconfig:"CHAOS_DNS_SERVICE_PORT" default:""` // SecurityMode is used for enable authority validation in admission webhook SecurityMode bool `envconfig:"SECURITY_MODE" default:"true" json:"security_mode"` // Namespace is the namespace which the controller manager run in Namespace string `envconfig:"NAMESPACE" default:""` // AllowHostNetworkTesting removes the restriction on chaos testing pods with `hostNetwork` set to true AllowHostNetworkTesting bool `envconfig:"ALLOW_HOST_NETWORK_TESTING" default:"false"` }
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" json:"listen_host"` ListenPort int `envconfig:"LISTEN_PORT" default:"2333" json:"listen_port"` MetricAddress string `envconfig:"METRIC_ADDRESS" json:"-"` EnableLeaderElection bool `envconfig:"ENABLE_LEADER_ELECTION" json:"-"` Database *DatabaseConfig `json:"-"` PersistTTL *PersistTTLConfig `json:"-"` // ClusterScoped means control Chaos Object in cluster level(all namespace), ClusterScoped bool `envconfig:"CLUSTER_SCOPED" default:"true" json:"cluster_mode"` // TargetNamespace is the target namespace to injecting chaos. // It only works with ClusterScoped is false; TargetNamespace string `envconfig:"TARGET_NAMESPACE" default:"" json:"target_namespace"` // AllowedNamespaces is a regular expression, and matching namespace will allow the chaos task to be performed AllowedNamespaces string `envconfig:"ALLOWED_NAMESPACES" default:"" json:"-"` // IgnoredNamespaces is a regular expression, and the chaos task will be ignored by a matching namespace IgnoredNamespaces string `envconfig:"IGNORED_NAMESPACES" default:"" json:"-"` // SecurityMode will use the token login by the user if set to true SecurityMode bool `envconfig:"SECURITY_MODE" default:"true" json:"security_mode"` DNSServerCreate bool `envconfig:"DNS_SERVER_CREATE" default:"false" json:"dns_server_create"` }
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
Click to show internal directories.
Click to hide internal directories.