apiVersion: apps/v1
kind: Deployment
metadata:
  name: frontier-analytics
  namespace: frontier-analytics
  labels:
    app: frontier-analytics
spec:
  replicas: 1
  selector:
    matchLabels:
      app: frontier-analytics
  template:
    metadata:
      labels:
        app: frontier-analytics
    spec:
      containers:
        - name: web-server
          image:    docker.io/atlasanalyticsservice/frontier:fe55b45faf74642ab1e30c2438335f62cecaf9c7
          command:
            # - "sleep"
            - "python3"
          args:
            # - "3600"
            - "/app/FrontierAnalyticsApp.py"
          imagePullPolicy: Always
          ports:
            - containerPort: 5000
          resources:
            requests:
              memory: "16Gi"
            limits:
              memory: "16Gi"
          env:
            - name: PYTHONUNBUFFERED
              value: "0"
            - name: FrontierAnalyticsApp_SETTINGS
              value: "/etc/frontier/settings.cfg"
            - name: CELERY_URL
              value: "redis://redis-master.frontier-analytics.svc.cluster.local:6379"
          volumeMounts:
            - name: config-volume
              mountPath: "/etc/frontier"
            - name: analytics-config-volume
              mountPath: "/Analytics/FrontierData/Config"
            - name: data-volume
              mountPath: "/app/ParquetDirectory"
            - name: coolr-volume
              mountPath: "/Files"

        - name: celery-server
          image:   docker.io/atlasanalyticsservice/frontier_analytics:411c51ab7687219d961204d34569a4a1c89a8f42
          imagePullPolicy: Always
          resources:
            requests:
              memory: "16Gi"
            limits:
              memory: "16Gi"
          env:
            - name: PYTHONUNBUFFERED
              value: "0"
            - name: CONFIG_FILE
              value: "/Analytics/FrontierData/Config/configuration.txt"
            - name: CELERY_URL
              value: "redis://redis-master.frontier-analytics.svc.cluster.local:6379"
          volumeMounts:
            - name: analytics-config-volume
              mountPath: "/Analytics/FrontierData/Config"
            - name: data-volume
              mountPath: "/app/ParquetDirectory"
            - name: coolr-volume
              mountPath: "/Files"
      volumes:
        - name: config-volume
          configMap:
            name: flask-config
        - name: analytics-config-volume
          secret:
            secretName: analytics-config
            items:
              - key: config
                path: configuration.txt
        - name: coolr-volume
          emptyDir: {}
        - name: data-volume
      nodeSelector:
        nologs: "false"
