apiVersion: v1
kind: ConfigMap
metadata:
  name: rabbitmq-config
  labels:
    app: rabbitmq
    release: "rabbitmq"
data:
  enabled_plugins: |-
    [rabbitmq_management, rabbitmq_peer_discovery_k8s].
  rabbitmq.conf: |-
    ## Clustering
    cluster_formation.peer_discovery_backend  = rabbit_peer_discovery_k8s
    cluster_formation.k8s.host = kubernetes.default.svc.cluster.local
    cluster_formation.node_cleanup.interval = 10
    cluster_formation.node_cleanup.only_log_warning = true
    cluster_partition_handling = autoheal
    # queue master locator
    queue_master_locator=min-masters
    # enable guest user
    loopback_users.guest = false
    #disk_free_limit.absolute = 50MB
    management.load_definitions = /app/load_definition.json
    ## tls
    listeners.ssl.default = 5671
    ssl_options.cacertfile = /usr/local/etc/tls/tls.crt
    ssl_options.certfile = /usr/local/etc/tls/tls.crt
    ssl_options.keyfile = /usr/local/etc/tls/tls.key
    ssl_options.verify = verify_peer
    ssl_options.fail_if_no_peer_cert = false
