apiVersion: apps/v1
kind: Deployment
metadata:
  name: alameda-datahub
  namespace: federatorai
  labels:
    app: alameda
    component: alameda-datahub
  annotations:
    description: Defines how to deploy the application alameda-datahub
    template.alpha.openshift.io/wait-for-ready: 'true'
spec:
  replicas: 1
  strategy:
    type: Recreate
  selector:
    matchLabels:
      component: alameda-datahub
  template:
    metadata:
      name: alameda-datahub
      labels:
        app: alameda
        component: alameda-datahub
    spec:
      containers:
      - name: alameda-datahub
        image: quay.io/prophetstor/alameda-datahub-ubi:v0.3.8
        imagePullPolicy: IfNotPresent
        resources:
          requests:
            cpu: 50m
            memory: 100Mi
        env:
        - name: ALAMEDA_DATAHUB_INFLUXDB_ADDRESS
          value: https://alameda-influxdb.federatorai.svc:8086
        - name: ALAMEDA_DATAHUB_INFLUXDB_USERNAME
          value: admin
        - name: ALAMEDA_DATAHUB_INFLUXDB_PASSWORD
          value: adminpass
        - name: ALAMEDA_DATAHUB_PROMETHEUS_URL
          value: https://prometheus-k8s.openshift-monitoring.svc:9091
        readinessProbe:
          exec:
            command:
            - /usr/local/bin/datahub
            - probe
            - --type=readiness
          initialDelaySeconds: 5
          periodSeconds: 5
        livenessProbe:
          exec:
            command:
            - /usr/local/bin/datahub
            - probe
            - --type=liveness
          initialDelaySeconds: 5
          periodSeconds: 5
      volumes:
      - name:  alameda-datahub-data-storage
      - name:  alameda-datahub-log-storage
      serviceAccount: alameda-datahub
      serviceAccountName: alameda-datahub
