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

  • Posts: 2,449

    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

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Categories

Upcoming Training