apiVersion: apps/v1
kind: Deployment
metadata:
  name: mongodb-deploy
  labels:
    name: mongodb-deploy
    app: tutorial-app
spec:
  replicas: 1
  selector:
    matchLabels:
      name: mongodb-pod
      app: tutorial-app
    
  template:
    metadata:
      name: mongodb-pod
      labels:
        name: mongodb-pod
        app: tutorial-app
    spec:
      containers:
        - name: mongo
          image: mongo:latest
          ports:
            - containerPort: 27017
          env:
            - name: MONGO_INITDB_ROOT_USERNAME
              value: "root"
            - name: MONGO_INITDB_ROOT_PASSWORD
              value: "password"