Things that were upgraded:
- New kyverno images are in use
- New settings are in use
- New CRDs are defined
Things that failed
- Migrating from the old to the new (at least cleaning up deleting the old)
There might be other issues. This task is to track, debug and try to fix it.
Note that we will be dropping kyverno after the next k8s upgrade T364293: [infra,k8s] Move to kubernetes VAPs and drop kyverno.
The error was:
root@tools-k8s-control-9:~/toolforge-deploy# ./deploy.sh kyverno ... WARNING: top-level config key environments must be defined before releases in helmfile.yaml Adding repo kyverno https://kyverno.github.io/kyverno "kyverno" has been added to your repositories Affected releases are: kyverno (kyverno/kyverno) UPDATED Do you really want to sync? Helmfile will sync all your releases, as shown above. [y/n]: y Upgrading release=kyverno, chart=kyverno/kyverno, namespace=kyverno FAILED RELEASES: NAME NAMESPACE CHART VERSION DURATION kyverno kyverno kyverno/kyverno 16s in ./helmfile.yaml: failed processing release kyverno: command "/usr/sbin/helm" exited with non-zero status: PATH: /usr/sbin/helm ARGS: 0: helm (4 bytes) 1: upgrade (7 bytes) 2: --install (9 bytes) 3: kyverno (7 bytes) 4: kyverno/kyverno (15 bytes) 5: --version (9 bytes) 6: 3.3.9 (5 bytes) 7: --create-namespace (18 bytes) 8: --namespace (11 bytes) 9: kyverno (7 bytes) 10: --values (8 bytes) 11: /tmp/helmfile3409313553/kyverno-kyverno-values-bcbd456c5 (56 bytes) 12: --values (8 bytes) 13: /tmp/helmfile3369218270/kyverno-kyverno-values-b78494bbf (56 bytes) 14: --reset-values (14 bytes) 15: --history-max (13 bytes) 16: 10 (2 bytes) ERROR: exit status 1 EXIT STATUS 1 STDERR: Error: UPGRADE FAILED: cannot patch "cleanuppolicies.kyverno.io" with kind CustomResourceDefinition: CustomResourceDefinition.apiextensions.k8s.io "cleanuppolicies.kyverno.io" is invalid: status.storedVersions[0]: Invalid value: "v2alpha1": must appear in spec.versions && cannot patch "clustercleanuppolicies.kyverno.io" with kind CustomResourceDefinition: CustomResourceDefinition.apiextensions.k8s.io "clustercleanuppolicies.kyverno.io" is invalid: status.storedVersions[0]: Invalid value: "v2alpha1": must appear in spec.versions && cannot patch "policyexceptions.kyverno.io" with kind CustomResourceDefinition: CustomResourceDefinition.apiextensions.k8s.io "policyexceptions.kyverno.io" is invalid: status.storedVersions[0]: Invalid value: "v2alpha1": must appear in spec.versions COMBINED OUTPUT: Error: UPGRADE FAILED: cannot patch "cleanuppolicies.kyverno.io" with kind CustomResourceDefinition: CustomResourceDefinition.apiextensions.k8s.io "cleanuppolicies.kyverno.io" is invalid: status.storedVersions[0]: Invalid value: "v2alpha1": must appear in spec.versions && cannot patch "clustercleanuppolicies.kyverno.io" with kind CustomResourceDefinition: CustomResourceDefinition.apiextensions.k8s.io "clustercleanuppolicies.kyverno.io" is invalid: status.storedVersions[0]: Invalid value: "v2alpha1": must appear in spec.versions && cannot patch "policyexceptions.kyverno.io" with kind CustomResourceDefinition: CustomResourceDefinition.apiextensions.k8s.io "policyexceptions.kyverno.io" is invalid: status.storedVersions[0]: Invalid value: "v2alpha1": must appear in spec.versions
A potentially related issue (thanks @fnegri) and workaround: https://github.com/kyverno/kyverno/issues/12633