apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: label-bot
    environment: prod
    service: label-bot
  name: label-bot-worker
  namespace: label-bot-prod
spec:
  replicas: 5
  selector:
    matchLabels:
      app: label-bot
      environment: prod
      service: label-bot
  template:
    metadata:
      labels:
        app: label-bot
        environment: prod
        service: label-bot
    spec:
      containers:
      - command:
        - python3
        - -m
        - label_microservice.worker
        - subscribe_from_env
        env:
        - name: PORT
          value: "80"
        - name: ISSUE_EMBEDDING_SERVICE
          value: http://issue-embedding-server
        - name: PROJECT
          value: issue-label-bot-dev
        - name: ISSUE_EVENT_TOPIC
          value: event_queue
        - name: ISSUE_EVENT_SUBSCRIPTION
          value: label_bot_prod
        - name: GITHUB_APP_ID
          value: "27079"
        - name: GITHUB_APP_PEM_KEY
          value: /var/secrets/github/issue-label-bot-github-app.private-key.pem
        - name: MODEL_CONFIG
          value: /var/config/model_config.yaml
        image: gcr.io/issue-label-bot-dev/bot-worker:f0bf8d1-dirty@sha256:2faaf9d94c9beba082f184790770d1d08cb06a94b1ad4a8e797033f0bccb4cf7
        name: app
        resources:
          requests:
            cpu: "4"
            memory: 4Gi
        volumeMounts:
        - mountPath: /var/config
          name: config
          readOnly: true
        - mountPath: /var/secrets/github
          name: github-app
      restartPolicy: Always
      serviceAccountName: default-editor
      volumes:
      - configMap:
          name: label-bot-model-config-ffft4d6cch
        name: config
      - name: github-app
        secret:
          secretName: github-app
