apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: ww-worker
  name: ww-worker
spec:
  replicas: 4
  selector:
    matchLabels:
      app: ww-worker
  template:
    metadata:
      labels:
        app: ww-worker
    spec:
      containers:
        - name: ww-worker
          image: waterwheel:local
          args:
            - worker
          env:
            - name: WATERWHEEL_AMQP_ADDR
              value: amqp://amqp//
            - name: WATERWHEEL_DB_URL
              value: postgres://postgres:supersecret@db/
            - name: WATERWHEEL_HMAC_SECRET
              value: wwsharedsecret
            - name: WATERWHEEL_NO_AUTHZ
              value: "true"
            - name: WATERWHEEL_SERVER_ADDR
              value: http://ww-api/
            - name: WATERWHEEL_SERVER_BIND
              value: 0.0.0.0:8080
            - name: WATERWHEEL_TASK_ENGINE
              value: kubernetes
            - name: WATERWHEEL_STATSD_SERVER
              value: localhost:8125

        - name: telegraf
          image: telegraf:1.18
          env:
            - name: INFLUX_TOKEN
              value: my-super-secret-influx-token
          ports:
            - containerPort: 8125
              name: statsd
              protocol: UDP
          volumeMounts:
            - name: telegraf-conf
              mountPath: "/etc/telegraf"
              readOnly: true

      restartPolicy: Always
      volumes:
        - name: telegraf-conf
          configMap:
            name: telegraf-conf