why taefik could not proxy to the kubernetes pod service

2/5/2020

I want to using taefik(v2.0) to proxy service into kubernetes(v1.15.2) cluster pod,this is my taefik config:

apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  name: fat-api-route
spec:
  entryPoints:
    - web
  routes:
    - match: Host(`k8s-fat-api.example.com`) 
      kind: Rule
      services:
        - name: soa-red-envelope-service
          port: 11005

and I login taefik management dashboard and find this error:

the service "dabai-fat-fat-api-route-789d6ee4fcf7288b0f7f@kubernetescrd" does not exist

I am sure the soa-red-envelope-service pod start success and listening on port 11005.When I change the backend service to eureka and eureka port and it works fine. It says the config is ok, the pod is ok, now where is the problem could be?

-- Dolphin
kubernetes
traefik-ingress

1 Answer

2/5/2020

You either don't have a kubernetes service with name soa-red-envelope-service pointing to the backend pods or you have the service but not in the namespace where you have created the ingressroute.

-- Arghya Sadhu
Source: StackOverflow