MountVolume.SetUp failed for volume "shared-files"

In System Administrator Kubernetes level 1 task 14 (Resolve Volume Mounts Issue in Kubernetes). I was trying put index.php using hostPath volume. Not sure why it’s throwing the below error:
Warning FailedMount 1s (x5 over 8s) kubelet MountVolume.SetUp failed for volume “shared-files” : open /home/thor/index.php: no such file or directory

  • hostPath:
    path: /home/thor/index.php
    type: FileOrCreate
    name: shared-files

I think you need to use subPath