# Boardr worker deployment
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: boardr-worker
spec:
  replicas: 0
  selector:
    matchLabels: &boardr-worker-labels
      app.kubernetes.io/component: worker
      app.kubernetes.io/part-of: boardr
      app.kubernetes.io/instance: boardr-vagrant
  template:
    metadata:
      labels:
        app.kubernetes.io/name: boardr
        app.kubernetes.io/version: "0.1.0"
        <<: *boardr-worker-labels
        boardr.alphahydrae.io/cluster: main
    spec:
      containers:
        - name: boardr
          image: "localhost:32000/boardr-worker:0.1.0"
          imagePullPolicy: Always
          env:
            - name: BOARDR_DATABASE_URL
              value: ecto://boardr:changeme@boardr-db/boardr
            - name: BOARDR_LOG_LEVEL
              value: debug
            - name: BOARDR_RELEASE_NODE_ADDRESS
              valueFrom:
                fieldRef:
                  fieldPath: status.podIP
            - name: BOARDR_K8S_NODE_BASENAME
              value: boardr
            - name: BOARDR_K8S_SELECTOR
              value: boardr.alphahydrae.io/cluster=main
            - name: BOARDR_RELEASE_NODE_NAME
              value: boardr
            - name: BOARDR_SECRET
              valueFrom:
                secretKeyRef:
                  name: boardr-secret
                  key: secret
            - name: RELEASE_COOKIE
              valueFrom:
                secretKeyRef:
                  name: boardr-release-cookie
                  key: cookie