Below is the TraefikService I am using:
apiVersion: traefik.containo.us/v1alpha1
kind: TraefikService
metadata:
name: {{ .Values.name }}
namespace: {{ .Values.namespace }}
spec:
weighted:
services:
- name: {{ .Values.name }}
port: 8000
serversTransport: {{ .Values.name }}
weight: 100
- name: {{ .Values.name }}-baseline
port: 8000
serversTransport: {{ .Values.name }}
weight: 0
- name: {{ .Values.name }}-canary
port: 8000
serversTransport: {{ .Values.name }}
weight: 0
Above is referenced from ingressRoute:
spec:
entryPoints:
- web
routes:
- kind: Rule
match: Host(`{{ .Values.hostName }}`) && PathPrefix(`/`)
services:
- kind: TraefikService
name: {{ .Values.name }}
namespace: {{ .Values.name }}
In traefikService, the backend services with weight zero are scaled down and are only scaled up when the weight is changed to non-zero.
However, when I tested the request, I received 404 and could not see any service or router in the access log of Traefik for the request. When I scale backend services with weight zero up, the request works fine and returns 200.
I would like to know if this is the only way to avoid 404, i.e., have at least 1 replica of the backend service even if the weight is zero for that service.
Thanks