apiVersion: v1
kind: ConfigMap
metadata:
  name: rabbitmq-conf
data:
  enabled_plugins: |
    [rabbitmq_management,rabbitmq_peer_discovery_k8s].
  rabbitmq.conf: |
    cluster_formation.peer_discovery_backend  = rabbit_peer_discovery_k8s
    cluster_formation.k8s.host = kubernetes.{{ .Release.Namespace }}.svc.cluster.local
    cluster_formation.k8s.address_type = hostname
    cluster_formation.node_cleanup.interval = 10
    cluster_formation.node_cleanup.only_log_warning = true
    cluster_partition_handling = autoheal
    queue_master_locator=min-masters
    loopback_users.guest = false
    cluster_formation.randomized_startup_delay_range.min = 0
    cluster_formation.randomized_startup_delay_range.max = 2
    # 必须设置service_name，否则Pod无法正常启动，这里设置后可以不设置statefulset下env中的K8S_SERVICE_NAME变量
    cluster_formation.k8s.service_name = {{ include "anan.service.headless.name" . }}
    # 必须设置hostname_suffix，否则节点不能成为集群
    cluster_formation.k8s.hostname_suffix = .{{ include "anan.service.headless.name" . }}.{{ .Release.Namespace }}.svc.cluster.local

    # 流程控制触发的内存阀值,默认0.4
    vm_memory_high_watermark.relative=0.6
    #vm_memory_high_watermark.absolute = {{ .Values.resources.limits.memory }}B

    #当内存的使用达到了50%后,队列开始将消息分页到磁盘
    vm_memory_high_watermark_paging_ratio = 0.5

    # 硬盘上限
    disk_free_limit.absolute = {{ .Values.persistence.size }}B
