---
kind: Deployment
apiVersion: apps/v1
metadata:
  name: gnomad-reads
  labels:
    component: gnomad-reads
spec:
  replicas: 1
  selector:
    matchLabels:
      name: gnomad-reads
  template:
    metadata:
      labels:
        name: gnomad-reads
    spec:
      containers:
        - name: web
          image: gnomad-reads-server
          env:
            - name: PROXY_IPS
              valueFrom:
                configMapKeyRef:
                  name: proxy-ips
                  key: ips
          imagePullPolicy: Always
          ports:
            - name: http
              containerPort: 80
          resources:
            requests:
              cpu: '50m'
              memory: '4Gi'
            limits:
              cpu: '100m'
              memory: '4Gi'
          readinessProbe:
            httpGet:
              path: /health/ready
              port: http
            initialDelaySeconds: 3
            periodSeconds: 10
          volumeMounts:
            - name: readviz
              mountPath: /readviz
        - name: app
          image: gnomad-reads-api
          env:
            - name: PORT
              value: '8000'
            - name: TRUST_PROXY
              valueFrom:
                configMapKeyRef:
                  name: proxy-ips
                  key: ips
          ports:
            - name: http
              containerPort: 8000
          resources:
            requests:
              cpu: '50m'
              memory: '128Mi'
            limits:
              cpu: '100m'
              memory: '256Mi'
          readinessProbe:
            httpGet:
              path: /health/ready
              port: http
            initialDelaySeconds: 3
            periodSeconds: 10
          volumeMounts:
            - name: readviz
              mountPath: /readviz
      nodeSelector:
        cloud.google.com/gke-nodepool: 'default-pool'
      volumes:
        - name: readviz
          gcePersistentDisk:
            fsType: ext4
            pdName: readviz-data-2021-02-11
            readOnly: true
