---
apiVersion: apps/v1
kind: StatefulSet
metadata:
  labels:
    deployment: bunsen
  name: bunsen
  namespace: community-prod
spec:
  replicas: 1
  selector:
    matchLabels:
      deployment: bunsen
  serviceName: bunsen
  template:
    metadata:
      labels:
        deployment: bunsen
    spec:
      containers:
      - name: bunsen
        image: gcr.io/puppetlabs.com/api-project-531226060619/bunsen:latest
        imagePullPolicy: Always
        livenessProbe:
          httpGet:
            path: /status
            port: 8080
          initialDelaySeconds: 12
          timeoutSeconds: 2
        ports:
        - containerPort: 8080
          protocol: TCP
        env:
        - name: HUBOT_SLACK_TOKEN
          valueFrom:
            secretKeyRef:
              name: bunsen-secrets
              key: slack-token
        - name: SLACK_SIGNING_SECRET
          valueFrom:
            secretKeyRef:
              name: bunsen-secrets
              key: slack-signing-secret
        - name: GOOGLE_CALENDAR_APIKEY
          valueFrom:
            secretKeyRef:
              name: bunsen-secrets
              key: google-calendar-apikey
        - name: HUBOT_BRAIN_DIR
          value: /home/hubot/state
        volumeMounts:
        - mountPath: /home/hubot/state
          name: bunsen-state
      securityContext:
        runAsUser: 501
        runAsGroup: 501
        fsGroup: 501
      imagePullSecrets:
      - name: regcred
      restartPolicy: Always
      volumes:
      - name: bunsen-state
        persistentVolumeClaim:
          claimName: bunsen-brain
