---
# deploy-gopherbot.yaml - For deploying a Gopherbot Robot to your Kubernetes
# cluster manually with `kubectl`. The "better" way is to use helm 3 with the
# chart in `helm-gopherbot`.
#
# Manual steps:
# 1) Verify GOPHER_ENCRYPTION_KEY, GOPHER_DEPLOY_KEY and GOPHER_PROTOCOL
#    are all defined (and uncommented) in your .env
# 2) Verify the image you want in "image: ..." below
# 3) kubectl create secret generic robot-secrets --from-env-file=.env
# 4) kubectl apply -f deploy-gopherbot.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: gopherbot
  name: gopherbot
spec:
  replicas: 1
  selector:
    matchLabels:
      app: gopherbot
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: gopherbot
    spec:
      securityContext:
        runAsNonRoot: true
      containers:
      - image: quay.io/lnxjedi/gopherbot:latest
        name: gopherbot
        env:
          - name: GOPHER_ENCRYPTION_KEY
            valueFrom:
              secretKeyRef:
                name: robot-secrets
                key: GOPHER_ENCRYPTION_KEY
          - name: GOPHER_CUSTOM_REPOSITORY
            valueFrom:
              secretKeyRef:
                name: robot-secrets
                key: GOPHER_CUSTOM_REPOSITORY
          - name: GOPHER_DEPLOY_KEY
            valueFrom:
              secretKeyRef:
                name: robot-secrets
                key: GOPHER_DEPLOY_KEY
          - name: GOPHER_PROTOCOL
            valueFrom:
              secretKeyRef:
                name: robot-secrets
                key: GOPHER_PROTOCOL
