apiVersion: apps/v1
kind: Deployment
metadata:
  name: pipeline
  labels:
    app: hug
spec:
  replicas: 1
  selector:
    matchLabels:
      app: hug
  template:
    metadata:
      labels:
        app: hug
    spec:
      containers:
        - name: collector
          image: llana13/tweet-collector
          volumeMounts:
          - name: collector-storage
            mountPath: /data/collector

        - name: mongodb
          image: mongo
          volumeMounts:
            - name: mongo-persistent-volume
              mountPath: /mongo/data
          ports:
            - containerPort: 27017

        - name: etl-job
          image: llana13/etl-job
          volumeMounts:
          - name: etl-storage
            mountPath: /data/etl

        - name: postgresdb
          image: postgres
          envFrom:
            - configMapRef:
                name: postgres-config
          volumeMounts:
            - name: postgres-persistent-volume
              mountPath: /postgres/data
          ports:
            - containerPort: 5432

      imagePullSecrets:
        - name: regcred
      volumes:
        - name: collector-storage
          emptyDir: {}

        - name: mongo-persistent-volume
          persistentVolumeClaim:
            claimName: mongo-claim
        - name: etl-storage
          emptyDir: {}

        - name: postgres-persistent-volume
          persistentVolumeClaim:
            claimName: postgres-claim

      nodeSelector:
        disktype: ssd
