Documentation ¶
Index ¶
- Constants
- func MetadataExtractor(keys ...log.Metadatkey) grpc.UnaryServerInterceptor
- func ToNetlinkNetemAttrs(netem *pb.Netem) netlink.NetemQdiscAttrs
- type Config
- type DaemonServer
- func (s *DaemonServer) ApplyBlockChaos(ctx context.Context, req *pb.ApplyBlockChaosRequest) (*pb.ApplyBlockChaosResponse, error)
- func (s *DaemonServer) ApplyHttpChaos(ctx context.Context, in *pb.ApplyHttpChaosRequest) (*pb.ApplyHttpChaosResponse, error)
- func (s *DaemonServer) ApplyIOChaos(ctx context.Context, in *pb.ApplyIOChaosRequest) (*pb.ApplyIOChaosResponse, error)
- func (s *DaemonServer) CancelStressors(ctx context.Context, req *pb.CancelStressRequest) (*empty.Empty, error)
- func (s *DaemonServer) ContainerGetPid(ctx context.Context, req *pb.ContainerRequest) (*pb.ContainerResponse, error)
- func (s *DaemonServer) ContainerKill(ctx context.Context, req *pb.ContainerRequest) (*empty.Empty, error)
- func (s *DaemonServer) ExecCPUStressors(ctx context.Context, req *pb.ExecStressRequest) (*bpm.Process, error)
- func (s *DaemonServer) ExecMemoryStressors(ctx context.Context, req *pb.ExecStressRequest) (*bpm.Process, error)
- func (s *DaemonServer) ExecStressors(ctx context.Context, req *pb.ExecStressRequest) (*pb.ExecStressResponse, error)
- func (s *DaemonServer) FlushIPSets(ctx context.Context, req *pb.IPSetsRequest) (*empty.Empty, error)
- func (s *DaemonServer) InstallJVMRules(ctx context.Context, req *pb.InstallJVMRulesRequest) (*empty.Empty, error)
- func (s *DaemonServer) RecoverBlockChaos(ctx context.Context, req *pb.RecoverBlockChaosRequest) (*empty.Empty, error)
- func (s *DaemonServer) RecoverTimeOffset(ctx context.Context, req *pb.TimeRequest) (*empty.Empty, error)
- func (s *DaemonServer) SetDNSServer(ctx context.Context, req *pb.SetDNSServerRequest) (*empty.Empty, error)
- func (s *DaemonServer) SetIptablesChains(ctx context.Context, req *pb.IptablesChainsRequest) (*empty.Empty, error)
- func (s *DaemonServer) SetTcs(ctx context.Context, in *pb.TcsRequest) (*empty.Empty, error)
- func (s *DaemonServer) SetTimeOffset(ctx context.Context, req *pb.TimeRequest) (*empty.Empty, error)
- func (s *DaemonServer) UninstallJVMRules(ctx context.Context, req *pb.UninstallJVMRulesRequest) (*empty.Empty, error)
- type RegisterGatherer
- type Response
- type Server
- type TimeChaosServer
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.
type DaemonServer ¶
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 (s *DaemonServer) ApplyBlockChaos(ctx context.Context, req *pb.ApplyBlockChaosRequest) (*pb.ApplyBlockChaosResponse, error)
func (*DaemonServer) ApplyHttpChaos ¶
func (s *DaemonServer) ApplyHttpChaos(ctx context.Context, in *pb.ApplyHttpChaosRequest) (*pb.ApplyHttpChaosResponse, error)
func (*DaemonServer) ApplyIOChaos ¶
func (s *DaemonServer) ApplyIOChaos(ctx context.Context, in *pb.ApplyIOChaosRequest) (*pb.ApplyIOChaosResponse, error)
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 ¶
BuildServer builds a chaos daemon server
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
Source Files ¶
Click to show internal directories.
Click to hide internal directories.