-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unsupported HPA GVK: autoscaling/v2 #9145
Comments
Is there any progress or workaround? |
The current workaround is to apply the definition files using kubectl, but it's not the Argonic way. :-( |
Currently running into the same issue |
We running into the same issue |
Here is my workaround, using a kustomization.yaml : patches:
- path: hpa.argocd-fix.patch.yaml
target:
group: autoscaling
version: v2
kind: HorizontalPodAutoscaler hpa.argocd-fix.patch.yaml : - op: replace
path: /apiVersion
value: autoscaling/v2beta2 The v2beta2 is very similar to final v2, so it should work without an other patch - but if it happens however, just add your additional patches to the same file. |
No v2beta2 is not similar to v2 - Which is very strange. The |
in 1.23, using or patching Here are the manifests using ---
apiVersion: autoscaling/v2beta2
kind: HorizontalPodAutoscaler
metadata:
labels:
app: myapp
app.kubernetes.io/instance: myapp-dev
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: myapp
app.kubernetes.io/version: 1.1.3
argocd.argoproj.io/instance: myapp-dev
helm.sh/chart: myapp-1.1.3
release: myapp-dev
name: myapp
namespace: myapp-dev
spec:
... Here is what you get if you don't specify any API version ( apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
annotations:
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"autoscaling/v2beta2","kind":"HorizontalPodAutoscaler","metadata":{"annotations":{},"labels":{"app":"myapp","app.kubernetes.io/instance":"myapp-dev","app.kubernetes.io/managed-by":"Helm","app.kubernetes.io/name":"myapp","app.kubernetes.io/version":"1.1.3","argocd.argoproj.io/instance":"myapp-dev","helm.sh/chart":"myapp-dev-1.1.3","release":"myapp-dev"},"name":"myapp","namespace":"myapp-dev"},"spec":{"maxReplicas":2,"metrics":[{"resource":{"name":"cpu","target":{"averageUtilization":80,"type":"Utilization"}},"type":"Resource"}],"minReplicas":1,"scaleTargetRef":{"apiVersion":"apps/v1","kind":"Deployment","name":"myapp"}}}
creationTimestamp: "2022-01-27T14:14:36Z"
labels:
app: myapp
app.kubernetes.io/instance: myapp-dev
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: myapp
app.kubernetes.io/version: 1.1.3
argocd.argoproj.io/instance: myapp-dev
helm.sh/chart: myapp-dev-1.1.3
release: myapp-dev
name: myapp
namespace: myapp-dev
resourceVersion: "103570142"
uid: 15a38d49-1143-4e6f-92ad-67857e71b022
spec:
... and Argo CD doesn't like that:
|
I opened a MR in gitops-engine repository: argoproj/gitops-engine#411 |
Great that a patch has been created and merged! Thank you for your work. What is the timeline on the release of 2.4 to contain this change? |
gitops-engine v0.7.0 was released with the fix. Argo CD v2.4.0 is using gitops-engine v0.7.0: https://github.com/argoproj/argo-cd/blob/v2.4.0/go.mod#L12 So hopefully, this should be fixed with the latest version of Argo CD. |
I confirm |
Yes! |
Hey, I'm still seeing this issue on ArgoCD version 2.4.14 and kubernetes version 1.24. We have the latest argo charts (as of writing 5.6.0) deployed to our cluster and with
the HPAs are happy, but if I clear this out or set it to autoscaling/v2, I receive the output from argocd version:
output from kubectl version:
Are there any pieces to this puzzle that I'm missing here? |
Wow! |
Sure. So we're using the argo-helm charts on 5.6.0 here (https://github.com/argoproj/argo-helm/tree/argo-cd-5.6.0), which result in this definition file for the repo-server hpa:
And the error we get with this is
|
Should we consider reopen the issue given 2.4.0 does not seem fix it based on several comments above? |
I am also seeing this when upgrading hpa from v2beta to v2.
|
We used to have the same error on v2.3, but it works now on v2.4.15 and K8S 1.23:
|
Using 2.4.14, just tested with a apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
labels:
argocd.argoproj.io/instance: myapp
name: myapp-hpa
namespace: default
spec:
maxReplicas: 2
metrics:
- resource:
name: cpu
target:
averageUtilization: 80
type: Utilization
type: Resource
minReplicas: 1
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: myapp-deploy argocd can sync it correctly:
my setup: $ kubectl version --short
Flag --short has been deprecated, and will be removed in the future. The --short output will become the default.
Client Version: v1.24.3
Kustomize Version: v4.5.4
Server Version: v1.24.3
$ argocd version
argocd: v2.4.11+3d9e9f2
BuildDate: 2022-08-22T09:35:38Z
GitCommit: 3d9e9f2f95b7801b90377ecfc4073e5f0f07205b
GitTreeState: clean
GoVersion: go1.18.5
Compiler: gc
Platform: linux/amd64
argocd-server: v2.4.14+029be59
BuildDate: 2022-10-05T17:15:37Z
GitCommit: 029be590bfd5003d65ddabb4d4cb8a31bff29c18
GitTreeState: clean
GoVersion: go1.18.7
Compiler: gc
Platform: linux/amd64
Kustomize Version: v4.4.1 2021-11-11T23:36:27Z
Helm Version: v3.8.1+g5cb9af4
Kubectl Version: v0.23.1
Jsonnet Version: v0.18.0 |
I haven't been able to recreate on a fresh cluster, I'm only seeing this issue on a server that we've recently upgraded both k8s and argocd. We've been slowly trying to narrow down our dependencies to figure out if one of these is causing this. Is there any way to check the version of the gitops engine we're running? |
Use |
I have this issue with ArgoCD 2.2.2 and autoscaling/v1. Hpa works fine:
So only one issue here, in Argo in events I see that it's no healthy with the message: unsupported HPA GVK: autoscaling/v2, Kind=HorizontalPodAutoscaler. But I am using autoscaling/v1, strange... Kubectl: |
I'm having the same issue here. Argo helm chart 3.35.4 app version v2.2.5 |
I was dumb. The problem was HPA couldn't access metrics - check your security groups from Cluster to the node group <3 |
Was seeing this issue with ArgoCD 2.1.x with |
seeing the issue on latest argocd 5.22.1 and on k8s 1.23.16 |
Seeing this issue as well |
a workaround we use for disabling health check for the HPA
|
Are we still talking about a failing sync here? I mean
|
Hi Team, Anyone found the solution. I am also facing same issues. It was working fine till yesterday. Now when I sync today it says "server could not find the requested resource" and failing the sync. any help would be appreciated |
Hi Guys, If you can't update ArgoCD this might help you :
v1 is the default version of HPA Works on setup: |
I'm also facing this issue trying to deploy the GitLab Helm chart with ArgoCD. I'm using K3s v1.27 and there's no |
For anyone facing this issue:
|
Checklist:
argocd version
.When I try to create an app using HPA apiVersion: autoscaling/v2beta2 the follow error is returned:
ComparisonError
SyncError
To Reproduce
I used a typical HPA definition file:
If I use
apiVersion: autoscaling/v2beta2
Argo CD works perfectly. But this apiVersion is deprecated in Kubernetes v1.23+ and unavailable in v1.26+.IMPORTANT: When I apply the above definition using
kubectl
works fine (I'm using Kubernetes v1.23.5).Expected behavior
I would like to apply HPA definition using
apiVersion: autoscaling/v2
.Version
The text was updated successfully, but these errors were encountered: