---
apiVersion: v1
kind: Service
metadata:
  name: spy-listener
  labels:
    app: spy-listener
spec:
  clusterIP: None
  selector:
    app: spy-listener
  ports:
    - port: 8082
      name: prometheus
      protocol: TCP
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: spy-listener
spec:
  selector:
    matchLabels:
      app: spy-listener
  serviceName: spy-listener
  replicas: 1
  template:
    metadata:
      labels:
        app: spy-listener
    spec:
      restartPolicy: Always
      terminationGracePeriodSeconds: 0
      containers:
        - name: spy-listener
          image: spy-relay-image
          env:
            - name: LOG_LEVEL
              value: warn
          command:
            - npm
            - run
            - --prefix
            - /app
            - tilt_listener
          tty: true
          readinessProbe:
            tcpSocket:
              port: 2000
            periodSeconds: 1
            failureThreshold: 300
          ports:
            - containerPort: 4201
              name: rest
              protocol: TCP
            - containerPort: 8082
              name: prometheus
              protocol: TCP
