title: Unable to run MongoDB pod using Minikube in VirtualBox
body: <p>I'm new for this k8s thing here and trying to replicate this tutorial from <a href="https://www.youtube.com/watch?v=EQNO_kM96Mo" rel="nofollow noreferrer">this video</a>, but using virtualbox.
  Unfortunately, I'm stuck with the CrashLoopBackOff error.</p>
  <pre><code>Events:
    Type     Reason     Age                    From               Message
    ----     ------     ----                   ----               -------
    Normal   Scheduled  5m47s                  default-scheduler  Successfully assigned default/mongodb-deployment-68b8d596f4-w48ng to minikube
    Normal   Pulled     4m51s                  kubelet            Successfully pulled image &quot;mongo&quot; in 55.31859611s
    Normal   Pulled     4m47s                  kubelet            Successfully pulled image &quot;mongo&quot; in 3.06101969s
    Normal   Pulled     4m28s                  kubelet            Successfully pulled image &quot;mongo&quot; in 3.196732139s
    Normal   Created    3m59s (x4 over 4m51s)  kubelet            Created container mongodb
    Normal   Started    3m59s (x4 over 4m51s)  kubelet            Started container mongodb
    Normal   Pulled     3m59s                  kubelet            Successfully pulled image &quot;mongo&quot; in 3.317634667s
    Normal   Pulling    3m16s (x5 over 5m46s)  kubelet            Pulling image &quot;mongo&quot;
    Normal   Pulled     3m13s                  kubelet            Successfully pulled image &quot;mongo&quot; in 3.141471321s
    Warning  BackOff    40s (x19 over 4m46s)   kubelet            Back-off restarting failed container
  </code></pre>
  <p><strong>Can someone help me to solve this? Is there something wrong or missing with my yaml files config?</strong></p>
  <p>This is the deployment file</p>
  <pre><code>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: 27027
          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
  </code></pre>
  <p>And here is the secret file</p>
  <pre><code>apiVersion: v1
  kind: Secret
  metadata:
      name: mongodb-secret
  type: Opaque
  data: 
      mongo-root-username: {encrypted username}
      mongo-root-password: {encrypted password}
  </code></pre>
  <p>In case needed, <a href="https://i.stack.imgur.com/S88YH.png" rel="nofollow noreferrer">kubectl describe pod</a></p>