We have already discussed that ReplicsSets have self-healing property. Let’s test this property by making a few changes to our system.
Destroying a pod
Let’s see what happens when a Pod is destroyed.
123
POD_NAME=$(kubectl get pods -o name \
| tail -1)
kubectl delete $POD_NAME
Delete a pod
We retrieved all the Pods and used -o name to retrieve only their names. The result was piped to tail -1 so that only one of the names is output. The result is stored in the environment variable POD_NAME. The latter command used that variable to remove the Pod as a simulation of a failure.
Let’s take another look at the Pods in the cluster.
We have already discussed that ReplicsSets have self-healing property. Let’s test this property by making a few changes to our system.
Destroying a pod
Let’s see what happens when a Pod is destroyed