---
kind: Deployment
apiVersion: apps/v1
metadata:
  name: gnomad-reads
  labels:
    service: gnomad
spec:
  replicas: 1
  selector:
    matchLabels:
      name: gnomad-reads
  template:
    metadata:
      labels:
        name: gnomad-reads
        service: gnomad
    spec:
      containers:
      - name: web
        image: mirror.gcr.io/library/nginx:alpine
        imagePullPolicy: Always
        ports:
        - name: http
          containerPort: 80
        readinessProbe:
          httpGet:
            path: /health/ready
            port: http
          initialDelaySeconds: 5
          periodSeconds: 30
        volumeMounts:
        - name: config
          mountPath: /etc/nginx/conf.d
        - name: readviz-gnomad-r2-1
          mountPath: /readviz/gnomad_r2_1
        - name: readviz-exac
          mountPath: /readviz/exac
      - name: app
        image: gcr.io/exac-gnomad/gnomad-reads
        env:
        - name: PORT
          value: "8000"
        - name: TRUST_PROXY
          value: "3"
        - name: DATASETS
          value: gnomad_r2_1,exac
        - name: GNOMAD_R2_1_EXOMES_READS_DIRECTORY
          value: /readviz/gnomad_r2_1/combined_bams_exomes/combined_bams
        - name: GNOMAD_R2_1_EXOMES_PUBLIC_PATH
          value: /reads/gnomad_r2_1/exomes
        - name: GNOMAD_R2_1_GENOMES_READS_DIRECTORY
          value: /readviz/gnomad_r2_1/combined_bams_genomes/combined_bams
        - name: GNOMAD_R2_1_GENOMES_PUBLIC_PATH
          value: /reads/gnomad_r2_1/genomes
        - name: EXAC_EXOMES_READS_DIRECTORY
          value: /readviz/exac/combined_bams_v3
        - name: EXAC_EXOMES_PUBLIC_PATH
          value: /reads/exac/exomes
        ports:
        - name: http
          containerPort: 8000
        readinessProbe:
          httpGet:
            path: /health/ready
            port: http
          initialDelaySeconds: 5
          periodSeconds: 30
        volumeMounts:
        - name: readviz-gnomad-r2-1
          mountPath: /readviz/gnomad_r2_1
        - name: readviz-exac
          mountPath: /readviz/exac
      nodeSelector:
        cloud.google.com/gke-nodepool: "default-pool"
      volumes:
      - name: config
        configMap:
          name: nginx-config
          items:
          - key: nginx.conf
            path: default.conf
      - name: readviz-gnomad-r2-1
        gcePersistentDisk:
          fsType: ext4
          pdName: readviz-gnomad-r2-1-disk1
          readOnly: true
      - name: readviz-exac
        gcePersistentDisk:
          fsType: ext4
          pdName: readviz-exac-disk1
          readOnly: true
