emqx/emqx-operator

Is operator not designed for emqx broker v5 ?

mariusstaicu opened this issue · 3 comments

Describe the bug
When I try to deploy a v5.0.6 emqx image the resulting statefulset does not properly create emqx cluster.
It is like the operator v1.2.5 is not designed to operate emqx v5 broker images. So my question: is this a bug or it is just not designed for v5 yet ?

To Reproduce
deploy something like:

apiVersion: apps.emqx.io/v1beta3
kind: EmqxBroker
metadata:
  name: emqx
  namespace: emqx-operator-system
spec:
  replicas: 3
  emqxTemplate:
    image: emqx/emqx:5.0.6
    serviceTemplate:
      metadata:
        name: emqx
        labels:
          app: emqx
      spec:
        selector:
          app: emqx
        type: ClusterIP
        ports:
          - name: mqtt
            port: 1883
            protocol: TCP
            targetPort: 1883
          - name: mqttssl
            port: 8883
            protocol: TCP
            targetPort: 8883
          - name: dashboard
            port: 18083
            protocol: TCP
            targetPort: 18083
    config:
      prometheus.enable: "true"
    modules:
      - name: emqx_mod_trace
        enable: true
  persistent:
    resources:
      requests:
        storage: 2Gi
    accessModes:
      - ReadWriteOnce

After the broker starts I have some warnings in logs and autocluster is not working. Every broker node has a cluster size of 1 -> they don't form a cluster.

emqx [warning] unknown_env_vars: ["EMQX_CLUSTER__DISCOVERY","EMQX_CLUSTER__DNS__APP",                                                                               
emqx                    "EMQX_CLUSTER__DNS__TYPE",                                                                                                                  
emqx                    "EMQX_DASHBOARD__DEFAULT_USER__LOGIN",                                                                                                      
emqx                    "EMQX_DASHBOARD__DEFAULT_USER__PASSWORD",                                                                                                   
emqx                    "EMQX_PLUGINS__ETC_DIR","EMQX_PLUGINS__LOADED_FILE"]                                                                                        
emqx prometheus.enable = EMQX_PROMETHEUS__ENABLE = true                                                                                                             
emqx rpc.port_discovery = EMQX_RPC__PORT_DISCOVERY = manual                                                                                                         
emqx log.file_handlers.default.enable = EMQX_LOG__FILE_HANDLERS__DEFAULT__ENABLE = false                                                                            
emqx log.console_handler.enable = EMQX_LOG__CONSOLE_HANDLER__ENABLE = true                                                                                          
emqx cluster.dns.name = EMQX_CLUSTER__DNS__NAME = emqx-headless.emqx-operator-system.svc.cluster.local                                                              
emqx node.name = EMQX_NODE__NAME = emqx@10.42.5.247                                                                                                                 
emqx 2022-08-28T10:28:07.426244+00:00 [warning] unknown_env_vars: ["EMQX_CLUSTER__DISCOVERY","EMQX_CLUSTER__DNS__APP", "EMQX_CLUSTER__DNS__TYPE", "EMQX_DASHBOARD__D
emqx Listener ssl:default on :8883 started.                                                                                                                         
emqx Listener tcp:default on :1883 started.                                                                                                                         
emqx Listener ws:default on :8083 started.                                                                                                                          
emqx Listener wss:default on :8084 started.                                                                                                                         
emqx Listener http:dashboard on :18083 started.                                                                                                                     
emqx EMQX 5.0.6 is running now! 

Expected behavior
The broker starts and the number of nodes in the cluster via emqx dashboard is 3.

Anything else we need to know?:
It's like the operator v1.2.5 is not configuring proper env variables for broker v5. That's why logs show some warnings.

Environment details::

  • Kubernetes version: 1.21.10
  • Cloud-provider/provisioner: self-hosted
  • emqx-operator version: 1.2.5
  • Install method: helm

Hi,@mariusstaicu I'm sorry, the apps.emqx.io/v1beta3 is not designed to operate EMQX v5 broker, We plan to release the new APIVersion Kind tomorrowIt: apps.emqx.io/v2alpha1, Kind: EMQX, and it is specifically designed for EMQX v5

thanks!