Specs
- traefik
2.5.3
- traefik helm chart version
10.3.4
- on Google Cloud GKE
1.20.9-gke.701
Problem
I'm unable to get Traefik to detect a Kubernetes Service
. I look at the dashboard to see if at least a route is added, even if it's red (malfunctioning).
Here's the deployment file:
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
run: nginx
name: nginx-deploy-main
namespace: traefik
spec:
replicas: 1
selector:
matchLabels:
run: nginx-main
template:
metadata:
labels:
run: nginx-main
spec:
containers:
- image: nginx
name: nginx
Here's the service:
apiVersion: v1
kind: Service
metadata:
labels:
run: nginx
name: nginx-deploy-main
namespace: traefik
spec:
ports:
- port: 80
protocol: TCP
targetPort: 80
selector:
run: nginx-main
Here's the ingressroute to expose that service:
---
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: http
namespace: traefik
spec:
entryPoints:
- web
routes:
- match: Host(`does.not.matter.com`)
kind: Rule
services:
- name: nginx-deploy-main
So far so good. However, when I use the same IngressRoute above but add kind: TraefikService
such that it looks like this:
services:
- name: nginx-deploy-main
kind: TraefikService
... I see it appear on the Traefik dashboard:
I understand that kind: Service
is the default.
I don't know what else to try. Thanks for your help in advance!
Note:
- followed this video except that I put traefik and nginx in the
traefik
namespace. My goal is to put the non-traefik services in their own namespace, but that's another topic.