apiVersion: apps/v1
kind: Deployment
metadata:
  name: metanetx-production
spec:
  selector:
    matchLabels:
      app: metanetx
      env: production
  replicas: 1
  template:
    metadata:
      labels:
        app: metanetx
        env: production
    spec:
      containers:
      - name: web
        image: gcr.io/dd-decaf-cfbf6/metanetx:master
        imagePullPolicy: Always
        ports:
        - containerPort: 8000
        env:
        - name: ENVIRONMENT
          value: production
        - name: SECRET_KEY
          valueFrom:
            secretKeyRef:
              name: metanetx
              key: SECRET_KEY
        - name: SCRIPT_NAME
          value: /metanetx
        - name: FLASK_APP
          value: src/metanetx/wsgi.py
        - name: ALLOWED_ORIGINS
          value: "*"
        - name: SENTRY_DSN
          valueFrom:
            secretKeyRef:
              name: metanetx
              key: SENTRY_DSN
        readinessProbe:
          httpGet:
            path: /metanetx/healthz
            port: 8000
          initialDelaySeconds: 5
        resources:
          requests:
            cpu: "10m"
          limits:
            cpu: "2000m"
