Question : We already created a directory /mnt/dba and a file index.html under the same on node01 (you need not to access node01), that location should be mounted within the container to web server's document root (keep in mind doc root can be different for Apache and Nginx web servers).
Create a PersistentVolume named as pv-nautilus. Configure the spec as storage class should be manual, set capacity to 7Gi, set access mode to ReadWriteOnce , volume type should be hostPath and set path to /mnt/dba.
Create a PersistentVolumeClaim named as pvc-nautilus. Configure the spec as storage class should be manual, set request storage to 4Gi, set access mode to ReadWriteOnce.
Create a pod named as pod-nautilus, set volume as storage-nautilus, and persistent volume claim to be named as pvc-nautilus. Container name should be container-nautilus, use image nginx with latest tag only and remember to mention tag i.e nginx:latest , container port should be default port 80, mount the volume to mount path to default doc root of web server and should be named storage-nautilus.
You can check your static website, exec into the pod and use curl command, i.e curl http://localhost.
1. At first kubectl utility configure and working from jump server, run below commands
kubectl get services
kubectl get pods
https://gitlab.com/nb-tech-support/devops.git
( Refer Below Video for more clarity )
kubectl get pods
6. Click on Finish & Confirm to complete the task successful
Happy Learning!!!!
0 Comments