cluster-with-k8s.conf.example 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. ##--------------------------------------------------------------------
  2. ## Cluster in service discovery via Kubernetes API server mode
  3. ##
  4. ## Configs to instruct how individual nodes can discover each other
  5. ##--------------------------------------------------------------------
  6. ## Note: This is an example of how to configure this feature
  7. ## you should copy and paste the below data into the emqx.conf for working
  8. cluster {
  9. ## Human-friendly name of the EMQX cluster.
  10. name = emqxcl
  11. ## Service discovery method for the cluster nodes
  12. discovery_strategy = k8s
  13. ## List of core nodes that the replicant will connect to
  14. core_nodes = ['emqx1@192.168.0.1', 'emqx2@192.168.0.2']
  15. ## Remove disconnected nodes from the cluster after this interval
  16. autoclean = 5m
  17. ## If true, the node will try to heal network partitions automatically
  18. autoheal = true
  19. k8s {
  20. ## Kubernetes API endpoint URL
  21. apiserver = "http://10.110.111.204:8080"
  22. ## EMQX broker service name
  23. service_name = emqx
  24. ## Address type used for connecting to the discovered nodes
  25. ## Type: ip | dns | hostname
  26. address_type = ip
  27. ## Kubernetes namespace
  28. namespace = default
  29. ## Node name suffix
  30. suffix = "pod.local"
  31. }
  32. }