apiVersion: apps/v1
kind: Deployment
metadata:
  name: bot
spec:
  selector:
    matchLabels:
      app: prestrafe-bot
  template:
    metadata:
      labels:
        app: prestrafe-bot
    spec:
      containers:
        - name: bot
          image: prestrafe-bot
          env:
            - name: BOT_CONFIGDIR
              value: /config
            - name: BOT_GSIADDR
              value: prestrafe-gsi.prestrafe.svc.cluster.local
            - name: BOT_GSIPORT
              value: "8080"
            - name: BOT_METRICPORT
              value: "9080"
            - name: BOT_TWITCHUSERNAME
              value: prestrafebot
            - name: BOT_GLOBALAPITOKEN
              valueFrom:
                secretKeyRef:
                  name: prestrafe-bot
                  key: global-api-token
            - name: BOT_TWITCHAPITOKEN
              valueFrom:
                secretKeyRef:
                  name: prestrafe-bot
                  key: twitch-api-token
          volumeMounts:
            - name: bot-config
              mountPath: /config
              readOnly: true
          ports:
            - name: http-metrics
              containerPort: 9080
              protocol: TCP
      volumes:
        - name: bot-config
          secret:
            secretName: bot
            items:
              - key: config.yml
                path: config.yml
      imagePullSecrets:
        - name: bot-imagepull-secret
