apiVersion: smartgateway.infra.watch/v2
kind: SmartGateway
metadata:
  name: '{{ this_smartgateway }}'
  namespace: '{{ meta.namespace }}'
spec:
{% if this_collector.debug_enabled is defined and this_collector.debug_enabled %}
  logLevel: "debug"
{% else %}
  logLevel: "info"
{% endif %}
  handleErrors: true
  size: {{ smartgateway_deployment_size }}
  applications:
  - config: |
      host: 0.0.0.0
      port: 8081
      withTimeStamp: true
    name: prometheus
  bridge:
    amqpUrl: amqp://{{ meta.name }}-interconnect.{{ meta.namespace }}.svc.cluster.local:5673/{{ this_collector.subscription_address }}
  services:
  - name: {{ this_smartgateway }}
    ports:
    - name: prom-http
      port: 8081
      protocol: TCP
      targetPort: 8081
  transports:
  - config: |
      path: /tmp/smartgateway
    handlers:
    - config: ""
      name: {{ this_collector.collector_type }}-metrics
    name: socket
