<pre><code>apiVersion: apps/v1
kind: deployment
metadata:
  name: mongodb-deployment
  labels:
    app: mongodb
spec:
  replicas: 1
  selector:
    matchLebels:
       app: mongodb
  template:
    metadata:
      lebels:
        app: mongodb
    spec:
     containers:
     - name: mongodb
       image: mongo
       ports:
       - containerPort: 27017
       env:
       - name: MONGO_INITDB_ROOT_USERNAE
         valueFrom:
           secretKeyref:
             name: mongodb-secret
             key: mongo-root-username
       - name: MONGO_INITDB_ROOT_PASSWORD
         valueFrom:
          secretKeyref:
            name: mongodb-secret
            key: mongo-root-password
</code></pre>
<p><a href="https://i.stack.imgur.com/0WWqj.jpg" rel="nofollow noreferrer">enter image description here</a></p>

Idehen Scofield
<ul>
<li>There are multiple typos in the yaml you have provided in the question.</li>
<li>I have corrected them as following , use following yaml and check</li>
</ul>
<pre><code>apiVersion: apps/v1
kind: Deployment    #corrected typo deployment to Deployment
metadata:
  name: mongodb-deployment
  labels:
    app: mongodb
spec:
  replicas: 1
  selector:
    matchLabels:            #corrected typo matchLebels to matchLabels
       app: mongodb
  template:
    metadata:
      labels:               #corrected typo lebels to labels
        app: mongodb
    spec:
     containers:
     - name: mongodb
       image: mongo
       ports:
       - containerPort: 27017
       env:
       - name: MONGO_INITDB_ROOT_USERNAE
         valueFrom:
           secretKeyRef:                  #corrected typo secretKeyref to secretKeyRef
             name: mongodb-secret
             key: mongo-root-username
       - name: MONGO_INITDB_ROOT_PASSWORD
         valueFrom:
          secretKeyRef:                  #corrected typo secretKeyref to secretKeyRef
            name: mongodb-secret
            key: mongo-root-password
</code></pre>
