Welcome to the Linux Foundation Forum!

persistentvol with hostpath not working

hello instructors

https://kubernetes.io/docs/tasks/configure-pod-container/configure-persistent-volume-storage/

in this documentation the example provided shows how to validate the the hostpath pv is working.

**In your shell, verify that nginx is serving the index.html file from the hostPath volume:

Be sure to run these 3 commands inside the root shell that comes from

running "kubectl exec" in the previous step

apt update
apt install curl
curl http://localhost/**

this is not working. i am getting 403 forbidden when i follow the same example.

can someone help debug or troubleshoot the issue.

regards,
Santosh

Comments

  • chrispokorni
    chrispokorni Posts: 2,310

    Hi @santoshsub123,

    An easier method to validate the webserver, is to run a curl command with the Pod's IP address as an argument:

    curl <Pod-IP>

    instead of the exec command and running curl from inside the container.

    Regards,
    -Chris

Categories

Upcoming Training