Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

v33.0.0: Failed to upgrade CRD #1243

Closed
2 tasks done
comphilip opened this issue Oct 31, 2024 · 3 comments · Fixed by #1244
Closed
2 tasks done

v33.0.0: Failed to upgrade CRD #1243

comphilip opened this issue Oct 31, 2024 · 3 comments · Fixed by #1244
Labels
kind/question Further information is requested

Comments

@comphilip
Copy link

Welcome!

  • Yes, I've searched similar issues on GitHub and didn't find any.
  • Yes, I've searched similar issues on the Traefik community forum and didn't find any.

What version of the Traefik's Helm Chart are you using?

v33.0.0

What version of Traefik are you using?

v3.1.6

What did you do?

  • Upgrade traefik helm to v33.0.0 via fluxcd reports but failed
  • Manually update CRD: kubectl apply --server-side --force-conflicts -k https://github.com/traefik/traefik-helm-chart/traefik/crds/

What did you see instead?

fluxcd helm ugrade reports:

traefik	32.1.1	False	Unknown	Running 'upgrade' action with timeout of 5m0s	
traefik	32.1.1	False	False	Helm upgrade failed for release traefik/traefik with chart traefik@33.0.0: failed to apply CustomResourceDefinitions: failed to update CustomResourceDefinition(s): failed to replace object: CustomResourceDefinition.apiextensions.k8s.io "grpcroutes.gateway.networking.k8s.io" is invalid: status.storedVersions[0]: Invalid value: "v1alpha2": must appear in spec.versions

Manually update CRD:

customresourcedefinition.apiextensions.k8s.io/accesscontrolpolicies.hub.traefik.io serverside-applied
customresourcedefinition.apiextensions.k8s.io/apiaccesses.hub.traefik.io serverside-applied
customresourcedefinition.apiextensions.k8s.io/apibundles.hub.traefik.io serverside-applied
customresourcedefinition.apiextensions.k8s.io/apiplans.hub.traefik.io serverside-applied
customresourcedefinition.apiextensions.k8s.io/apiportals.hub.traefik.io serverside-applied
customresourcedefinition.apiextensions.k8s.io/apiratelimits.hub.traefik.io serverside-applied
customresourcedefinition.apiextensions.k8s.io/apis.hub.traefik.io serverside-applied
customresourcedefinition.apiextensions.k8s.io/apiversions.hub.traefik.io serverside-applied
customresourcedefinition.apiextensions.k8s.io/gatewayclasses.gateway.networking.k8s.io serverside-applied
customresourcedefinition.apiextensions.k8s.io/gateways.gateway.networking.k8s.io serverside-applied
customresourcedefinition.apiextensions.k8s.io/httproutes.gateway.networking.k8s.io serverside-applied
customresourcedefinition.apiextensions.k8s.io/ingressroutes.traefik.io serverside-applied
customresourcedefinition.apiextensions.k8s.io/ingressroutetcps.traefik.io serverside-applied
customresourcedefinition.apiextensions.k8s.io/ingressrouteudps.traefik.io serverside-applied
customresourcedefinition.apiextensions.k8s.io/middlewares.traefik.io serverside-applied
customresourcedefinition.apiextensions.k8s.io/middlewaretcps.traefik.io serverside-applied
customresourcedefinition.apiextensions.k8s.io/referencegrants.gateway.networking.k8s.io serverside-applied
customresourcedefinition.apiextensions.k8s.io/serverstransports.traefik.io serverside-applied
customresourcedefinition.apiextensions.k8s.io/serverstransporttcps.traefik.io serverside-applied
customresourcedefinition.apiextensions.k8s.io/tlsoptions.traefik.io serverside-applied
customresourcedefinition.apiextensions.k8s.io/tlsstores.traefik.io serverside-applied
customresourcedefinition.apiextensions.k8s.io/traefikservices.traefik.io serverside-applied
The CustomResourceDefinition "grpcroutes.gateway.networking.k8s.io" is invalid: status.storedVersions[0]: Invalid value: "v1alpha2": must appear in spec.versions

What is your environment & configuration?

K8S version: v1.31.2+k3s1

Install traefik helm: v32.1.1

Additional Information

No response

@muhlba91
Copy link

same problem here when upgrading from v32.1.1 to v33.0.0 on k0s and talos clusters.

@mloiseleur mloiseleur added kind/question Further information is requested and removed status/0-needs-triage labels Oct 31, 2024
@mloiseleur
Copy link
Contributor

mloiseleur commented Oct 31, 2024

There is no v1alpha2 in crds of v33:

$ grep -rn v1alpha2 traefik/crds/
# nothing.

It looks like that an other component in your environment is using a different (previous ?) version of Gateway API.

Considering helm known limitation on CRDs, there is a WIP to move CRD into a dedicated chart, see #1141 and PR #1223.

In the mean time, release notes of v1.2 of Gateway API contains instructions on how to upgrade when you have v1alpha2 reference:

Note that even if you've been using v1 in your YAML manifests, a controller may still be using v1alpha2 which would cause it to fail during this upgrade.

If you ran into issues installing these CRDs, it likely means that you have v1alpha2 in the storedVersions of one or both of these CRDs. This field is used to indicate which API versions have ever been used to persist one of these resources.

Unfortunately, this field is not automatically pruned.

Wdyt about following instruction provided on Gateway v1.2 release to fix it ?

@muhlba91
Copy link

thank you, this worked and fixed it for me now.
i think it makes sense to include this in the release notes for people to are aware of this process. 👍

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
kind/question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants