apiVersion: apps/v1
kind: Deployment
metadata:
  name: bd-dev-api
spec:
  selector:
    matchLabels:
      app: bd-dev-api
  replicas: 1
  template:
    metadata:
      name: bl-dev-api-app
      labels:
        app: bd-dev-api
    spec:
      affinity:
        podAntiAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
          - weight: 100
            podAffinityTerm:
              labelSelector:
                matchExpressions:
                - key: app
                  operator: In
                  values:
                  - bd-dev-api
              topologyKey: kubernetes.io/hostname
      volumes:
        - name: nfs-volume-exports
          nfs: 
            server: 51.68.207.197
            path: /cluster/exports
      containers:
        - name: bd-dev-api
          image: hub.osrsbotdetector.com/bot-detector/bd-api:latest
          imagePullPolicy: Always
          ports:
          - containerPort: 5000
          resources:
            requests:
              cpu: "1000m"
              memory: "500Mi"
            limits:
              cpu: "2000m"
              memory: "3000Mi"
          volumeMounts:
            - name: nfs-volume-exports
              mountPath: /root/exports
          livenessProbe:
            httpGet:
              path: /
              port: 5000
            failureThreshold: 3
            periodSeconds: 30
      imagePullSecrets:
      - name: regcred