IngressRoutes and Services (with Kubernetes)

  1. when in configure an Ingress with a service, my service (in traefik dashboard) is a kubernetes service ?

example:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: "ingress-compatible-v1-et-v2"
  namespace: "test-traefik-v2"  
spec:
  rules:
    - host: "test-traefik-v2-ingress"
      http:
        paths:
          - path: "/integration-rest"
            pathType: "Prefix"
            backend:
              service:
                name: "test-traefik-v2-service"
                port:
                  name: "svc-app-port"

result in traefik dashboard: test-traefik-v2-test-traefik-v2-service-svc-app-port@kubernetes

  1. But why when i configure an IngressRoute with a service (kind: Service), my service (in traefik dashboard) is a kubernetescrd type and not a kubernetes type ?
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  name: ingress-ingressroute-sticky
  namespace: "test-traefik-v2"
spec:
  routes:
    - match: Host(`test-traefik-v2-ingressroute-sticky`) && PathPrefix(`/integration-rest`)
      kind: Rule
      services:
        - kind: Service
          name: test-traefik-v2-service-sticky
          namespace: test-traefik-v2
          port: svc-app-port

result in traefik dashboard: test-traefik-v2-ingress-ingressroute-sticky-9b348c2a4f860d85f41b@kubernetescrd

CRD in KubernetesCRD means "Custom Resource Definition". You can list all the available resources in kubernetes by typing

kubectl api-resources

All resources with an apiversion of v1, apps/v1, networking.k8s.io/v1 and some others are built-in resources in Kubernetes. Third party vendors can extend kubernetes with their own resources. Traefik has made resources such as IngressRoute, Middleware, ServerTransport and others as custom resource definitions. They live in the apiversion traefik.containo.us/v1alpha1