<p>I have an Kubernetes Cluster with a working Ingress config for one REST API. Now I want to add a port forward to my mqtt adapter to this config, but I have problems finding a way to add an TCP rule to the config. The Kubernetes docs only show a HTTP example. <a href="https://kubernetes.io/docs/concepts/services-networking/ingress/" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/services-networking/ingress/</a></p>
<p>I'm pretty new to Kubernetes and I have problems adapting other configs, because whatever I find looks totally different from that what I found in the Kubernetes Docs.</p>
<p>I have used a regular nginx webserver with letsencrypt to secure TCP connections. I hope this works with the ingress controller, too.</p>
<p>My goal is to send messages via MQTT with TLS to my cluster.
Does someone have the right docs for this or knows how to add the config?</p>
<p>My config looks like this:</p>
<pre><code>apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: ratings-web-ingress
  annotations:
    kubernetes.io/ingress.class: nginx
    cert-manager.io/cluster-issuer: letsencrypt
spec:
  tls:
    - hosts: 
      - example.com
      secretName: ratings-web-cert
  
  rules:
  - host: example.com
    http:
      paths:
      - backend:
          serviceName: test-api
          servicePort: 8080
        path: /
</code></pre>

<p>the Ingress system only handles HTTP traffic in general. A few Ingress Controllers support custom extensions for non-HTTP packet handling but it's different for each. <a href="https://kubernetes.github.io/ingress-nginx/user-guide/exposing-tcp-udp-services/" rel="noreferrer">https://kubernetes.github.io/ingress-nginx/user-guide/exposing-tcp-udp-services/</a> shows how to do this specifically for ingress-nginx, as shown there you configure it entirely out of band via some ConfigMaps, not via the Ingress object(s).</p>
<p>What you probably actually want is a LoadBalancer type Service object instead.</p>
