Unused Traefik Service

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 when a TraefikService is not attached to IngressRoutes. That can be an indication of a typo in the TraefikService name or IngressRoutes reference.

Affected Resources: TraefikService

Examples

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 weight: 1
apiVersion: traefik.containo.us/v1alpha1 kind: IngressRoute metadata: name: whoami spec: entryPoints: - web routes: - kind: Rule match: Host(`demo.kubevious.io`) services: - kind: TraefikService name: weighted-svc # TraefikService "weighted" not found port: 80

Resolution

  • Examine IngressRoutes within the namespace and determine if the TraefikService is supposed used in any of them.
  • If the TraefikService is indeed unused, it may need to be just removed.
  • 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