# CRD Management

Bluebricks uses server-side apply to manage CRD installation automatically. This ensures CRDs are installed before your chart deploys, preventing common deployment failures and version conflicts.

## CRD support

**Automatic installation:**

* CRDs are automatically installed before chart deployment
* Uses server-side apply for reliable CRD management
* Handles CRD updates and versioning

**CRD sources:**

* `crds/` directory in your chart
* Chart dependencies with CRDs
* External CRD definitions

## CRD directory structure

```
my-helm-chart/
├── Chart.yaml
├── values.yaml
├── templates/
└── crds/                    # CRD definitions
    ├── custom-resource.yaml
    └── another-crd.yaml
```

## How CRD installation works

Bluebricks follows a safe, sequential process to handle CRDs:

1. **Pre-deployment:** Installs CRDs first to make them available
2. **Validation:** Validates CRD syntax and compatibility before proceeding
3. **Chart deployment:** Deploys your chart templates that reference the CRDs
4. **Post-deployment:** Verifies CRD status to confirm successful installation

This order prevents errors where templates try to use CRDs that don't exist yet.

## Best practices

1. **Place CRDs in `crds/` directory**
2. **Use proper CRD versions**
3. **Test CRD installation locally**
4. **Document CRD requirements**

## See also

* [Helm](https://bluebricks.co/docs/core-concepts/packages/artifacts-overview/helm): full Helm artifact reference
* [Packages overview](https://bluebricks.co/docs/core-concepts/packages): artifact types and packaging concepts
* [Creating Blueprints](https://bluebricks.co/docs/core-concepts/packages/blueprints-overview/creating-blueprints): compose artifacts into blueprints
