Simulate Time Faults
note
TimeChaos only affects the PID process in the PID namespace of the container, and child processes of the PID 1
. For example, the process started by kubectl exec
does not be affected.
You can create experiments in Chaos Dashboard or using the YAML configuration file.
Open Chaos Dashboard, and click NEW EXPERIMENT on the page to create a new experiment:
In the Choose a Target area, choose CLOCK SCREW and fill out the Clock ID and time offset.
Fill out the experiment information, and specify the experiment scope and the scheduled experiment duration:
Write the experiment configuration to the YAML configuration file. In the following example, the
time-shift.yaml
file is used.This experiment configuration will shift the time of the processes in the specified Pod forward by 10 minutes and 100 nanoseconds.
-
kubectl apply -f time-shift.yaml
The fields in the YAML configuration file are described in the following table: