apiVersion: apps/v1
kind: Deployment
metadata:
  name: gene-to-reactions-production
spec:
  selector:
    matchLabels:
      app: gene-to-reactions
      env: production
  replicas: 1
  template:
    metadata:
      labels:
        app: gene-to-reactions
        env: production
    spec:
      containers:
      - name: web
        image: gcr.io/dd-decaf-cfbf6/gene-to-reactions:master
        imagePullPolicy: Always
        ports:
        - containerPort: 8000
        env:
        - name: ENVIRONMENT
          value: production
        - name: ICE_HOST
          value: ice
        - name: ICE_PORT
          value: "443"
        - name: SETTINGS_OBJECT
          value: gene_to_reactions.settings.Default
        - name: prometheus_multiproc_dir
          value: /prometheus-client
        - name: ICE_USER
          valueFrom:
            secretKeyRef:
              name: gene-to-reactions-production
              key: ICE_USER
        - name: ICE_PASSWORD
          valueFrom:
            secretKeyRef:
              name: gene-to-reactions-production
              key: ICE_PASSWORD
        - name: SENTRY_DSN
          valueFrom:
            secretKeyRef:
              name: gene-to-reactions-production
              key: SENTRY_DSN
        volumeMounts:
        - mountPath: /prometheus-client
          name: prometheus-client
        command: ["gunicorn", "-c", "gunicorn.py", "gene_to_reactions.app:app"]
        resources:
          requests:
            cpu: "0"
      - name: redis
        image: redis:latest
        ports:
        - containerPort: 6379
        resources:
          requests:
            cpu: "0"
      volumes:
      - name: prometheus-client
        emptyDir: {}
