Issue with exposing rabbitmq port 5671

Hi,

I’m trying to expose rabbitmq port 5671 as TCP (not HTTP/HTTPS) using this tutorial:
MicroK8s - Add on: Ingress (I use -channel=1.21/stable)

My configuration:

  1. Service rabbitmq:

    kubectl describe service rabbitmq
    Name: rabbitmq
    Namespace: xyz
    Labels: app=rabbitmq
    Annotations:
    Selector: app=rabbitmq
    Type: ClusterIP
    IP Family Policy: SingleStack
    IP Families: IPv4
    IP: 10.152.183.112
    IPs: 10.152.183.112
    Port: rabbitmq 5672/TCP
    TargetPort: 5672/TCP
    Endpoints: 10.1.174.249:5672
    Port: rabbitmq-management 15672/TCP
    TargetPort: 15672/TCP
    Endpoints: 10.1.174.249:15672
    Port: rabbitmq-amqp 5671/TCP
    TargetPort: 5671/TCP
    Endpoints: 10.1.174.249:5671
    Session Affinity: None
    Events:

I can connect to 5671 using:
kubectl port-forward -n xyz service/rabbitmq 5671:5671

  1. I’ve added this to nginx-ingress-microk8s-controller daemonset:
    ports:

    - containerPort: 5671
      hostPort: 5671
      name: rabbitmq5671
      protocol: TCP
    
  2. I’ve added this to nginx-ingress-tcp-microk8s-conf:

    data:
    “5671”: xyz/rabbitmq:5671

I can’t connect to <cluster_public_ip>:5671, any idea what I did wrong?

Regards
Adam

Can you try not enclosing the configmap port with quotes?
Ex.
5671: "xyz/rabbitmq:5671"

No, when I edit nginx-ingress-tcp-microk8s-conf configmap, change “5671”: to 5671: nothing change:

EDITOR=nano kubectl edit -n ingress configmaps nginx-ingress-tcp-microk8s-conf          
Edit cancelled, no changes made.

Can you post your Ingress resource?
Thanks.

kubectl get -n ingress ingress
No resources found in ingress namespace.