---
apiVersion: apps/v1beta1
kind: Deployment
metadata:
  name: rabbitmq-exporter
  namespace: monitoring
spec:
  replicas: 1
  template:
    metadata:
      labels:
        k8s-app: rabbitmq-exporter
    spec:
      containers:
      - name: rabbitmq-exporter
        image: kbudde/rabbitmq-exporter
        env:
         - name: PUBLISH_PORT
           value: "9099"
         - name: RABBIT_CAPABILITIES
           value: "bert,no_sort"
         - name: RABBIT_USER
           value: "guest"
         - name: RABBIT_PASSWORD
           value: "guest"
         - name: RABBIT_URL
           value: http://rmq-cluster-balancer.public-service:15672
        imagePullPolicy: IfNotPresent
        ports:
        - containerPort: 9099
---
apiVersion: v1
kind: Service
metadata:
  name: rabbitmq-exporter
  namespace: monitoring
  labels:
    k8s-app: rabbitmq-exporter
spec:
  type: ClusterIP
  clusterIP: None
  selector:
    k8s-app: rabbitmq-exporter
  ports:
  - name: api
    port: 9099
    protocol: TCP
