flagger icon indicating copy to clipboard operation
flagger copied to clipboard

no matches for kind "Canary" in version "flagger.app/v1beta1"

Open Amit-Prajapati opened this issue 3 years ago • 1 comments

Hello Team,

I am facing Canary kind does not match error with the flagger v1beta1 api with Kustomization. Error: "no matches for kind "Canary" in version "flagger.app/v1beta1""

  • Trying to install the flagger with flux, private helm repository.
  • flux version 0.13.4
  • flagger version- fluxcd/flagger:1.12.1
  • cluster: v1.21.9+rke2r1

Template sample:

apiVersion: flagger.app/v1beta1 kind: Canary metadata: name: name namespace: ns spec: provider: kubernetes targetRef: apiVersion: apps/v1 kind: Deployment name: deployment-name progressDeadlineSeconds: 3600 autoscalerRef: apiVersion: autoscaling/v2beta1 kind: HorizontalPodAutoscaler name: service-name service: port: port-number portDiscovery: true analysis: interval: 30s threshold: 2 iterations: 3 webhooks: - name: smoke-test type: pre-rollout url: http://flagger-loadtester.flagger-loadtest/ timeout: 15s metadata: type: bash cmd: "curl command"

Amit-Prajapati avatar May 20 '22 11:05 Amit-Prajapati

Greetings @Amit-Prajapati – thanks for using Flux and Flagger

These versions you have listed are both very far behind. There is a list of changes to be aware of in the upgrade guide for Flagger from v1alpha3 to v1beta1 (the API version that you referenced). The API version upgrade reflects feature additions and stability advancements in Flagger.

  • flux version 0.13.4
  • flagger version- fluxcd/flagger:1.12.1

These versions are from May and June 2021. There are similarly many changes in Flux since this time period, some of which are breaking changes and you will need to read the CHANGELOG for each minor release to ensure upgrades go smoothly. (The release of Flux you're on has about 6 pages of updates ahead of it: https://github.com/fluxcd/flux2/releases?page=6)

The reason for the error is the API version difference between the versions you are running and the current version. If you can upgrade, I'd recommend moving to the current versions as soon as reasonably possible. There are important updates and security fixes that cover a broad range of issues.

(If you cannot upgrade now, it should be possible to use an older API version for your canary and Flux resources, but the docs are not entirely friendly to this; it will probably be easier to upgrade, so you can use the latest docs as reference, than spending any time at all struggling with some issues that were likely fixed already, or trying to dig up the correct version of the docs.)

kingdonb avatar May 20 '22 14:05 kingdonb