chaosdaemon

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2023 License: Apache-2.0 Imports: 48 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// StatusOK represents OK status code
	StatusOK = 200
	// StatusOtherError represents Error status code
	StatusOtherError = 1
)
View Source
const (
	// DNSServerConfFile is the default config file for DNS server
	DNSServerConfFile = "/etc/resolv.conf"
)

Variables

This section is empty.

Functions

func MetadataExtractor

func MetadataExtractor(keys ...log.Metadatkey) grpc.UnaryServerInterceptor

func ToNetlinkNetemAttrs

func ToNetlinkNetemAttrs(netem *pb.Netem) netlink.NetemQdiscAttrs

Types

type Config

type Config struct {
	HTTPPort       int
	GRPCPort       int
	Host           string
	CrClientConfig *crclients.CrClientConfig
	Profiling      bool
	// contains filtered or unexported fields
}

Config contains the basic chaos daemon configuration.

func (*Config) GrpcAddr

func (c *Config) GrpcAddr() string

Get the grpc address

func (*Config) HttpAddr

func (c *Config) HttpAddr() string

Get the http address

type DaemonServer

type DaemonServer struct {
	IPSetLocker *locker.Locker
	// contains filtered or unexported fields
}

DaemonServer represents a grpc server for tc daemon

func NewDaemonServerWithCRClient

func NewDaemonServerWithCRClient(crClient crclients.ContainerRuntimeInfoClient, reg prometheus.Registerer, log logr.Logger) *DaemonServer

NewDaemonServerWithCRClient returns DaemonServer with container runtime client

func (*DaemonServer) ApplyBlockChaos

func (*DaemonServer) ApplyHttpChaos

func (*DaemonServer) ApplyIOChaos

func (*DaemonServer) CancelStressors

func (s *DaemonServer) CancelStressors(ctx context.Context,
	req *pb.CancelStressRequest) (*empty.Empty, error)

func (*DaemonServer) ContainerGetPid

func (s *DaemonServer) ContainerGetPid(ctx context.Context, req *pb.ContainerRequest) (*pb.ContainerResponse, error)

func (*DaemonServer) ContainerKill

func (s *DaemonServer) ContainerKill(ctx context.Context, req *pb.ContainerRequest) (*empty.Empty, error)

ContainerKill kills container according to container id in the req

func (*DaemonServer) ExecCPUStressors

func (s *DaemonServer) ExecCPUStressors(ctx context.Context,
	req *pb.ExecStressRequest) (*bpm.Process, error)

func (*DaemonServer) ExecMemoryStressors

func (s *DaemonServer) ExecMemoryStressors(ctx context.Context,
	req *pb.ExecStressRequest) (*bpm.Process, error)

func (*DaemonServer) ExecStressors

func (s *DaemonServer) ExecStressors(ctx context.Context,
	req *pb.ExecStressRequest) (*pb.ExecStressResponse, error)

func (*DaemonServer) FlushIPSets

func (s *DaemonServer) FlushIPSets(ctx context.Context, req *pb.IPSetsRequest) (*empty.Empty, error)

func (*DaemonServer) InstallJVMRules

func (s *DaemonServer) InstallJVMRules(ctx context.Context,
	req *pb.InstallJVMRulesRequest) (*empty.Empty, error)

func (*DaemonServer) RecoverBlockChaos

func (s *DaemonServer) RecoverBlockChaos(ctx context.Context, req *pb.RecoverBlockChaosRequest) (*empty.Empty, error)

func (*DaemonServer) RecoverTimeOffset

func (s *DaemonServer) RecoverTimeOffset(ctx context.Context, req *pb.TimeRequest) (*empty.Empty, error)

func (*DaemonServer) SetDNSServer

func (s *DaemonServer) SetDNSServer(ctx context.Context,
	req *pb.SetDNSServerRequest) (*empty.Empty, error)

func (*DaemonServer) SetIptablesChains

func (s *DaemonServer) SetIptablesChains(ctx context.Context, req *pb.IptablesChainsRequest) (*empty.Empty, error)

func (*DaemonServer) SetTcs

func (s *DaemonServer) SetTcs(ctx context.Context, in *pb.TcsRequest) (*empty.Empty, error)

func (*DaemonServer) SetTimeOffset

func (s *DaemonServer) SetTimeOffset(ctx context.Context, req *pb.TimeRequest) (*empty.Empty, error)

func (*DaemonServer) UninstallJVMRules

func (s *DaemonServer) UninstallJVMRules(ctx context.Context,
	req *pb.UninstallJVMRulesRequest) (*empty.Empty, error)

type RegisterGatherer

type RegisterGatherer interface {
	prometheus.Registerer
	prometheus.Gatherer
}

RegisterGatherer combine prometheus.Registerer and prometheus.Gatherer

type Response

type Response struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data"`
}

Response is the body part of HTTP Response

type Server

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

Server is the server for chaos daemon

func BuildServer

func BuildServer(conf *Config, reg RegisterGatherer, log logr.Logger) (*Server, error)

BuildServer builds a chaos daemon server

func (*Server) Shutdown

func (s *Server) Shutdown() error

func (*Server) Start

func (s *Server) Start() error

Start starts chaos-daemon.

type TimeChaosServer

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

func (*TimeChaosServer) DelPodContainerNameProcess

func (s *TimeChaosServer) DelPodContainerNameProcess(idName tasks.PodContainerName)

func (*TimeChaosServer) SetPodContainerNameProcess

func (s *TimeChaosServer) SetPodContainerNameProcess(idName tasks.PodContainerName, sysID tasks.SysPID)

func (*TimeChaosServer) SetTimeOffset

func (s *TimeChaosServer) SetTimeOffset(uid tasks.TaskID, id tasks.PodContainerName, config time.Config) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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