Cracking stateful applications in Kubernetes
In this section, we will learn about how to work with storage for stateful applications in Kubernetes. The considerations within this part are often seen as high-value and low-effort in terms of the CKA exam. Make sure you keep practicing them until you feel you know them confidently:
- Mounting storage to a stateful application
- Dynamically provisioning storage to a stateful application
Configuring an application with mounted storage
You need to create a new YAML definition where you write up the specification of the Kubernetes pod and then set up emptyDir volumes for the pod. Kubernetes creates empty storage on a node after the pod is scheduled to a specific worker node:
- Check whether you currently have any nodes available to schedule a pod by using the following command:
kubectl get nodes
Alternatively, you can use the simplified version of the previous command:
alias k=kubectl k get no
If the...