flagger icon indicating copy to clipboard operation
flagger copied to clipboard

Flagger-managed `TraefikService` resources use the deprecated traefik.containo.us Kubernetes API group

Open vytautaskubilius opened this issue 1 year ago • 8 comments
trafficstars

Describe the bug

The TraefikService resources that Flagger creates use the traefik.containo.us Kubernetes API group that has been deprecated in Traefik v3.

To Reproduce

  1. Create a Flagger Canary resource that uses the traefik provider.
  2. Upgrade Traefik to v3.
  3. Observe the following errors in Traefik logs:
ERR error="the service \"default-podinfo-canary@kubernetescrd\" does not exist" entryPointName=web routerName=web-default-podinfo-canary-3dfb9b2aaefc944f017e@kubernetescrd

Looking at the TraefikService manifest that Flagger creates, it uses the traefik.containo.us Kubernetes API group that has been deprecated in the latest Traefik release:

apiVersion: traefik.containo.us/v1alpha1
kind: TraefikService
metadata:
  annotations:
    helm.toolkit.fluxcd.io/driftDetection: disabled
    kustomize.toolkit.fluxcd.io/reconcile: disabled
  creationTimestamp: "2023-10-25T13:18:14Z"
  generation: 60
  name: podinfo-canary
  namespace: default
  ownerReferences:
  - apiVersion: flagger.app/v1beta1
    blockOwnerDeletion: true
    controller: true
    kind: Canary
    name: podinfo-canary
    uid: d8071248-c040-4c39-861d-ac75bd6e6c05
  resourceVersion: "3271693529"
  uid: 6cae73fe-28c4-4c55-8aae-f7c58b65e487
spec:
  weighted:
    services:
    - name: podinfo-canary-primary
      namespace: default
      port: 80
      weight: 100

Expected behavior

Flagger creates TraefikService resources with the new traefik.io Kubernetes API group.

Additional context

  • Flagger version: 1.37.0
  • Kubernetes version: 1.27.11
  • Service Mesh provider: N/A
  • Ingress provider: Traefik

vytautaskubilius avatar May 08 '24 11:05 vytautaskubilius

Traefik now supports Gateway API right? Maybe it's time to delete all the Traefik specific APIs from Flagger.

stefanprodan avatar May 08 '24 11:05 stefanprodan

Looks like it does. The docs have a warning about the support being experimental for now, but I'm not sure what implications that would have for Flagger.

vytautaskubilius avatar May 08 '24 11:05 vytautaskubilius

Flagger supports Gateway API, you could try it out with Traefik and report back if it works. Thanks

stefanprodan avatar May 08 '24 11:05 stefanprodan

I finally got around to testing it, and it doesn't look like Flagger has good enough support for Gateway API to work with Flagger Canary resources :( I think it's the fact that they don't appear to support weighted routing that results in Traefik failing to run the Gateway with the following errors:

an error occurred while creating gateway status: 1 error occurred:\n\t* Cannot load HTTPRoute service <namespace/service>: subset not found

vytautaskubilius avatar May 29 '24 18:05 vytautaskubilius

Hey

Just wanted to find out if we have any update the additional for support of traefik.io apiversion in flagger?

AshDerTest avatar Jun 27 '24 08:06 AshDerTest

I believe it's only the API version that has been modified, the spec of the resource is otherwise the same. Traefik supports both the old and new version since v2.10.x but only traefik.io from v3.0.0. While I too would prefer to migrate to the Gateway API, I would probably want to migrate to Traefik v3 first, before I switch the API, since v3 would be where any new features and fixes are added.

@stefanprodan Do you have any metrics on how many people are using Flagger with Traefik < v2.10?

judgeaxl avatar Feb 21 '25 11:02 judgeaxl

Traefik v3 was released in Apr 29, 2024 but Flagger still does not support it. How is it possible...

alexandrovas avatar Mar 08 '25 22:03 alexandrovas

#1779 - should fix the above & align with latest traefik version

Der-Exam avatar Apr 02 '25 12:04 Der-Exam