# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.
#
{{- if .Values.features.rabbitmqMonitor.enabled }}

apiVersion: apps/v1
kind: Deployment
metadata:
  name: rabbitmq-mock-client
spec:
  replicas: 1
  strategy:
    type: Recreate
  selector:
    matchLabels:
      app: mock-client
  template:
    metadata:
      labels:
        app: mock-client
    spec:
      containers:
        - env:
            - name: URI
              value: "amqp://guest:guest@demo-rabbitmq:5672/%2f"
            - name: QUEUE
              value: basic-get
            - name: ROUTING_KEY
              value: basic-get
            - name: VARIABLE_RATE
              value: "1:1,0:30"
            - name: POLLING
              value: "true"
            - name: POLLING_INTERVAL
              value: "5000"
            - name: AUTOACK
              value: "5000"
            - name: SERVERS_STARTUP_TIMEOUT
              value: "60"
            - name: METRICS_PROMETHEUS
              value: "true"
          image: pivotalrabbitmq/perf-test:2.15.0-ubuntu
          imagePullPolicy: IfNotPresent
          name: install
          ports:
            - containerPort: 8080
              name: http
              protocol: TCP
      restartPolicy: Always
      securityContext: { }

{{- end }}
