{{ if .Values.classifier.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
  name: classifier
spec:
  replicas: 1
  selector:
    matchLabels:
      app: classifier
  template:
    metadata:
      name: classifier
      labels:
        app: classifier
    spec:
      containers:
      - name: classifier
        image: goalprofit/classifier
        imagePullPolicy: Always
        ports:
          - containerPort: 5000
        volumeMounts:
        - mountPath: /app/models
          name: models
      imagePullSecrets:
      - name: regcred
      volumes:
      - name: models
        hostPath:
          path: /data/{{.Values.customer}}/models
          type: Directory
      {{ include "app.affinity" . | nindent 6}}
---
apiVersion: v1
kind: Service
metadata:
  name: classifier
spec:
  type: ClusterIP
  selector:
    app: classifier
  ports:
    - name: http
      protocol: TCP
      port: 5000
      targetPort: 5000

{{ end }}