---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: rg
  namespace: unicorn-socket-stats
spec:
  selector:
    matchLabels:
      app: rg
  replicas: 1
  template:
    metadata:
      labels:
        app: rg
      annotations:
        prometheus.io/scrape: 'true'
        prometheus.io/port: '8000'
    spec:
      containers:
        - name: raingutter
          image: zendesk/raingutter
          env:
            - name: RG_USE_SOCKET_STATS  # default
              value: 'true'
            - name: RG_STATSD_NAMESPACE
              value: 'raingutter.socket-status.dev.'
            - name: UNICORN_WORKERS
              value: '16'
            - name: RG_STATSD_HOST
              value: '127.0.0.1'
            - name: RG_STATSD_PORT
              value: '8125'
            - name: POD_NAME
              value: 'myapp-app-server'
            - name: POD_NAMESPACE
              value: 'unicorn-socket-stats'
            - name: PROJECT
              value: 'my-project'
            - name: RG_PROMETHEUS_ENABLED
              value: 'true'
            - name: RG_FREQUENCY
              value: '5000'
          securityContext:
            runAsNonRoot: true
            readOnlyRootFilesystem: true
          imagePullPolicy: IfNotPresent
        - name: mock-dogstatsd
          image: zendesk/mock-dogstatsd
          imagePullPolicy: IfNotPresent
      terminationGracePeriodSeconds: 1
      restartPolicy: Always
      dnsPolicy: ClusterFirst
