Terminating Application Dependencies
Explore the effects of terminating a database instance that supports an application. Understand how this impacts application availability and failure recovery in Kubernetes. Learn to design and run chaos experiments to test resiliency and identify necessary improvements for high availability through multi-instance databases and StatefulSets.
There’s one more thing within the area of what we’re exploring that we might want to try. We might want to check what happens if we destroy an instance of a dependency of our application. As you already know, our demo application depends on MongoDB. We saw what happens when we destroy an instance of our application. Next, we’ll explore how the application behaves if we terminate a replica of the database (the dependency).
Inspecting the definition of health-db.yaml
We are going to take a look at yet another chaos experiment definition.
The output is as follows.
version: 1.0.0
title: What happens if we terminate an instance of the DB?
description: If an instance of the DB is terminated, dependant applications should still be operational.
tags:
- k8s
- pod
- http
configuration:
ingress_host:
type: env
key: INGRESS_HOST
steady-state-hypothesis:
title: The app is healthy
probes:
- name: app-responds-to-requests
type: probe
tolerance: 200
provider:
type: http
timeout: 3
verify_tls: false
url: http://${ingress_host}/demo/person
headers:
...