apiVersion: apps/v1
kind: Deployment
metadata:
  name: bananobot
  namespace: graham-banano
spec:
  strategy:
    type: Recreate
  replicas: 1
  selector:
    matchLabels:
      app: bananobot
  template:
    metadata:
      labels:
        app: bananobot
    spec:
      containers:
      - name: bananobot
        image: replaceme
        ports:
        - containerPort: 11337
          name: api
        command: ["/bin/bash", "-c"]
        args: ["cp /config/config.yaml .; python bot.py -p . -s \"wen tahiti\" -u http://pippin-banano.pippin:11338"]
        env:
          - name: BANANO
            value: "1"
          - name: REDIS_HOST
            value: redis-0.redis
          - name: REDIS_DB
            value: "8"
          - name: POSTGRES_HOST
            value: postgres.postgres
          - name: POSTGRES_DB
            valueFrom:
              secretKeyRef:
                name: bananobot
                key: postgres_db
          - name: POSTGRES_USER
            valueFrom:
              secretKeyRef:
                name: bananobot
                key: postgres_user
          - name: POSTGRES_PASSWORD
            valueFrom:
              secretKeyRef:
                name: bananobot
                key: postgres_password
          - name: BOT_TOKEN
            valueFrom:
              secretKeyRef:
                name: bananobot
                key: bot_token
          - name: WALLET_ID
            valueFrom:
              secretKeyRef:
                name: bananobot
                key: wallet_id
        volumeMounts:
        - name: conf
          mountPath: /config
          readOnly: true
      volumes:
      - name: conf
        configMap:
          name: bananobot
          defaultMode: 0755
