Handling node failures
Intentionally (to save costs) or unintentionally, nodes can go down. When that happens, you don't want to get the proverbial 3 a.m. call that your system is down. Kubernetes can handle moving workloads on failed nodes automatically for you instead. In this exercise, we are going to deploy the guestbook application and are going to bring a node down in our cluster and see what Kubernetes does in response:
- Ensure that your cluster has at least two nodes:
kubectl get nodes
This should generate an output as shown in Figure 5.1:
Figure 5.1: Ensure you have two nodes running in your cluster
If you don't have two nodes in your cluster, look for your cluster in the Azure portal, navigate to Node pools, and click on Node count. You can scale this to 2 nodes as shown in Figure 5.2:
Figure 5.2: Scaling the cluster
- As an example application in this chapter, we will work with the guestbook application. The YAML file to deploy this has been provided in the...