<p>I have a k8 deployment (using minikube) for ActiveMQ-Artemis. In this I'm exposing ports for broker(61616) and console(8161) both. Pointing the ports to service. It is working fine.
and also I configured an Ingress Controller for the console.</p>
<p>Service.yaml</p>
<pre><code>kind: Service
metadata:
  name: artemis-service
spec:
  type: ClusterIP
  ports:
  - port: 8161
    name: http-console
    protocol: TCP
    targetPort: 8161
  - port: 61616
    name: netty-connector
    protocol: TCP
    targetPort: 61616
  selector:
    app: artemis
</code></pre>
<p>Ingress.yaml</p>
<pre><code>kind: Ingress
metadata:
  name: broker-ingress
  labels:
    name: broker-ingress
spec:
  ingressClassName: nginx
  rules:
  - host: artemis.broker.com
    http:
      paths:
      - pathType: Prefix
        path: &quot;/&quot;
        backend:
          service:
            name: artemis-service
            port: 
              number: 8161
</code></pre>
<p>I can access the activemq console when I hit <code>http://artemis.broker.com</code>
And now I want to expose the TCP port (61616) using NGINX Controller through which I can publish/consume messages to ActiveMQ queue using a TCP URL.</p>
<p>I found TransportServer in Nginx Controller to expose TCP.
<a href="https://docs.nginx.com/nginx-ingress-controller/configuration/transportserver-resource/" rel="nofollow noreferrer">https://docs.nginx.com/nginx-ingress-controller/configuration/transportserver-resource/</a>
Can someone help me how to configure this TransportServer.</p>
<p>PS - I'm new to kubernetes.</p>

<p><strong>Nginx Ingress</strong> does not support <strong>TCP</strong> or <strong>UDP</strong> services</p>
<p>You can follow this guide the setup &amp; expose the TCP service : <a href="https://kubernetes.github.io/ingress-nginx/user-guide/exposing-tcp-udp-services/" rel="nofollow noreferrer">https://kubernetes.github.io/ingress-nginx/user-guide/exposing-tcp-udp-services/</a></p>
<p>Here is my <strong>YAML</strong> config file for <strong>RabbitMQ</strong> i have used</p>
<pre><code>---
apiVersion: v1
kind: ConfigMap
metadata:
  name: tcp-services
  namespace: ingress-nginx
data:
  61616: &quot;default/artemis-service:61616&quot;
</code></pre>
<p>Make <strong>tcp-service</strong> config into <strong>ingress-nginx</strong> namespace or where your controller is installed.</p>
<p>Add the Port to <strong>Nginx</strong> <strong>service</strong></p>
<pre><code>    - name: proxied-tcp-61616
      port: 61616
      targetPort: 61616
      protocol: TCP
</code></pre>
<p>You will be able to connect your Broker with <code>NginxIP:61616</code> now from outside.</p>
<p><strong>Note if you are very new to K8s</strong>:</p>
<p>If you are running your application inside of the same Kubernetes cluster you don't need to expose the Port, you can use the <strong>service name</strong> for internal communication &amp; connection.</p>
<p><strong>artemis-service:61616</strong> rest will K8s will manage DNS resolution etc.</p>
