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: |
      hostURL: https://elasticsearch-es-http.{{ meta.namespace }}.svc.cluster.local:9200
      useTLS: true
      tlsClientCert: /config/certs/tls.crt
      tlsClientKey: /config/certs/tls.key
      tlsCaCert: /config/certs/ca.crt
      tlsServerName: 'elasticsearch-es-http.{{ meta.namespace }}.svc.cluster.local'
      user: '{{ elastic_user | default('elastic') }}'
      password: '{{ elastic_pass | default('') }}'
      useBasicAuth: true
    name: elasticsearch
  bridge:
    amqpUrl: amqp://{{ meta.name }}-interconnect.{{ meta.namespace }}.svc.cluster.local:5673/{{ this_collector.subscription_address }}
  transports:
  - config: |
      path: /tmp/smartgateway
    handlers:
    - config: ""
      name: events
      strictSource: {{ this_collector.collector_type }}
    name: socket
