Missing Traefik Service reference in IngressRoute or TraefikService

IngressRoutes expose Kubernetes applications externally to the public. Ingresses associate with Pods through references to Services. TraefikService is an abstraction on top of Kubernetes Services to enable advanced routing such as weighted load balancing, mirroring and sticky sessions. This validator detects a condition when IngressRoutes or TraefikServices are pointing to non-existing Services. It usually indicates a naming error in the IngressRoutes, TraefikServices or Services.

Affected Resources: IngressRoute, TraefikService

Examples

apiVersion: traefik.containo.us/v1alpha1 kind: IngressRoute metadata: name: whoami spec: entryPoints: - web routes: - kind: Rule match: Host(`demo.kubevious.io`) services: - kind: Service name: foo # K8s Service "foo" not found port: 80 - kind: TraefikService name: weighted # TraefikService "weighted" not found port: 80
apiVersion: v1 kind: Service metadata: name: bar # Different name in IngressRoute ...
apiVersion: traefik.containo.us/v1alpha1 kind: TraefikService metadata: name: weighted # Different name in IngressRoute spec: weighted: services: - name: whoamiv1 port: 80 weight: 3 - name: whoamiv2 # Missing Service whoamiv2 port: 80 weight: 1
apiVersion: v1 kind: Service metadata: name: whoamiv1 ...
apiVersion: v1 kind: Service metadata: name: whoamiv3 # Different name in TraefikService ...

Resolution

  • Check if the Service is present in the same namespace.
  • Check if the Service is present in a different namespace. Kubevious Search can be a very handy tool to find Services across namespaces. You cannot mount a Service from a different namespaces. In that case you would need to create a Service in namespace where the IngressRoute resides.
  • Did you make a typo in the IngressRoute? Kubevious Search uses fuzzy logic to return results and can help with finding the correct Service.
  • Make necessary naming corrections on the IngressRoute, TraefikService or the Service.
  • Need other validation rules?

    Please let us know if there are other built-in validation rules you would like to see in Kubevious to detect misconfigurations and violations to best practices. Optionally, you can provide your details so we can reach out to you with follow-up questions.

    Share this article on:
    message