apiVersion: apps/v1
kind: Deployment
metadata:
  name: templatebot
  labels:
    app: templatebot
spec:
  replicas: 1
  selector:
    matchLabels:
      app: templatebot
  template:
    metadata:
      labels:
        app: templatebot
    spec:
      containers:
        - name: templatebot-app
          image: lsstsqre/templatebot
          imagePullPolicy: Always
          ports:
            - containerPort: 8080
              name: templatebot-app
          env:
            - name: SLACK_TOKEN
              valueFrom:
                secretKeyRef:
                  name: templatebot
                  key: SLACK_TOKEN
            - name: TEMPLATEBOT_GITHUB_TOKEN
              valueFrom:
                secretKeyRef:
                  name: templatebot
                  key: TEMPLATEBOT_GITHUB_TOKEN
            - name: TEMPLATEBOT_GITHUB_USER
              valueFrom:
                secretKeyRef:
                  name: templatebot
                  key: TEMPLATEBOT_GITHUB_USER
            - name: TEMPLATEBOT_CACHE_PATH
              value: "/etc/templatebot-repo-cache"
            - name: TEMPLATEBOT_CERT_CACHE
              value: "/etc/templatebot-cert-cache"
          envFrom:
            - configMapRef:
                name: templatebot
          volumeMounts:
            - name: "repo-cache"
              mountPath: "/etc/templatebot-repo-cache"
            - name: "cert-cache"
              mountPath: "/etc/templatebot-cert-cache"
      volumes:
        - name: "repo-cache"
          emptyDir: {}
        - name: "cert-cache"
          emptyDir: {}
