Error: error parsing mongodb-deployment.yaml: error converting YAML to JSON: yaml: line 27: did not find expected key

I am doing a lab about kubernetes Can you help me?

I have create the YAML file, but when I am trying to deploy it a shell shows me this error:

> error: error parsing mongodb-deployment.yaml: error converting YAML to JSON: yaml: line 27: did not find expected key

This is the yaml file for MongoDB for Kubernetes

apiVersion: apps/v1
kind: Deployment
metadata:
 name: mongodb-deployment
 labels:
   app: mongodb
spec:
  replicas: 1
  selector:
   matchLabels:
     app: mongodb
   template:
     metadata:
       labels:
         app: mongodb
     spec:
       containers:
       - name: mongodb
         image: mongo
         ports:
         - containerPort: 27017
         env:
         - name: MONGO_INITDB_ROOT_USERNAME
           valueFROM:
             secretKeyRef:
                name: mongodb-secret
                key: mongo-root-username
         - name: MONGO_INITDB_ROOT_PASSWORD
           valueFROM:
             secretKeyRef: 
                name: mongodb-secret
                key: mongo-root-password

This is not related to mongodb other than you happen to be deploying it. This is better asked in a kubernetes community.

The issue you have is kubernetes related. Likely you have not defined the secret that you are referencing.