Persistent volumes in Kubernetes - Task check

I completed this task. However when I looked at the mounted path, I don;t see any html file. The mount is blank. Although PV and PVC worked fine and after pod started running I see that PVC is bound. However in the pod at mount point I don;t see any index file due to which running curl command provides below output-

403 Forbidden

403 Forbidden


nginx/1.23.1

Could you please make sure mount location has required files for this task?

Hello @k8suser,

I reported this issue to the KodeKloud development team to check.

Happy learning,
Trung.

Hi @k8suser,
Please provide KKE user name.

Hi @k8suser,
Any update on this?

Hi @k8suser,

I got the information from @Tej-Singh-Rana , I’m going to work on the same task and get back.

Thanks,
Trung.

Hi @k8suser,

I just went through the task and was able to finish it.


Steps I went through:

  1. Create PV based on the requirement, you can use the template here Persistent Volumes | Kubernetes and populate fields (name, storage class, size…) as the question.
    Then create the PV
  2. Create PVC based on the requirement, the template can be found here: Persistent Volumes | Kubernetes
    Create the PVC and make sure it is successfully Bound.
  3. Create the pod and mount the PVC as volume, follow the template here: Persistent Volumes | Kubernetes
    Notes: image should be httpd:latest.
    Create the pod and wait for it to run (state should be Running).
  4. Expse the pod with service, use kubectl expose pod pod-name --type=NodePort --name=service-name --port=80 --dry-run=client -o yaml > svc.yaml
    Then modify the YAML and assign the nodePort (port provided in the question).
    Finally, create the svc, and verify the lab result.

Hope you can clear this task, if you have any issues, let me know.

Happy learning,
Trung.

Thank you for your response. I am aware of the steps. I see that PVC is getting bound to the pod. However I am expecting to see an index.html file in the document root which I don;t see and because of that curl command to masternode:nodeport doesnt work. I looked at the mount location inside pod and i don’t see any files in there.

Could you please confirm that mount location on host has necessary files ?

Hi @k8suser ,

I got your point, let me check and get back!

Any update on this task, I am facing the same issue,

PVC and PV are bound and after mounting, I did not see any index.html file,
mount /mnt/sysops,

can you confirm that this file is available in the host, or is there a way from our side to check ,

Thank you.

Which section/level is this task in please?

Just now completed this task. Can you tell what document root path are you using when mounting persistant volume ?