apiVersion: batch/v1
kind: Job
metadata:
  name: mongodb-populator-job
spec:
  template:
    metadata:
      name: mongodb-populator-job
    spec:
      containers:
      - name: mongodb-populator-container
        image: mongodb-populator:1.0.0
        env:
          - name: MONGO_USER
            valueFrom:
              secretKeyRef:
                name: mongodb-secret
                key: username
          - name: MONGO_PASSWORD
            valueFrom:
              secretKeyRef:
                name: mongodb-secret
                key: password
      restartPolicy: Never