Skip to content

wss and mqtts ports are not properly configured in helm chart #366

@ethcero

Description

@ethcero

In the Statefulset spec, the wss port is a template from .Values.services.wss.port so that, if you plan to use a different port than 8443 in the k8s Service, the configuration gets broken.

For example, if you set .Values.services.wss.port to 7777, The K8s Service will listen in 7777, DOCKER_VERNEMQ_LISTENER__WSS__DEFAULT will be $(MY_POD_IP):7777 but k8s service will be targeting wss port that actually is 8443

These are the offended lines.

  - name: DOCKER_VERNEMQ_LISTENER__WSS__DEFAULT
    value: "$(MY_POD_IP):{{ .Values.service.wss.port }}"

https://github.com/vernemq/docker-vernemq/blob/master/helm/vernemq/templates/statefulset.yaml#L80C1-L87C23

But in the Pod container ports, it is hardcoded

  - containerPort: 8443
    name: wss

https://github.com/vernemq/docker-vernemq/blob/master/helm/vernemq/templates/statefulset.yaml#L57C1-L58C24

The same problem happens for mqtts config.

The fix that works for me is hardcoding the port in the environment variable.

  - name: DOCKER_VERNEMQ_LISTENER__WSS__DEFAULT
    value: "$(MY_POD_IP):8443"
- name: DOCKER_VERNEMQ_LISTENER__SSL__DEFAULT
   value: "$(MY_POD_IP):8883"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions