{{ if .Values.attr_modeling.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
  name: attr-modeling
spec:
  replicas: 1
  selector:
    matchLabels:
      app: attr-modeling
  template:
    metadata:
      name: attr-modeling
      labels:
        app: attr-modeling
    spec:
      terminationGracePeriodSeconds: 1
      containers:
      - name: attr-modeling
        image: docker.io/goalprofit/attr-modeling:{{.Values.attr_modeling.version}}
        imagePullPolicy: Always
        env:
        - name: SERVICE_LOGIN
          valueFrom:
            secretKeyRef:
              name: secret-service
              key: username
              optional: false
        - name: SERVICE_PASSWORD
          valueFrom:
            secretKeyRef:
              name: secret-service
              key: password
              optional: false
      imagePullSecrets:
      - name: regcred
      {{ include "app.affinity" . | nindent 6}}
---
apiVersion: v1
kind: Service
metadata:
  name: attr-modeling
spec:
  type: ClusterIP
  selector:
    app: attr-modeling
  ports:
    - name: http
      protocol: TCP
      port: 8080
      targetPort: 8080
{{ end }}