{{ if .Values.optimizationmd.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
  name: optimizationmd
spec:
  replicas: 1
  selector:
    matchLabels:
      app: optimizationmd
  template:
    metadata:
      name: optimizationmd
      labels:
        app: optimizationmd
    spec:
      containers:
      - name: optimizationmd
        image: goalprofit/optimization:markdown
        imagePullPolicy: Always
        ports:
          - containerPort: 5000
        readinessProbe:
          tcpSocket:
            port: 5000
          initialDelaySeconds: 5
          periodSeconds: 10
        livenessProbe:
          tcpSocket:
            port: 5000
          initialDelaySeconds: 10
          periodSeconds: 20
        env:
        - name: OMP_NUM_THREADS
          value: "64"
        - name: PORT
          value: "5000"
      imagePullSecrets:
      - name: regcred
      {{ include "app.affinity" . | nindent 6}}
---
apiVersion: v1
kind: Service
metadata:
  name: optimizationmd
spec:
  type: ClusterIP
  selector:
    app: optimizationmd
  ports:
    - protocol: TCP
      port: 5000
      targetPort: 5000
{{ end }}