...

/

Terminating Application Instances

Terminating Application Instances

In this lesson, we will define terminate-pod.yaml and run it to destroy instances. We will also inspect the outcome.

Inspecting the definition of terminate-pod.yaml

We’re finally there. We can finally create some chaos. We are about to destroy stuff.

Let’s take a look at the first definition that we are going to use. It is located in the chaos directory, in the file terminate-pod.yaml.

Press + to interact
cat chaos/terminate-pod.yaml

The output is as follows.

version: 1.0.0
title: What happens if we terminate a Pod?
description: If a Pod is terminated, a new one should be created in its places.
tags:
- k8s
- pod
method:
- type: action
  name: terminate-pod
  provider:
    type: python
    module: chaosk8s.pod.actions
    func: terminate_pods
    arguments:
      label_selector: app=go-demo-8
      rand: true
      ns: go-demo-8

What do we have there? We have version, title, description, and tags. They’re all informative. They do not influence how an experiment is executed. They just provide additional information to whoever would like to know what that experiment is about.

title

The title, for example, says what happens if we terminate a Pod?. That’s a valid question.

description

The description is a statement that if a pod is terminated, a new one should be created in its ...