<p>I have a cluster on Azure (AKS). I am have a <code>orientdb</code> service </p>

<pre><code>apiVersion: v1
kind: Service
metadata:
  name: orientdb
  labels:
    app: orientdb
    role: backend
spec:
  selector:
    app: orientdb
  ports:
  - protocol: TCP
    port: 2424
    name: binary
  - protocol: TCP
    port: 2480
    name: http
</code></pre>

<p>which I want to expose to the outside, such that an app from the internet can send TCP traffic directly to this service. </p>

<p>(In order to connect to orientdb you need to connect over TCP to port 2424)</p>

<p>I am not good in networking so this is my understanding, which might as well be wrong.
I tried the following:  </p>

<ol>
<li>Setting up an Ingress

<ul>
<li>did not work, because ingress handles http, but is not well suited for tcp. </li>
</ul></li>
<li>I tried to set ExternalIP field in the service config in NodePort definition

<ul>
<li>did not work.</li>
</ul></li>
</ol>

<p>So my problem is the following:<br>
<strong>I cannot send tcp traffic to the service.</strong> Http traffic works fine.</p>

<p>I would really appreciate if someone would show me how to expose my service such that I can sen TCP traffic directly to my oriented service.</p>

<p>Thanks in advance.</p>

GrimSmiler
<p>You can use both the service of type Loadbalancer ( I assume AKS supports that) , or you can just use the node port.</p>

<pre><code>kubectl expose deployment hello-world --type=LoadBalancer --name=my-service

kubectl get services my-service
</code></pre>

<p>The output is similar to this:</p>

<pre><code>NAME         TYPE        CLUSTER-IP     EXTERNAL-IP      PORT(S)    AGE
my-service   ClusterIP   10.3.245.137   104.198.205.71   8080/TCP   54s
</code></pre>

<p>Reference <a href="https://kubernetes.io/docs/tutorials/stateless-application/expose-external-ip-address/" rel="nofollow noreferrer">here</a></p>

<p>kubectl expose usage:</p>

<pre><code>Usage
$ expose (-f FILENAME | TYPE NAME) [--port=port] [--protocol=TCP|UDP|SCTP] [--target-port=number-or-name] [--name=name] [--external-ip=external-ip-of-service] [--type=type]
</code></pre>

<p>You can make use of <code>--port= 2424 --target-port= 2424</code>  options for correct ports in the <code>kubectl expose</code> command above</p>
