Fixing storage mount issues
Earlier in this chapter, you noticed how the guestbook application lost data when the Redis master was moved to another node. This happened because that sample application didn't use any persistent storage. In this section, you'll see an example of how PVCs can be used to prevent data loss when Kubernetes moves a pod to another node. You will see a common error that occurs when Kubernetes moves pods with PVCs attached, and you'll learn how to fix this.
For this, you will reuse the WordPress example from the previous chapter. Before starting, let's make sure that the cluster is in a clean state:
kubectl get all
This should show you just the one Kubernetes service, as in Figure 5.15:
Figure 5.15: You should only have the one Kubernetes service running for now
Let's also ensure that both nodes are running and Ready:
kubectl get nodes
This should show us both nodes in a Ready state, as in...