apiVersion: apps/v1
kind: Deployment
metadata:
  name: alameda-ai
  namespace: federatorai
  labels:
    app: alameda
    component: alameda-ai
  annotations:
    description: Defines how to deploy the application alameda-operator
spec:
  replicas: 1
  strategy:
    type: Recreate
  selector:
    matchLabels:
      component: alameda-ai
  template:
    metadata:
      name: alameda-ai
      labels:
        app: alameda
        component: alameda-ai
    spec:
      containers:
      - name: alameda-ai-engine
        ports:
            - containerPort: 9091
              name: ai-metrics
              protocol: TCP
        image: quay.io/prophetstor/alameda-ai:v0.3.8
        imagePullPolicy: IfNotPresent
        resources:
          requests:
            cpu: 2000m
            memory: 250Mi
        env:
        - name: OPERATOR_ADDRESS
          value: "alameda-operator.federatorai.svc:50050"
        - name: DATAHUB_ADDRESS
          value: "alameda-datahub.federatorai.svc:50050"
        readinessProbe:
          exec:
            command:
            - /probe.sh
            - --type=readiness
          initialDelaySeconds: 5
          periodSeconds: 5
        livenessProbe:
          exec:
            command:
            - /probe.sh
            - --type=liveness
          initialDelaySeconds: 5
          periodSeconds: 5
      volumes:
        - name: alameda-ai-data-storage
        - name: alameda-ai-log-storage
      serviceAccount: alameda-ai
      serviceAccountName: alameda-ai
