const DefaultNamespace = "default"
func GetPods(ctx context.Context, status v1alpha1.ChaosStatus, selectorSpec v1alpha1.PodSelectorSpec, c client.Client) ([]v1.Pod, []v1.Pod, error)
GetPods returns pod list and corresponding chaos daemon
type DaemonHelper struct { Builder *chaosdaemon.ChaosDaemonClientBuilder }
func (h *DaemonHelper) GetPidFromPod(ctx context.Context, pod *v1.Pod) (uint32, error)
GetPidFromPod returns pid given containerd ID in pod
type Resolver struct { *DaemonHelper Log logr.Logger Client client.Client Clientset *kubernetes.Clientset NoCacheReader client.Reader }
func (r *Resolver) AttrOverrideSpec() generated.AttrOverrideSpecResolver
AttrOverrideSpec returns generated.AttrOverrideSpecResolver implementation.
func (r *Resolver) BandwidthSpec() generated.BandwidthSpecResolver
BandwidthSpec returns generated.BandwidthSpecResolver implementation.
func (r *Resolver) ChaosCondition() generated.ChaosConditionResolver
ChaosCondition returns generated.ChaosConditionResolver implementation.
func (r *Resolver) CidrAndPort() generated.CidrAndPortResolver
CidrAndPort returns generated.CidrAndPortResolver implementation.
func (r *Resolver) ContainerStateRunning() generated.ContainerStateRunningResolver
ContainerStateRunning returns generated.ContainerStateRunningResolver implementation.
func (r *Resolver) ContainerStateTerminated() generated.ContainerStateTerminatedResolver
ContainerStateTerminated returns generated.ContainerStateTerminatedResolver implementation.
func (r *Resolver) ExecBypass(ctx context.Context, pod *v1.Pod, cmd string, nsTypes ...bpm.NsType) (string, error)
ExecBypass use chaos-daemon to enter namespace and execute command in target pod
func (r *Resolver) ExperimentStatus() generated.ExperimentStatusResolver
ExperimentStatus returns generated.ExperimentStatusResolver implementation.
func (r *Resolver) GetCPUPeriod(ctx context.Context, obj *v1.Pod, cpuMountType string) (int, error)
GetCPUPeriod returns result of cat /sys/fs/cgroup/:cpuMountType/cpu.cfs_period_us
func (r *Resolver) GetCPUQuota(ctx context.Context, obj *v1.Pod, cpuMountType string) (int, error)
GetCPUQuota returns result of cat /sys/fs/cgroup/:cpuMountType/cpu.cfs_quota_us
func (r *Resolver) GetCgroup(ctx context.Context, obj *v1.Pod, pid string) (string, error)
GetCgroup returns result of cat /proc/:pid/cgroup The output looks like: “` 11:freezer:/ 10:hugetlb:/ 9:memory:/system.slice/sshd.service 8:pids:/system.slice/sshd.service 7:perf_event:/ 6:net_cls,net_prio:/ 5:devices:/system.slice/sshd.service 4:blkio:/system.slice/sshd.service 3:cpu,cpuacct:/system.slice/sshd.service 2:cpuset:/ 1:name=systemd:/system.slice/sshd.service “`
func (r *Resolver) GetCgroups(ctx context.Context, obj *model.PodStressChaos) (*model.Cgroups, error)
GetCgroups returns result of cat /proc/cgroups
func (r *Resolver) GetFdsOfProcess(ctx context.Context, process *model.Process) []*model.Fd
GetFdsOfProcess returns fd-target pairs. The output looks like: “` total 0 lrwx------ 1 docker docker 64 Mar 3 16:11 0 -> /dev/pts/0 lrwx------ 1 docker docker 64 Mar 3 16:11 1 -> /dev/pts/0 lrwx------ 1 docker docker 64 Mar 3 16:11 2 -> /dev/pts/0 lr-x------ 1 docker docker 64 Mar 3 16:11 3 -> /proc/642108/fd “`
func (r *Resolver) GetIpset(ctx context.Context, obj *v1.Pod) (string, error)
GetIpset returns result of ipset list
func (r *Resolver) GetIptables(ctx context.Context, obj *v1.Pod) ([]string, error)
GetIptables returns result of iptables --list
func (r *Resolver) GetMemoryLimit(ctx context.Context, obj *v1.Pod) (int64, error)
GetMemoryLimit returns result of cat /sys/fs/cgroup/memory/memory.limit_in_bytes
func (r *Resolver) GetMounts(ctx context.Context, pod *v1.Pod) ([]string, error)
GetMounts returns mounts info The output looks like: “` proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0 sys /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0 dev /dev devtmpfs rw,nosuid,relatime,size=16283300k,nr_inodes=4070825,mode=755,inode64 0 0 run /run tmpfs rw,nosuid,nodev,relatime,mode=755,inode64 0 0 tmpfs /dev/shm tmpfs rw,nosuid,nodev,inode64 0 0 cgroup2 /sys/fs/cgroup cgroup2 rw,nosuid,nodev,noexec,relatime,nsdelegate,memory_recursiveprot 0 0 tmpfs /run/user/1000 tmpfs rw,nosuid,nodev,relatime,size=3258252k,nr_inodes=814563,mode=700,uid=1000,gid=1000,inode64 0 0 “`
func (r *Resolver) GetPidFromPS(ctx context.Context, pod *v1.Pod) ([]*model.Process, error)
GetPidFromPS returns pid-command pairs
func (r *Resolver) GetTcQdisc(ctx context.Context, obj *v1.Pod) ([]string, error)
GetIpset returns result of tc qdisc list
func (r *Resolver) HTTPChaos() generated.HTTPChaosResolver
HTTPChaos returns generated.HTTPChaosResolver implementation.
func (r *Resolver) HTTPChaosSpec() generated.HTTPChaosSpecResolver
HTTPChaosSpec returns generated.HTTPChaosSpecResolver implementation.
func (r *Resolver) HTTPChaosStatus() generated.HTTPChaosStatusResolver
HTTPChaosStatus returns generated.HTTPChaosStatusResolver implementation.
func (r *Resolver) IOChaos() generated.IOChaosResolver
IOChaos returns generated.IOChaosResolver implementation.
func (r *Resolver) IOChaosAction() generated.IOChaosActionResolver
IOChaosAction returns generated.IOChaosActionResolver implementation.
func (r *Resolver) IOChaosSpec() generated.IOChaosSpecResolver
IOChaosSpec returns generated.IOChaosSpecResolver implementation.
func (r *Resolver) IOChaosStatus() generated.IOChaosStatusResolver
IOChaosStatus returns generated.IOChaosStatusResolver implementation.
func (r *Resolver) IoFault() generated.IoFaultResolver
IoFault returns generated.IoFaultResolver implementation.
func (r *Resolver) Logger() generated.LoggerResolver
Logger returns generated.LoggerResolver implementation.
func (r *Resolver) MistakeSpec() generated.MistakeSpecResolver
MistakeSpec returns generated.MistakeSpecResolver implementation.
func (r *Resolver) MutablePod() generated.MutablePodResolver
MutablePod returns generated.MutablePodResolver implementation.
func (r *Resolver) Mutation() generated.MutationResolver
Mutation returns generated.MutationResolver implementation.
func (r *Resolver) Namespace() generated.NamespaceResolver
Namespace returns generated.NamespaceResolver implementation.
func (r *Resolver) NetworkChaos() generated.NetworkChaosResolver
NetworkChaos returns generated.NetworkChaosResolver implementation.
func (r *Resolver) OwnerReference() generated.OwnerReferenceResolver
OwnerReference returns generated.OwnerReferenceResolver implementation.
func (r *Resolver) Pod() generated.PodResolver
Pod returns generated.PodResolver implementation.
func (r *Resolver) PodCondition() generated.PodConditionResolver
PodCondition returns generated.PodConditionResolver implementation.
func (r *Resolver) PodHTTPChaos() generated.PodHTTPChaosResolver
PodHTTPChaos returns generated.PodHTTPChaosResolver implementation.
func (r *Resolver) PodHttpChaosReplaceActions() generated.PodHttpChaosReplaceActionsResolver
PodHttpChaosReplaceActions returns generated.PodHttpChaosReplaceActionsResolver implementation.
func (r *Resolver) PodHttpChaosRule() generated.PodHttpChaosRuleResolver
PodHttpChaosRule returns generated.PodHttpChaosRuleResolver implementation.
func (r *Resolver) PodHttpChaosSelector() generated.PodHttpChaosSelectorResolver
PodHttpChaosSelector returns generated.PodHttpChaosSelectorResolver implementation.
func (r *Resolver) PodIOChaos() generated.PodIOChaosResolver
PodIOChaos returns generated.PodIOChaosResolver implementation.
func (r *Resolver) PodNetworkChaos() generated.PodNetworkChaosResolver
PodNetworkChaos returns generated.PodNetworkChaosResolver implementation.
func (r *Resolver) PodSelectorSpec() generated.PodSelectorSpecResolver
PodSelectorSpec returns generated.PodSelectorSpecResolver implementation.
func (r *Resolver) PodStatus() generated.PodStatusResolver
PodStatus returns generated.PodStatusResolver implementation.
func (r *Resolver) PodStressChaos() generated.PodStressChaosResolver
PodStressChaos returns generated.PodStressChaosResolver implementation.
func (r *Resolver) Process() generated.ProcessResolver
Process returns generated.ProcessResolver implementation.
func (r *Resolver) Query() generated.QueryResolver
Query returns generated.QueryResolver implementation.
func (r *Resolver) RawIPSet() generated.RawIPSetResolver
RawIPSet returns generated.RawIPSetResolver implementation.
func (r *Resolver) RawIptables() generated.RawIptablesResolver
RawIptables returns generated.RawIptablesResolver implementation.
func (r *Resolver) RawTrafficControl() generated.RawTrafficControlResolver
RawTrafficControl returns generated.RawTrafficControlResolver implementation.
func (r *Resolver) Record() generated.RecordResolver
Record returns generated.RecordResolver implementation.
func (r *Resolver) StressChaos() generated.StressChaosResolver
StressChaos returns generated.StressChaosResolver implementation.
func (r *Resolver) StressChaosSpec() generated.StressChaosSpecResolver
StressChaosSpec returns generated.StressChaosSpecResolver implementation.
func (r *Resolver) StressChaosStatus() generated.StressChaosStatusResolver
StressChaosStatus returns generated.StressChaosStatusResolver implementation.