models.k8s.models module

class models.k8s.models.AffectedNode(node_name: str = '', node_id: str = '', not_ready_time: float = 0, ready_time: float = 0, stopped_time: float = 0, running_time: float = 0, terminating_time: float = 0, json_object: str | None = None)

Bases: object

A node affected by a chaos scenario

__init__(node_name: str = '', node_id: str = '', not_ready_time: float = 0, ready_time: float = 0, stopped_time: float = 0, running_time: float = 0, terminating_time: float = 0, json_object: str | None = None)
node_id: str

Id of the node

node_name: str

Name of the node

not_ready_time: float

Amount of time the node took to get to a not ready state

ready_time: float

Amount of time the node took to get to a ready state

running_time: float

Amount of time the cloud provider took to get a node running

set_affected_node_status(status: str, total_time: float)
set_cloud_running_time(running_time)
set_cloud_stopping_time(stopped_time)
set_not_ready_time(not_ready_time)
set_ready_time(ready_time)
set_terminating_time(terminating_time)
stopped_time: float

Amount of time the cloud provider took to stop a node

terminating_time: float
class models.k8s.models.AffectedNodeStatus

Bases: object

Return value of wait_for_pods_to_become_ready_by_label and wait_for_pods_to_become_ready_by_name_pattern containing the list of the pods that did recover (pod_name, namespace, time needed to become ready) and the list of pods that did not recover from the chaos

__init__()
affected_nodes: list[AffectedNode]
get_affected_node_index(node_id)
merge_affected_nodes()
class models.k8s.models.AffectedPod(pod_name: str, namespace: str, total_recovery_time: float | None = None, pod_readiness_time: float | None = None, pod_rescheduling_time: float | None = None)

Bases: object

A pod affected by a chaos scenario

__init__(pod_name: str, namespace: str, total_recovery_time: float | None = None, pod_readiness_time: float | None = None, pod_rescheduling_time: float | None = None)
namespace: str

Namespace of the pod

pod_name: str

Name of the pod

pod_readiness_time: float

The time the pod took to become ready after being scheduled

pod_rescheduling_time: float

The time that the cluster took to reschedule the pod after the kill scenario

total_recovery_time: float

Total amount of time the pod took to become ready

exception models.k8s.models.ApiRequestException

Bases: Exception

Generic API Exception raised by k8s package Methods

class models.k8s.models.Container(image: str, name: str, volumeMounts: list[VolumeMount], ready: bool = False)

Bases: object

Data class to hold information regarding containers in a pod

__init__(image: str, name: str, volumeMounts: list[VolumeMount], ready: bool = False) None
image: str

Container images

name: str

Container Name

ready: bool = False

Container Ready status

volumeMounts: list[VolumeMount]

List of volumes mounted in the Container

class models.k8s.models.NodeResources

Bases: object

__init__()
cpu: int
disk_space: int
memory: int
class models.k8s.models.PVC(name: str, capacity: str, volumeName: str, podNames: list[str], namespace: str)

Bases: object

Data class to hold information regarding persistent volume claims

__init__(name: str, capacity: str, volumeName: str, podNames: list[str], namespace: str) None
capacity: str

PVC size

name: str

Persistent Volume Claim Name

namespace: str

Namespace where the PVC is deployed

podNames: list[str]

Pods Claiming the PVC

volumeName: str

Name of the projected Volume

class models.k8s.models.Pod(name: str, status: str, podIP: str, namespace: str, containers: list[Container], nodeName: str, volumes: list[Volume])

Bases: object

Data class to hold information regarding a pod

__init__(name: str, status: str, podIP: str, namespace: str, containers: list[Container], nodeName: str, volumes: list[Volume]) None
containers: list[Container]

List of containers in the Pod

name: str

Pod Name

namespace: str

Pod Namespaces

nodeName: str

Node name where the Pod is deployed

podIP: str

Pod ip address

status: str

Status of the Pod

volumes: list[Volume]

Volumes mounted in the Pod

class models.k8s.models.PodsMonitorThread(executor: ThreadPoolExecutor, future: Future)

Bases: object

__init__(executor: ThreadPoolExecutor, future: Future)
executor: ThreadPoolExecutor
future: Future
join(timeout: int = 120) PodsStatus
class models.k8s.models.PodsStatus(json_object: str | None = None)

Bases: object

Return value of wait_for_pods_to_become_ready_by_label and wait_for_pods_to_become_ready_by_name_pattern containing the list of the pods that did recover (pod_name, namespace, time needed to become ready) and the list of pods that did not recover from the chaos

__init__(json_object: str | None = None)
error: str | None
merge(pods_status: PodsStatus)
recovered: list[AffectedPod]
unrecovered: list[AffectedPod]
class models.k8s.models.ServiceHijacking(pod_name: str, namespace: str, selector: str, config_map_name: str)

Bases: object

__init__(pod_name: str, namespace: str, selector: str, config_map_name: str)
config_map_name: str
namespace: str
pod_name: str
selector: str
class models.k8s.models.Volume(name: str, pvcName: str)

Bases: object

Data class to hold information regarding volumes in a pod

__init__(name: str, pvcName: str) None
name: str

Volume Name

pvcName: str

Persistent Volume Claim Name associated with the Volume

class models.k8s.models.VolumeMount(name: str, mountPath: str)

Bases: object

Data class to hold information regarding volume mounts

__init__(name: str, mountPath: str) None
mountPath: str

Path where the molume is mounted in the POD

name: str

VolumeMount Name