I wanna using traefik auto discovery kubernetes service. The docker-compose.yaml is like this:
version: "3.3"
services:
traefik:
image: "traefik:v2.5"
version: "3.3"
services:
whoami:
image: "traefik/whoami"
container_name: "simple-service"
labels:
- "traefik.enable=true"
- "traefik.http.routers.whoami.rule=Host(`whoami.com`)"
- "traefik.http.routers.whoami.entrypoints=web"
And run docker-compose up -d is working,the whoami.com discoveried.
But when I convert this to kubernetes yaml,I got error with labels, How can I write the labels on kubernetes yaml.
labels:
- "traefik.enable=true"
- "traefik.http.routers.whoami.rule=Host(`whoami.com`)"
- "traefik.http.routers.whoami.entrypoints=web"