Documentation
¶
Index ¶
- Constants
- type CRDPayload
- type Config
- type Controller
- func (c *Controller) Run(exp Experimentable) (string, error)
- func (c *Controller) RunTemplate(tmplPath string) (*ExperimentInfo, error)
- func (c *Controller) Stop(name string) error
- func (c *Controller) StopAll() error
- func (c *Controller) StopAllStandalone(expInfos map[string]*ExperimentInfo) error
- func (c *Controller) StopStandalone(expInfo *ExperimentInfo) error
- type ExperimentInfo
- type Experimentable
Constants ¶
View Source
const ( // APIBasePath in form of /apis/<spec.group>/<spec.versions.name>, see Chaosmesh CRD 2.0.0 APIBasePath = "/apis/chaos-mesh.org/v1alpha1" // TemplatesPath path to the chaos templates TemplatesPath = "chaos/templates" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CRDPayload ¶
CRDPayload Custom Resource Definition call payload
type Config ¶
type Config struct {
Client *kubernetes.Clientset
NamespaceName string
}
Config Chaosmesh controller config
type Controller ¶
type Controller struct {
Client *kubernetes.Clientset
Requests map[string]*rest.Request
Cfg *Config
}
Controller is controller that manages Chaosmesh CRD instances to run experiments
func NewController ¶
func NewController(cfg *Config) (*Controller, error)
NewController creates controller to run and stop chaos experiments
func (*Controller) Run ¶
func (c *Controller) Run(exp Experimentable) (string, error)
Run runs experiment and saves it's ID
func (*Controller) RunTemplate ¶
func (c *Controller) RunTemplate(tmplPath string) (*ExperimentInfo, error)
RunTemplate applies chaos from yaml template to a particular environment
func (*Controller) Stop ¶
func (c *Controller) Stop(name string) error
Stop removes experiment's entity
func (*Controller) StopAll ¶
func (c *Controller) StopAll() error
StopAll removes all experiments entities
func (*Controller) StopAllStandalone ¶
func (c *Controller) StopAllStandalone(expInfos map[string]*ExperimentInfo) error
StopAllStandalone stops all chaos experiments for a presets env
func (*Controller) StopStandalone ¶
func (c *Controller) StopStandalone(expInfo *ExperimentInfo) error
StopStandalone removes experiment's entity for a presets env
type ExperimentInfo ¶
type ExperimentInfo struct {
Name string `json:"name,omitempty" mapstructure:"name"`
Resource string `json:"resource,omitempty" mapstructure:"resource"`
}
ExperimentInfo persistent experiment info
type Experimentable ¶
type Experimentable interface {
SetBase(base experiments.Base)
Filename() string
Resource() string
}
Experimentable interface for chaos experiments
Click to show internal directories.
Click to hide internal directories.