apiVersion: apps/v1
kind: Deployment
metadata:
  name: mongodb-deployment
spec:
  replicas: 1
  selector:
    matchLabels:
      app: mongodb
  template:
    metadata:
      labels:
        app: mongodb
    spec:
      containers:
      - name: mongodb
        image: mongo:4.2.8
        ports:
        - containerPort: 27017
        resources: {}
        env:
          - name: MONGO_INITDB_ROOT_USERNAME
            value: mongodbuser
          - name: MONGO_INITDB_ROOT_PASSWORD
            value: mongodbpwd