Unsupported HPA GVK issue in Red Hat Openshift GitOps operator in RHOCP 4

Solution Verified - Updated -

Environment

  • Red Hat OpenShift Container Platform (RHOCP)
    • 4
  • Red Hat OpenShift GitOps Operator
    • 1.15

Issue

  • Unsupported HPA GVK: autoscaling/v2, Kind=HorizontalPodAutoscaler issue appears when trying to deploy a HorizontalPodAutoscaler instance.

  • ArgoCD cannot sync when enabling a new HPA or disabling the old one.

Resolution

Upgrade the Red Hat Openshift GitOps Operator to 1.16 version following the official documentation

Root Cause

In prior versions to the Red Hat Openshift GitOps Operator 1.16 the ArgoCD version was not 2.14 and for these prior versions, the v2beta2 API was not compatible. Red Hat Openshift GitOps Operator 1.16 uses ArgoCD 2.14 according to the official documentation

Diagnostic Steps

Review in the environment section the RHOL version to check if the version is affected:

$ oc get csv | grep gitops

Review if the HorizontalPodAutoscaler configuration file has suffering the issue below:

$ oc het hpa <HPAName> -n <namespace> -o yaml
[...]
  conditions:
  - lastTransitionTime: "2023-03-25T14:47:54Z"
    message: 'unsupported HPA GVK: autoscaling/v2, Kind=HorizontalPodAutoscaler'
    type: ComparisonError
[...]

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments