---
title: Usage of resource exclusions to omit the offending APIs.
description: Avoid Kubernetes resources reconciliation by ArgoCD using a user script
---

[Skip to content](https://support.akuity.io/kb/usage-of-resource-exclusion-to-omit-the-offending-apis#main-content)

English

Show submenu for translations

[![Akuity-Logo-Color-1](https://support.akuity.io/hubfs/Akuity-Logo-Color-1.svg)](https://akuity.io/)

Open main navigation

Close main navigation

- English
  
  Show submenu for translations

 Hello. How can we help you?

- There are no suggestions because the search field is empty.

1. [Help Center](https://support.akuity.io/kb?hsLang=en)
2. [Argo CD](https://support.akuity.io/kb/argo-cd?hsLang=en)

# Usage of resource exclusions to omit the offending APIs.

## Avoid Kubernetes resources reconciliation by ArgoCD using a user script

**Resource exclusions** tell Argo CD to *ignore certain Kubernetes resources* during synchronization and health checks. This is useful when:

- Argo CD doesn’t have permissions to list or read certain resources (e.g., due to cluster RBAC constraints).
- Resources are managed externally and should not be reconciled by Argo CD.
- Preventing sync failures due to unsupported or inaccessible APIs.

These exclusions are typically configured in the Argo CD settings (e.g., `argocd-cm` ConfigMap or cluster settings in Akuity UI) under `resource.exclusions`.

### 🔧 **The Purpose of `argo_resource_check.sh` Script**

This script helps **identify Kubernetes resources that Argo CD is not managing**, which makes them good candidates for **resource exclusion**.

`#!/bin/bash`

`# Collect resources on the cluster`  
`RESOURCE_NAMES=$(kubectl api-resources --no-headers | tr -s ' ' | cut -d ' ' -f 1)`

`for line in $RESOURCE_NAMES`  
`do`  
`  echo  ======={$line}======`  
`  if [ -z "$(kubectl get $line --all-namespaces -o json | jq -r --arg key "argocd.argoproj.io/tracking-id" '.items[] | select(.metadata.annotations[$key] != null) | .metadata.name')" ]; then`  
`    echo -e 'Resource is not managed by Argo CD,'$(kubectl get $line -A --no-headers | wc -l)' resources can be possibly be added to an exclusion rule\n'`  
`  else`  
`    echo -e "*** At least one resource is managed by Argo CD and cannot be excluded ***\n"`  
`  fi`  
`done`

### 🧪 **How to Use the Script**

1. Save the script as `argo_resource_check.sh`.
2. Make it executable:
   
   `chmod +x argo_resource_check.sh`
3. Run it:
   
   `./argo_resource_check.sh`

- [Argo CD](https://support.akuity.io/kb/argo-cd?hsLang=en#main-content)

    - [App of Apps](https://support.akuity.io/kb/argo-cd?hsLang=en#app-of-apps)
    - [Configuration](https://support.akuity.io/kb/argo-cd?hsLang=en#configuration)
    - [ApplicationSet](https://support.akuity.io/kb/argo-cd?hsLang=en#applicationset)
- [Akuity Platform](https://support.akuity.io/kb/akuity-platform?hsLang=en#main-content)

    - [Audit Logs](https://support.akuity.io/kb/akuity-platform?hsLang=en#audit-logs)
    - [IP Allow Lists](https://support.akuity.io/kb/akuity-platform?hsLang=en#ip-allow-lists)
    - [Terraform](https://support.akuity.io/kb/akuity-platform?hsLang=en#terraform)
    - [Configuration](https://support.akuity.io/kb/akuity-platform?hsLang=en#configuration)
    - [Agents](https://support.akuity.io/kb/akuity-platform?hsLang=en#agents)
    - [Troubleshooting](https://support.akuity.io/kb/akuity-platform?hsLang=en#troubleshooting)
- [Kargo](https://support.akuity.io/kb/kargo?hsLang=en#main-content)

    - [Configuration](https://support.akuity.io/kb/kargo?hsLang=en#configuration)
    - [Warehouses](https://support.akuity.io/kb/kargo?hsLang=en#warehouses)
    - [Metrics](https://support.akuity.io/kb/kargo?hsLang=en#metrics)
- [Self-hosted Akuity Platform](https://support.akuity.io/kb/self-hosted-akuity-platform?hsLang=en#main-content)

    - [Configuration](https://support.akuity.io/kb/self-hosted-akuity-platform?hsLang=en#configuration)

[![Akuity-Logo-Color-1](https://support.akuity.io/hubfs/Akuity-Logo-Color-1.svg "Akuity-Logo-Color-1")](https://akuity.io/)

Akuity.io Help Center

Copyright © 2025, Akuity Inc.