From the course: Certified Kubernetes Application Developer (CKAD) Cert Prep

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Using storage

Using storage

- Okay. Our next task is about storage. To start, use minikube ssh to open a session to the Minikube host, and then use mkdir/webapp, followed by echo welcome to the store > /webapp/index.html, and type exit when done. The purpose here is that on the Minikube host, you create a directory that has a file. Then, you run a pod with the name storepod. And this pod should use a Hostpath volume that mounts a Minikube host directory /webapp. On the pod directory, /usr/share/nginx/html. And make the pod accessible through Minikube host port 32032 and test that while using curl$(minikube ip):32032, you see the text, welcome to the store. Let me show you. So, starting with minikube ssh and sudo mkdir /webapp and sudo sh -c echo welcome to the store > /webapp/index.html. Let's do a cat on /webapp/index.html. And there, we can see welcome to the store. So far, so good. So, now, we need a pod with the name store pod that uses the latest version of nginx, and that uses a Hostpath volume to mount…

Contents