---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: jeeves
spec:
  replicas: 1
  selector:
    matchLabels:
      app: jeeves
  template:
    metadata:
      labels:
        app: jeeves
    spec:
      serviceAccount: jeeves
      volumes:
        - name: jeeves-github
          secret:
            secretName: jeeves-github
      containers:
        - name: jeeves
          image: containersol/jeeves
          imagePullPolicy: Always
          ports:
          - containerPort: 8000
          volumeMounts:
          - name: jeeves-github
            readOnly: true
            mountPath: "/secrets"
          env:
          - name: APPLICATION_ID
            valueFrom:
              secretKeyRef:
                name: jeeves-github
                key: jeeves-application-id
          - name: SERVER_HOST
            value: 0.0.0.0
          - name: SECRET_PATH
            value: "/secrets"
          - name: GITHUB_INSTALLATION_ID
            valueFrom:
              secretKeyRef:
                name: jeeves-github
                key: jeeves-installation-id
          - name: SLACK_CHANNEL_ID
            valueFrom:
              secretKeyRef:
                name: slackauth
                key: SLACK_CHANNEL_ID
          - name: SLACK_SIGNING_SECRET
            valueFrom:
              secretKeyRef:
                name: slackauth
                key: SLACK_SIGNING_SECRET
          - name: SLACK_AUTHENTICATION_TOKEN
            valueFrom:
              secretKeyRef:
                name: slackauth
                key: SLACK_AUTHENTICATION_TOKEN
          - name: NAMESPACE
            valueFrom:
              fieldRef:
                fieldPath: metadata.namespace

