KubeMQ Configuration

KubeMQ server can be configured via environment variables set during container loading.

Table of Content

General

  • With Token
  • With License Key

The KubeMQ general configuration can be set as below:

...
        - env:
            - name: KUBEMQ_TOKEN # Sets the KubeMQ token key
              value: <YOUR-KUBEMQ-TOKEN>
            - name: CLUSTER_ROUTES 
              value: 'kubemq-cluster:5228'
            - name: CLUSTER_PORT
              value: '5228'
            - name: CLUSTER_ENABLE 
              value: 'true'
            - name: GRPC_PORT
              value: '50000'
            - name: REST_PORT
              value: '9090'
            - name: KUBEMQ_PORT # Sets KubeMQ service API port for health, metrics and traces
              value: '8080'
            - name: KUBEMQ_HOST # Sets the docker container’s explicit host name
              value: 'kuebmq'  
            - name: KUBEMQ_LOG_LEVEL # Sets KubeMQ stdout log level where:  1 - Debug 2 - Info 3 - Warn 4 - Error 5 - Fatal
              value: '2'  
            - name: KUBEMQ_PROXY # Sets Proxy server address url access (in case license validation failure) 
              value: '2'  

           image: 'kubemq/kubemq:latest'
....        
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

Cluster

The KubeMQ cluster configuration can be set as below:

...
        - env:
            - name: KUBEMQ_TOKEN
              value: <YOUR-KUBEMQ-TOKEN>
            - name: CLUSTER_ROUTES #Sets the address of other KubeMQ nodes forming a cluster 
              value: 'kubemq-cluster:5228'
            - name: CLUSTER_PORT # Sets the KubeMQ cluster listening port 
              value: '5228'
            - name: CLUSTER_ENABLE # Sets the KubeMQ clustering mode
              value: 'true'
            - name: GRPC_PORT
              value: '50000'
            - name: REST_PORT
              value: '9090'
            - name: KUBEMQ_PORT
              value: '8080'
            - name: CLUSTER_IS_SEED # Sets the current KubeMQ node as the seed (when not running as the stateful set 
              value: 'true'  
           image: 'kubemq/kubemq:latest'
....        
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

Persistence

  • General
  • Queues

The KubeMQ general persistence configuration can be set as below:

...
        - env:
            - name: KUBEMQ_TOKEN
              value: <YOUR-KUBEMQ-TOKEN>
            - name: CLUSTER_ROUTES
              value: 'kubemq-cluster:5228'
            - name: CLUSTER_PORT
              value: '5228'
            - name: CLUSTER_ENABLE
              value: 'true'
            - name: GRPC_PORT
              value: '50000'
            - name: REST_PORT
              value: '9090'
            - name: KUBEMQ_PORT
              value: '8080'
            - name: STORE_DIR # Sets KubeMQ persistence folder 
              value: '/store'  
            - name: STORE_CLEAN  # true=KubeMQ will clean all the files in the store on boot       
              value: 'true'  
            - name: STORE_MAX_QUEUES # Sets KubeMQ limit of the number of persistent channels/queues, 0 = unlimited    
              value: '0'   
            - name: STORE_MAX_SUBSCRIBERS # Sets KubeMQ limit of the number of subscribers per channel/queue, 0 = unlimited 
              value: '0'   
            - name: STORE_MAX_MESSAGES  # Sets KubeMQ limit of the number of stored messages per channel/queue, 0 = unlimited       
              value: '0'  
            - name: STORE_MAX_SIZE  # Sets KubeMQ max size in bytes per channel/queue, 0 = unlimited        
              value: '0'  
            - name: STORE_MAX_RETENTION # Sets KubeMQ store time in minutes for each message per channel/queue, 0 = infinite    
              value: '1440'   
            - name: STORE_MAX_INACTIVITY_PURGE # Sets KubeMQ delete channel/queue due to inactivity time in minutes, 0 = no purging  
              value: '1440'   
           image: 'kubemq/kubemq:latest'
....        
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34

gRPC Interface

The KubeMQ gRPC interface configuration can be set as below:

  • General
  • Security
...
        - env:
            - name: KUBEMQ_TOKEN
              value: <YOUR-KUBEMQ-TOKEN>
            - name: CLUSTER_ROUTES
              value: 'kubemq-cluster:5228'
            - name: CLUSTER_PORT
              value: '5228'
            - name: CLUSTER_ENABLE
              value: 'true'
            - name: GRPC_PORT
              value: '50000'
            - name: REST_PORT
              value: '9090'
            - name: KUBEMQ_PORT
              value: '8080'
            - name: STORE_DIR
              value: '/store'
            - name: GRPC_ENABLE  # Enable/Disable the gRPC interface     
              value: 'true'  
            - name: GRPC_PORT # Sets Docker exposed port  
              value: '50000'   
            - name: GRPC_SUB_BUFF_SIZE #  Sets the subscribe message / requests buffer size to use on the server  
              value: '100'   
            - name: GRPC_BODY_LIMIT  # Sets request body limit in bytes (must be > 0)      
              value: '4194304'  
           image: 'kubemq/kubemq:latest'
....        
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28

REST Interface

KubeMQ REST interface configuration can be set as below:

  • General
  • Security
  • CORS
...
        - env:
            - name: KUBEMQ_TOKEN
              value: <YOUR-KUBEMQ-TOKEN>
            - name: CLUSTER_ROUTES
              value: 'kubemq-cluster:5228'
            - name: CLUSTER_PORT
              value: '5228'
            - name: CLUSTER_ENABLE
              value: 'true'
            - name: GRPC_PORT
              value: '50000'
            - name: REST_PORT
              value: '9090'
            - name: KUBEMQ_PORT
              value: '8080'
            - name: STORE_DIR
              value: '/store'
            - name: REST_ENABLE  # Enable/Disable REST interface     
              value: 'true'  
            - name: REST_PORT # Sets Docker exposed port  
              value: '9090'   
            - name: REST_SUB_BUFF_SIZE # Sets subscribe message / requests buffer size to use on server  
              value: '100'   
            - name: REST_BODY_LIMIT  #Sets request body limit, (i.e. 2M), limit can be specified as 4x or 4xB, where x is one of the multiple from K, M, G, T or P    
              value: ''  
           image: 'kubemq/kubemq:latest'
....        
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28

Logging

KubeMQ supports stdout logging, in addition to docker sending logs to local files and to the Logly external service.

  • File
  • Loggly
...
        - env:
            - name: KUBEMQ_TOKEN
              value: <YOUR-KUBEMQ-TOKEN>
            - name: CLUSTER_ROUTES
              value: 'kubemq-cluster:5228'
            - name: CLUSTER_PORT
              value: '5228'
            - name: CLUSTER_ENABLE
              value: 'true'
            - name: GRPC_PORT
              value: '50000'
            - name: REST_PORT
              value: '9090'
            - name: KUBEMQ_PORT
              value: '8080'
            - name: STORE_DIR
              value: '/store'
            - name: LOG_FILE_ENABLE  # Enable/Disable saving logs to file    
              value: 'true'  
            - name: LOG_FILE_PATH # Sets file write path, default: ./log
              value: './log'   
           image: 'kubemq/kubemq:latest'
....        
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

Observability

KubeMQ exports both metrics and tracing observability information by embedding the OpenCensus library.

The following backend systems are supported:

Backend Stats Tracing
Prometheus Yes No
Honeycomb No Yes
AWS X-Ray No Yes
Datadog Yes Yes
Jeager No Yes
StackDriver Yes Yes
Zimpkin No Yes
  • Prometheus
  • Jeager
  • Zipkin
  • Honeycomb
  • StackDriver
  • AWS X-Ray
  • Datadog

First, add the following annotations to pod metadata:

...
spec:
  selector:
    matchLabels:
      app: kubemq-cluster
  replicas: 3
  serviceName: kubemq-cluster
  template:
    metadata:
      labels:
        app: kubemq-cluster
      annotations: # add here prometheus annotations
        prometheus.io/scrape: 'true'
        prometheus.io/port: '9102'
        prometheus.io/path: '/metrics'       
    spec:
      containers:

...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

Second, add the following environment variables to KubeMQ's stateful set yaml definition

...
        - env:
            - name: KUBEMQ_TOKEN
              value: <YOUR-KUBEMQ-TOKEN>
            - name: CLUSTER_ROUTES
              value: 'kubemq-cluster:5228'
            - name: CLUSTER_PORT
              value: '5228'
            - name: CLUSTER_ENABLE
              value: 'true'
            - name: GRPC_PORT
              value: '50000'
            - name: REST_PORT
              value: '9090'
            - name: KUBEMQ_PORT
              value: '8080'
            - name: STORE_DIR
              value: '/store'
            - name: METRICS_DISABLE  # Sets KubeMQ and disables observability metrics exporting  
              value: 'false'  
            - name: METRICS_TRACING_SAMPLE # Sets KubeMQ tracing sample probability as a percentage, i.e 0.1 =10%  
              value: '0.1'   
            - name: METRICS_PROMETHEUS_ENABLE  # Enable/Disable Prometheus exporting  
              value: 'true'  
            - name: METRICS_PROMETHEUS_PATH # Sets Prometheus scraping end point (on the KubeMQ service API address)  
              value: '/metrics'   
           image: 'kubemq/kubemq:latest'
....        
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
Last Updated: 8/18/2019, 4:29:24 PM