argo-cd: Argo CD causing deprecated resource warnings on EKS/GKE
Checklist:
- [x ] I’ve searched in the docs and FAQ for my answer: https://bit.ly/argocd-faq.
- [x ] I’ve included steps to reproduce the bug.
- [ x] I’ve pasted the output of
argocd version
.
Describe the bug
We are constantly seeing these warnings from argocd application-controller in our logs:
policy/v1beta1 PodSecurityPolicy is deprecated in v1.21+, unavailable in v1.25+
To Reproduce
Create AWS EKS cluster using Kubernetes 1.24 and install argocd 2.6.1 via helm chart
Expected behavior
No Warnings Screenshots
Version
2.6.1
Logs
policy/v1beta1 PodSecurityPolicy is deprecated in v1.21+, unavailable in v1.25+
About this issue
- Original URL
- State: open
- Created a year ago
- Reactions: 8
- Comments: 28 (2 by maintainers)
Commits related to this issue
- Exclude resource to avoid calling deprecated k8s API Need to do this so GKE cluster can upgrade to k8s v1.25. See https://github.com/argoproj/argo-cd/issues/12382 — committed to ClimateImpactLab/cilresearch-deployments by brews 10 months ago
- Exclude resource to avoid calling deprecated k8s API Need to do this so GKE cluster can upgrade to k8s v1.25. See argoproj/argo-cd#12382 — committed to RhodiumGroup/rhgresearch-deployments by brews 10 months ago
We did it like this and it works:
I have the same problem on a GKE cluster and it is becoming pretty serious:
So my cluster cannot upgrade to v1.25 because of this:
The version used is: v2.9.0+389cf75
Is there a plan to solve this once and for all and stop querying the api for deprecated resources if none of the manifests use these?
Just ignoring all resources that have a deprecated API is not really a workable solution
Ahhh. Yep, that’s what’s happening. Argo CD by default watches everything. I think you could just exclude that kind and avoid the API calls.
@alexsunins You can use Logs Explorer on GCP to search for hits to that API.
A basic query would look like:
Note: you will require the
privateLogViewer
role to see these events.See: Locate API clients making write calls to deprecated APIs - GKE for guidance.
@alexsunins In Argo CD’s case we don’t define PodSecurityPolicy in the codebase. The controller will watch all resources available in the cluster. If a cluster is upgraded to a newer k8s version where a specific API version isn’t available it won’t be watched by Argo CD. This means that this GKE validation is probably a false positive. Do you know how exactly GKE is verifying that a given application uses a certain API version?
Since it is managed by Google and part of GKE I did not do anything. We updated to v1.25 and everything worked for us.
In our GKE cluster we only have one
PodSecurityPolicy
resource:Is argo cd maybe only querying the API to see if there are resources with some argecd label? We updated to ArgoCD 2.8.0 today maybe this changes something. Right now this is the recommendation from google:
@crenshaw-dev by
prevents
I meant that GKE is refusing to upgrade the versions automatically unless deprecated APIs are removd. I don’t recall the exact warning message but the message implies that manual intervention is required before GKE can continue with automatic version upgrade.Hi, does anyone know if there is a way to verify if ArgoCD exclusion works? I have added
resource.exclusions
section toargocd-cm
configmap and have restartedargocd-server
andargocd-application-controller
deployments but a few days later GKE still reports that ArgoCd is scanning/apis/policy/v1beta1/podsecuritypolicies
and this prevents GKE from upgrading the cluster from v1.24 to v1.25