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
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
...
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.