<p>I wanna using traefik auto discovery kubernetes service.
The docker-compose.yaml is like this:</p>
<pre><code>version: &quot;3.3&quot;

services:

  traefik:
    image: &quot;traefik:v2.5&quot;
   version: &quot;3.3&quot;

services:

  whoami:
    image: &quot;traefik/whoami&quot;
    container_name: &quot;simple-service&quot;
    labels:
      - &quot;traefik.enable=true&quot;
      - &quot;traefik.http.routers.whoami.rule=Host(`whoami.com`)&quot;
      - &quot;traefik.http.routers.whoami.entrypoints=web&quot;
</code></pre>
<p>And run docker-compose up -d is working,the whoami.com discoveried.</p>
<p>But when I convert this to kubernetes yaml,I got error with labels,
How can I write the labels on kubernetes yaml.</p>
<pre><code>labels:
  - &quot;traefik.enable=true&quot;
  - &quot;traefik.http.routers.whoami.rule=Host(`whoami.com`)&quot; 
  -  &quot;traefik.http.routers.whoami.entrypoints=web&quot;
</code></pre>

Michael
<p>Check out <a href="https://kompose.io/" rel="nofollow noreferrer">Kompose</a>.</p>
<p>It will help generate some stuff for you. But specifically with Traefik you'll have to move to either the Ingress system or Traefik's custom IngressRoute system. See <a href="https://doc.traefik.io/traefik/routing/providers/kubernetes-ingress/" rel="nofollow noreferrer">this doc</a> for the former and the latter is linked in the sidebar there.</p>
