apiVersion: apps/v1
kind: Deployment
metadata:
  name: github-receiver
spec:
  replicas: 1
  selector:
    matchLabels:
      run: github-receiver
  template:
    metadata:
      labels:
        run: github-receiver
      annotations:
        prometheus.io/scrape: 'true'
        prometheus.io/port: '9990'
    spec:
      containers:
      - name: github-receiver
        image: measurementlab/alertmanager-github-receiver:v0.8
        env:
        - name: GITHUB_AUTH_TOKEN
          valueFrom:
            secretKeyRef:
              name: github-secrets
              key: auth-token
        args: [ "--authtoken=$(GITHUB_AUTH_TOKEN)",
                "--org=m-lab",
                "--repo=dev-tracker",
                "--label=in progress",
                "--enable-inmemory={{GITHUB_RECEIVER_INMEMORY}}" ]
        ports:
        # TODO: receiver and metrics should be available on the same port.
        - containerPort: 9393
          name: receiver
        - containerPort: 9990
          name: metrics
