<p>I am trying to create a tcp service like this in kubernetes cluster followed by official <a href="https://docs.traefik.io/routing/services/" rel="nofollow noreferrer">docs</a>:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: traefik.containo.us/v1alpha1
kind: TraefikService
metadata:
  name: app-mysql
spec:
    tcp:
      services:
        my-service:
           loadBalancer:
             servers:
               - address: '&lt;private-ip-server-1&gt;:&lt;private-port-server-1&gt;'
               - address: '&lt;private-ip-server-2&gt;:&lt;private-port-server-2&gt;'
</code></pre>
<p>and I only see the traefik service in lens, in the traefik dashboard found nothing:</p>
<p><a href="https://i.stack.imgur.com/jfwKE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jfwKE.png" alt="image" /></a></p>
<p>What should I do to create a TCP Service in traefik 2.2.1?</p>

<p>Assuming you'd like to talk to TCP services running in Kubernetes. For TCP you don't need really need a <code>TraefikService</code>, you can just use an <code>IngressRouteTCP</code> resource.</p>
<p>You can see in the <a href="https://docs.traefik.io/routing/providers/kubernetes-crd/#kind-ingressroutetcp" rel="nofollow noreferrer">docs</a> that the <code>IngressRouteTCP</code> can talk directly to a K8s service.</p>
<p><a href="https://i.stack.imgur.com/EC0jq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EC0jq.png" alt="image1" /></a></p>
<p>Similarly to the <a href="https://docs.traefik.io/reference/dynamic-configuration/kubernetes-crd/#resources" rel="nofollow noreferrer">example</a> you can have something like this:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: traefik.containo.us/v1alpha1
kind: IngressRouteUDP
metadata:
  name: my-ingress-udp-route
  namespace: default
spec:
  entryPoints:
    - myentrypoint
  routes:
    - match: HostSNI(`mysql.example.com`)
      services:
        - name: app-mysql 👈 K8s Service
          port: 3306
</code></pre>
<p>Notes:</p>
<ul>
<li><p><code>TraefikService</code> can be used for in regular <code>IngressRoute</code> resources, and not supported in TCP/UDP case today)</p>
</li>
<li><p>Not sure how you plan to load balance a MySQL service though, as this typically happens at the application level or you need a particular proxy that handles your reads/writes and data consistency)</p>
</li>
</ul>
<p>✌️</p>
