apiVersion: apps/v1
kind: Deployment
metadata:
  name: api-serve
  namespace: production
spec:
  selector:
    matchLabels:
      app: api-serve
  replicas: 4
  template:
    metadata:
      labels:
        app: api-serve
    spec:
      containers:
      - name: ori-api
        image: ontola/ori_api:latest-serve
        imagePullPolicy: Always
        volumeMounts:
        - mountPath: /www/data/id
          name: api-pvc
        - mountPath: /www/data/api
          name: api-pvc
          subPath: api
        resources:
          requests:
            memory: 15M
      volumes:
      - name: api-pvc
        persistentVolumeClaim:
          claimName: ori-api-pvc
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
            - matchExpressions:
              - key: cloud.google.com/gke-preemptible
                operator: DoesNotExist