...

/

Terminating Random Nodes

Terminating Random Nodes

In this lesson, we will run an experiment using a CronJob to terminate random nodes, and then we will use the dashboards to figure out if it was successful or not.

Applying the CronJob

Let’s apply the new definition of the CronJob.

Press + to interact
kubectl --namespace chaos apply --filename k8s/chaos/periodic-node.yaml

Assuming that you left the loop that sends requests running in the second terminal, we should be able to observe that the demo application keeps responding with 200. At the moment, the demo application seems to be working correctly.

As you already know, we’ll need to wait for a while until the first Job is created, and the experiment is executed.

Retrieving all CronJobs from the chaos Namespace

We’ll retrieve CronJobs to make it more interesting than staring at the blank screen.

Press + to interact
kubectl --namespace chaos get cronjobs

After a while, and a few repetitions of the previous command, the output should be similar to the one that follows.

NAME        SCHEDULE    SUSPEND ACTIVE LAST SCHEDULE AGE
nodes-chaos */5 * * * * False   0      1m01s         5m2s

Once there is something other than ...

Access this course and 1400+ top-rated courses and projects.