apiVersion: apps/v1
kind: Deployment
metadata:
  name: crdb-changefeed-publisher
  namespace: default
  labels:
    app: crdb-changefeed-publisher
spec:
  replicas: 1
  selector:
    matchLabels:
      app: crdb-changefeed-publisher
  template:
    metadata:
      labels:
        app: crdb-changefeed-publisher
    spec:
      containers:
        - name: crdb-changefeed-publisher
          image: duccos/crdb-changefeed-publisher:latest
          imagePullPolicy: Always
          args:
            - --table=ticks
            - --queue=rabbitmq
            - --cursor-store=cockroachdb
            - --cursor-frequency=10s
          env:
            - name: RUST_LOG
              value: "trace"
            - name: DATABASE_URL
              value: "postgres://root@kwont-cockroachdb-public.default:26257/kwont?sslmode=disable"
            - name: AMQP_ADDR
              value: amqp://user:pass@rabbitmq.default:5672
            - name: AMQP_QUEUE
              value: ticks-row-changes
          resources:
            limits:
              cpu: 100m
              memory: 100M
          volumeMounts:
            - name: "cacerts"
              mountPath: "/etc/ssl/cacerts"
              readOnly: true
      volumes:
        - name: "cacerts"
          hostPath:
            path: "/etc/ssl/certs"
