apiVersion: v1
kind: ConfigMap
metadata:
  name: rabbitmq-cluster-config
data:
  rabbitmq.conf: |
    loopback_users.guest = false
    ## Clustering
    cluster_formation.peer_discovery_backend = rabbit_peer_discovery_k8s
    cluster_formation.k8s.host = kubernetes.default.svc.cluster.local
    cluster_formation.k8s.address_type = hostname
    cluster_formation.k8s.service_name = ${CLUSTER_NAME}
    cluster_formation.k8s.hostname_suffix = .${CLUSTER_NAME}.${NAMESPACE}.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
  enabled_plugins: |
    [rabbitmq_management,rabbitmq_peer_discovery_k8s].