<p>I'm running a pretty basic cluster in AKS on Azure.<br>
I need to expose a TCP server on port 6879.<br>
I have added the TCP port to the Loadbalancer spec:</p>

<pre><code>kind: Service
metadata:
  name: ingress-nginx
  selfLink: /api/v1/namespaces/ingress-nginx/services/ingress-nginx
spec:
  externalTrafficPolicy: Local
  healthCheckNodePort: 32557
  ports:
  - name: http
    nodePort: 30731
    port: 80
    protocol: TCP
    targetPort: http
  - name: https
    nodePort: 31187
    port: 443
    protocol: TCP
    targetPort: https
  - name: tcp
    nodePort: 31197
    port: 6879
    protocol: TCP
    targetPort: 6879
  selector:
    app.kubernetes.io/name: ingress-nginx
    app.kubernetes.io/part-of: ingress-nginx
  sessionAffinity: None
  type: LoadBalancer
</code></pre>

<p>Would this configuration expose port 6879 or 31197 on the public IP?<br>
I'm thinking that I need to add a rule to the Ingress to route that traffic to the TCP server host. But my reading suggests that the Kubernetes Ingress doesn't support routing TCP traffic. What part of the docs am I missing.</p>

hally9k
<p>TCP\UDP <a href="https://kubernetes.github.io/ingress-nginx/user-guide/exposing-tcp-udp-services/" rel="nofollow noreferrer">is supported</a> on nginx ingress</p>

<pre><code>apiVersion: v1
kind: ConfigMap
metadata:
  name: tcp-services
  namespace: ingress-nginx
data:
  6879: "default/example-go:8080"
  31197: "namespace/service:port"
</code></pre>

<p>The above example shows how to expose the service example-go running in the namespace default in the port 8080 using the port 9000 (copy paste from the linked article).</p>
