emqx/emqx-operator

How can setup an ingress controller to access the emqx services inside of kubernetes. configmap isn't working in operator

xtianus79 opened this issue · 3 comments

I am trying to use the operator to accomplish setting up an ingress controller so I can outbound access the mqtt broker and dashboard.

I am using Azure AKS with pretty much the default setup from the EQMX website.
https://docs.emqx.com/en/enterprise/v4.4/getting-started/install-on-k8s.html

Because ingress is setup to natively take on http traffic you have to modify the controller to handle TCP traffic such as MQTT 1883.

This stack has a pretty good overview on how you should do this.
https://stackoverflow.com/questions/61430311/exposing-multiple-tcp-udp-services-using-a-single-loadbalancer-on-k8s

The problem is, I don't really have any documentation on how I can setup and edit the custom resource. Are there specific instructions for this?

When I try to make an edit I am always getting unknown field use validate=false. So I don't think that is the right way I am trying to edit the implied intention of what it is I want to do.

I am trying to use a configmap to map the tcp setting to the container pods. or in anyway map the ports from the ingress controller.

An example of setting up a configmap is here. https://emqx.medium.com/building-k8s-cluster-of-emq-x-mqtt-broker-starting-from-scratch-fe96ad95e563

But I don't really see a way to do that on my container installation from this operator.

When I add this to the kubectl apply I get the following error.

apiVersion: apps.emqx.io/v1beta3
kind: EmqxEnterprise
metadata:
  name: emqx-ee
  labels:
    "foo": "bar"
spec:
  emqxTemplate:
    image: emqx/emqx-ee:4.4.7
    envFrom:
          - configMapRef:
              name: emqx-ee-config

error validating data: ValidationError(EmqxEnterprise.spec.emqxTemplate): unknown field "envFrom" in io.emqx.apps.v1beta3.EmqxEnterprise.spec.emqxTemplate; if you choose to ignore these errors, turn validation off with --validate=false

Admittedly, I am new to kubernetes so if you could help me with the issue it would be greatly appreciated.

I figured it out. I will post the solution soon. 1 thing I had to realize is the operator is releasing the deployment and the services.

Hi, @xtianus79 I'm sorry, we not support .spec.emqxTemplate.envFrom, maybe you can try .spec.emqxTemplate.config, this is a map

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.