Reputation: 5
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"
Upvotes: 0
Views: 580
Reputation: 54267
Check out Kompose.
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 this doc for the former and the latter is linked in the sidebar there.
Upvotes: 1