feature request: airgap method for updating Flux2's CRDs
LarryS was having this issue: Helm install failed: unable to build kubernetes objects from release manifest: error validating "": error validating data: [ValidationError(HelmRelease.spec.install): unknown field "crds" in io.fluxcd.toolkit.helm.v2beta1.HelmRelease.spec.install, ValidationError(HelmRelease.spec.upgrade): unknown field "crds" in io.fluxcd.toolkit.helm.v2beta1.HelmRelease.spec.upgrade]
I'll explain what the issue was and that we have a need for a feature request. I suggested 2 days ago that Larry update his version of Flux and he did, but he accidentally did a partial update of flux because he's in a mock airgap env.
The state his cluster was in was: flux system namespace showed the correct latest version of flux. But based on his error message mentioning v2beta1 and TomR mentioning a while back that Flux 0.16.x mentioned they were going to switch from beta api to stable api. the CRDs in his airgap cluster were out of date / on the v2beta1 API version of the CRDs vs the stable api version of the CRDs. Which is where his error came from.
The janky way I helped fix his issue was to:
-
k get deploy -n=flux-system -o yaml > ~/flux.backup.yaml
# (because this has the correct version of flux manifests pointing to his air gap registry) - vi the flux.backup.yaml and remove references of uid and resourceVersion so that we could restore the file with a
kubectl apply -f ~/flux.backup.yaml
- Airgap manual update the version of his fluxcli binary to 1.16.2
- Use
flux install
to have the fluxcli binary generate the CRDs with the stable api version and deploy docker hub / docker.io version of flux images (which were blocked by the airgap environment/didn't work) - Since the flux cli fixed the version of the CRDs we were then able to run
kubectl apply -f ~/flux.backup.yaml
which restored the updated flux that pointed to his airgap registry. - Helm install stopped erroring on install.
The feature request: We should have an easier way to do an airgap update of only the CRDs, I'm not sure why but for some reason when we cloned bigbang and ran ./scripts/install_flux.sh we couldn't get it to work airgap + even if it did work it makes too many assumptions about pointing to registry1.dso.mil and being internet connected. (technically this may be a low value feature request that's a 1 off from flux's API's of it's CRD's going from beta to stable and maybe we can just document the workaround? / create a doc to solve this in a cleaner way.)