apiVersion: apps/v1
kind: Deployment
metadata:
  name: mongodb-deployment
spec:
  selector:
    matchLabels:
      app: mongodb
  template:
    metadata:
      labels:
        app: mongodb
    spec:
      containers:
      - name: mongodb
        image: mongo:4.2.8
        volumeMounts:
          - mountPath: /data/db
            name: mongo-data
        ports:
        - containerPort: 27017        
        envFrom:
          - secretRef:
              name: mongodb-secret
      volumes:
        - name: mongo-data
          hostPath:
              path: /volumes/mongodb
      # Iniciando deployment/pods num node específico
      nodeSelector:
        database: mongodb

