helm-mapkubeapis icon indicating copy to clipboard operation
helm-mapkubeapis copied to clipboard

hpa in 1.26 k8s is not mapped properly

Open EvgeniGordeev opened this issue 1 year ago • 4 comments

Scenario

  • Chart https://github.com/codecentric/helm-charts/tree/master/charts/keycloakx version 2.1.1 was deployed to EKS cluster 1.24. In this chart version HorizontalPodAutoscaler was defined with apiVersion: autoscaling/v2beta2 https://github.com/codecentric/helm-charts/blob/653a238737a8d8a665913d23503cdc44bfa8bcd2/charts/keycloakx/templates/hpa.yaml
  • Cluster got upgraded to 1.26
  • Trying to upgrade keycloak chart 2.1.1 -> 2.2.1 caused. This time apiVersion is autoscaling/v2 https://github.com/codecentric/helm-charts/blob/edcf6b2b7d1ff601bd15b5ee89f05397ffdb0821/charts/keycloakx/templates/hpa.yaml
Error: UPGRADE FAILED: unable to build kubernetes objects from current release manifest: resource mapping not found for name: "platform-identity-keycloakx" namespace: "test" from "": no matches for kind "HorizontalPodAutoscaler" in version "autoscaling/v2beta2"
ensure CRDs are installed first
helm.go:84: [debug] resource mapping not found for name: "RELEASE_NAME-keycloakx" namespace: "default" from "": no matches for kind "HorizontalPodAutoscaler" in version "autoscaling/v2beta2"
  • helm mapkubeapis RELEASE_NAME produced
2023/05/04 11:42:07 Release 'RELEASE_NAME' will be checked for deprecated or removed Kubernetes APIs and will be updated if necessary to supported API versions.
2023/05/04 11:42:07 Get release 'RELEASE_NAME' latest version.
2023/05/04 11:42:09 Check release 'RELEASE_NAME' for deprecated or removed APIs...
2023/05/04 11:42:09 Finished checking release 'RELEASE_NAME' for deprecated or removed APIs.
2023/05/04 11:42:09 Release 'RELEASE_NAME' has no deprecated or removed APIs.
2023/05/04 11:42:09 Map of release 'RELEASE_NAME' deprecated or removed APIs to supported versions, completed successfully.

Problem

Cannot upgrade or uninstall the chart:

uninstall.go:117: [debug] uninstall: Failed to delete release: [unable to build kubernetes objects for delete: resource mapping not found for name: "RELEASE_NAME-keycloakx" namespace: "default" from "": no matches for kind "HorizontalPodAutoscaler" in version "autoscaling/v2beta2"

Helm manifest still has deprecated apiVersion:

helm get manifest RELEASE_NAME
...
apiVersion: autoscaling/v2beta2
kind: HorizontalPodAutoscaler
metadata:
  name: RELEASE_NAME-keycloakx
...

EvgeniGordeev avatar May 04 '23 16:05 EvgeniGordeev

Probably related to #108

LeMyst avatar Jun 19 '23 12:06 LeMyst

I believe these all include the fix to add HPA's deprecation:

  • https://github.com/helm/helm-mapkubeapis/pull/108
  • https://github.com/helm/helm-mapkubeapis/pull/117
  • https://github.com/helm/helm-mapkubeapis/pull/119
  • https://github.com/helm/helm-mapkubeapis/pull/121
  • https://github.com/helm/helm-mapkubeapis/pull/122
  • #125
  • #126
  • #127

As a user, clearly this is something many people are hitting, I'd love to see a merge happen

danopia avatar Aug 30 '23 06:08 danopia

Has this problem been fixed in a release yet? I just hit this same issue where it does not pick up the obsolete apiVersion for HPA.

EDIT: I confirmed this is not working in the latest version of the plugin. Can we get this in a release ASAP please?

cpetestewart avatar Feb 26 '24 16:02 cpetestewart

Has this problem been fixed in a release yet? I just hit this same issue where it does not pick up the obsolete apiVersion for HPA.

EDIT: I confirmed this is not working in the latest version of the plugin. Can we get this in a release ASAP please?

The best you can do it's to use one of the unmerged MR from danopia post https://github.com/helm/helm-mapkubeapis/issues/116#issuecomment-1698541924

or create your own by cherry-picking.

Project seems dead...

LeMyst avatar Feb 27 '24 10:02 LeMyst

This fix has been merged and will be in the next release.

mattfarina avatar Aug 09 '24 13:08 mattfarina