cluster-with-k8s.conf.example 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. ## If true, the node will try to heal network partitions automatically
  16. autoheal = true
  17. k8s {
  18. ## Kubernetes API endpoint URL
  19. apiserver = "https://kubernetes.default.svc:443"
  20. ## EMQX broker service name
  21. service_name = emqx
  22. ## Address type used for connecting to the discovered nodes
  23. ## Type: ip | dns | hostname
  24. address_type = ip
  25. ## Kubernetes namespace
  26. namespace = default
  27. ## Node name suffix
  28. suffix = "pod.local"
  29. }
  30. }