Skip to main content
Directory-type applications load plain Kubernetes manifest files from .yml, .yaml, and .json files. This is the simplest source type in Argo CD.

Basic Directory Application

Argo CD automatically detects plain manifests:
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: guestbook
spec:
  destination:
    namespace: default
    server: https://kubernetes.default.svc
  project: default
  source:
    path: guestbook
    repoURL: https://github.com/argoproj/argocd-example-apps.git
    targetRevision: HEAD
It’s unnecessary to explicitly add the spec.source.directory field unless you need additional configuration options. Argo CD automatically detects plain manifest files.

Recursive Resource Detection

By default, only files in the root of the configured path are included. Enable recursive detection to include subdirectories:
apiVersion: argoproj.io/v1alpha1
kind: Application
spec:
  source:
    directory:
      recurse: true
recurse
boolean
Include files from subdirectories recursively

CLI Usage

argocd app set guestbook --directory-recurse
Directory-type applications only work for plain manifest files. If Argo CD encounters Kustomize, Helm, or Jsonnet files when directory: is set, it will fail to render the manifests.

Include Patterns

Include only specific files or directories:
apiVersion: argoproj.io/v1alpha1
kind: Application
spec:
  source:
    directory:
      include: 'some-directory/*'
include
string
Glob pattern to match files to include

Examples

# Include only .yaml files
argocd app set guestbook --directory-include "*.yaml"

# Include both .yml and .yaml files
argocd app set guestbook --directory-include "{*.yml,*.yaml}"

# Include only a specific directory
argocd app set guestbook --directory-include "some-directory/*"
Quote patterns in the shell to prevent expansion before sending to Argo CD.

Exclude Patterns

Exclude files matching specific patterns:
apiVersion: argoproj.io/v1alpha1
kind: Application
spec:
  source:
    directory:
      exclude: '{config.json,env-usw2/*}'
exclude
string
Glob pattern to match files to exclude

Examples

# Exclude a config file
argocd app set guestbook --directory-exclude "config.yaml"

# Exclude multiple patterns
argocd app set guestbook --directory-exclude "{config.yaml,env-use2/*}"

Combined Include and Exclude

When both are specified, files must match the include pattern AND not match the exclude pattern:
apiVersion: argoproj.io/v1alpha1
kind: Application
spec:
  source:
    directory:
      include: '*.yaml'
      exclude: '{config.json,env-usw2/*}'
Example repository structure:
config.json
deployment.yaml
env-use2/
  configmap.yaml
env-usw2/
  configmap.yaml
With the above configuration:
  • deployment.yaml - Included (matches *.yaml, doesn’t match exclude)
  • env-use2/configmap.yaml - Included (with recurse enabled)
  • config.json - Excluded (doesn’t match *.yaml)
  • env-usw2/configmap.yaml - Excluded (matches exclude pattern)

Skip File Rendering

Some YAML files may resemble Kubernetes manifests but aren’t intended to be deployed (e.g., Helm values.yaml, CI/CD configs). Skip these files:
# +argocd:skip-file-rendering
apiVersion: v1
kind: ConfigMap
metadata:
  name: example
data:
  not-actually: a-manifest
Add the # +argocd:skip-file-rendering comment anywhere in the file to prevent Argo CD from parsing it as a manifest.

Common Use Cases

spec:
  source:
    path: k8s/manifests
    directory:
      recurse: true
spec:
  source:
    path: k8s
    directory:
      include: 'production/*'
spec:
  source:
    path: k8s
    directory:
      exclude: '{test/*,dev/*,*.test.yaml}'
spec:
  source:
    path: manifests
    directory:
      include: '*.yaml'

When to Use Directory Type

Good For

  • Simple applications with static manifests
  • Quick prototypes and demos
  • Applications without templating needs
  • Teams preferring explicit YAML

Consider Alternatives

  • Multi-environment deployments → Use Kustomize
  • Parameterized deployments → Use Helm
  • Dynamic generation → Use Jsonnet or plugins
  • Complex configurations → Use config management tools

Build docs developers (and LLMs) love