Local storage problem with "Jupyterhub on Kubernetes" docs

I am trying to make my first experiences with Jupyterhub. After a successful start of “The littlest JupyterHub” I want to run Jupyterhub with Kubernetes. I am stuck with the instructions at Kubernetes on a Bare Metal Host with MicroK8s — Zero to JupyterHub with Kubernetes documentation.
In Step “4. Configure Storage.” I get the following error when applying the local storage configuration:

$ microk8s.kubectl apply -f local-storage-dir.yaml
error: error parsing local-storage-dir.yaml: error converting YAML to JSON: yaml: line 9: did not find expected key

I have used exactly the local-storage-dir.yaml example. replaced /path/to/your/storage with /mnt/k8sstorage. Can a formatting problem of the yaml-file after copy&paste be the reason for the error? Or did the format change with the latest microk8s version? I’m not familiar with yaml files, so that I have no clue, what is wrong.

I got the same error on an Ubuntu 21.04 machine and on an Ubuntu 18.04 machine.