traefik / traefik-helm-chart

Traefik Proxy Helm Chart
https://traefik.io
Apache License 2.0
1.09k stars 762 forks source link

v33.0.0: Failed to upgrade CRD #1243

Closed comphilip closed 4 weeks ago

comphilip commented 4 weeks ago

Welcome!

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?

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 commented 4 weeks ago

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

mloiseleur commented 4 weeks ago

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 commented 4 weeks ago

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