> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/argoproj/argo-cd/llms.txt
> Use this file to discover all available pages before exploring further.

# Plain YAML

> Deploy plain Kubernetes YAML manifests with Argo CD

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:

```yaml theme={null}
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
```

<Info>
  It's unnecessary to explicitly add the `spec.source.directory` field unless you need additional configuration options. Argo CD automatically detects plain manifest files.
</Info>

## Recursive Resource Detection

By default, only files in the root of the configured path are included. Enable recursive detection to include subdirectories:

```yaml theme={null}
apiVersion: argoproj.io/v1alpha1
kind: Application
spec:
  source:
    directory:
      recurse: true
```

<ParamField path="recurse" type="boolean">
  Include files from subdirectories recursively
</ParamField>

### CLI Usage

```bash theme={null}
argocd app set guestbook --directory-recurse
```

<Warning>
  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.
</Warning>

## Include Patterns

Include only specific files or directories:

```yaml theme={null}
apiVersion: argoproj.io/v1alpha1
kind: Application
spec:
  source:
    directory:
      include: 'some-directory/*'
```

<ParamField path="include" type="string">
  Glob pattern to match files to include
</ParamField>

### Examples

```bash theme={null}
# 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/*"
```

<Note>
  Quote patterns in the shell to prevent expansion before sending to Argo CD.
</Note>

## Exclude Patterns

Exclude files matching specific patterns:

```yaml theme={null}
apiVersion: argoproj.io/v1alpha1
kind: Application
spec:
  source:
    directory:
      exclude: '{config.json,env-usw2/*}'
```

<ParamField path="exclude" type="string">
  Glob pattern to match files to exclude
</ParamField>

### Examples

```bash theme={null}
# 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:

```yaml theme={null}
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:

```yaml theme={null}
# +argocd:skip-file-rendering
apiVersion: v1
kind: ConfigMap
metadata:
  name: example
data:
  not-actually: a-manifest
```

<Tip>
  Add the `# +argocd:skip-file-rendering` comment anywhere in the file to prevent Argo CD from parsing it as a manifest.
</Tip>

## Common Use Cases

<AccordionGroup>
  <Accordion title="Deploy from a manifests directory">
    ```yaml theme={null}
    spec:
      source:
        path: k8s/manifests
        directory:
          recurse: true
    ```
  </Accordion>

  <Accordion title="Include only production configs">
    ```yaml theme={null}
    spec:
      source:
        path: k8s
        directory:
          include: 'production/*'
    ```
  </Accordion>

  <Accordion title="Exclude test and development files">
    ```yaml theme={null}
    spec:
      source:
        path: k8s
        directory:
          exclude: '{test/*,dev/*,*.test.yaml}'
    ```
  </Accordion>

  <Accordion title="YAML only, no JSON">
    ```yaml theme={null}
    spec:
      source:
        path: manifests
        directory:
          include: '*.yaml'
    ```
  </Accordion>
</AccordionGroup>

## When to Use Directory Type

<CardGroup cols={2}>
  <Card title="Good For" icon="check">
    * Simple applications with static manifests
    * Quick prototypes and demos
    * Applications without templating needs
    * Teams preferring explicit YAML
  </Card>

  <Card title="Consider Alternatives" icon="lightbulb">
    * Multi-environment deployments → Use Kustomize
    * Parameterized deployments → Use Helm
    * Dynamic generation → Use Jsonnet or plugins
    * Complex configurations → Use config management tools
  </Card>
</CardGroup>
