---
title: DatadogGenericResource CRD
description: >-
  Create and manage Datadog resources using the DatadogGenericResource custom
  resource definition with the Datadog Operator
breadcrumbs: Docs > Containers > Datadog Operator > DatadogGenericResource CRD
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

# DatadogGenericResource CRD

To create and manage Datadog resources with the Datadog Operator, use the `DatadogGenericResource` custom resource definition (CRD). `DatadogGenericResource` uses the Datadog API JSON payload for each supported resource type in `spec.jsonSpec`.

`DatadogGenericResource` is the preferred CRD for Datadog resources that are supported by both `DatadogGenericResource` and older resource-specific CRDs, such as `DatadogMonitor`, `DatadogDashboard`, and `DatadogSLO`.

## Prerequisites{% #prerequisites %}

- [Helm](https://helm.sh/)
- [`kubectl` CLI](https://kubernetes.io/docs/tasks/tools/install-kubectl/)
- [Datadog Operator](https://docs.datadoghq.com/containers/kubernetes/installation.md?tab=datadogoperator#installation) v1.12+
- Datadog API and application keys with permissions for the resources you create

## Supported resources{% #supported-resources %}

| Type                      | Operator version | API reference                                                                                                  |
| ------------------------- | ---------------- | -------------------------------------------------------------------------------------------------------------- |
| `notebook`                | v1.12.0          | [Create a notebook](https://docs.datadoghq.com/api/latest/notebooks.md#create-a-notebook)                      |
| `synthetics_api_test`     | v1.12.0          | [Create an API test](https://docs.datadoghq.com/api/latest/synthetics.md#create-an-api-test)                   |
| `synthetics_browser_test` | v1.12.0          | [Create a browser test](https://docs.datadoghq.com/api/latest/synthetics.md#create-a-browser-test)             |
| `monitor`                 | v1.13.0          | [Create a monitor](https://docs.datadoghq.com/api/latest/monitors.md#create-a-monitor)                         |
| `downtime`                | v1.22.0          | [Schedule a downtime](https://docs.datadoghq.com/api/latest/downtimes.md#schedule-a-downtime)                  |
| `dashboard`               | v1.27.0          | [Create a dashboard](https://docs.datadoghq.com/api/latest/dashboards.md#create-a-new-dashboard)               |
| `slo`                     | v1.28.0          | [Create an SLO object](https://docs.datadoghq.com/api/latest/service-level-objectives.md#create-an-slo-object) |

## Setup{% #setup %}

1. Run the installation command, substituting your Datadog API and application keys:

   ```shell
   helm install datadog-operator datadog/datadog-operator \
     --set apiKey=<DATADOG_API_KEY> \
     --set appKey=<DATADOG_APP_KEY> \
     --set datadogCRDs.crds.datadogGenericResources=true \
     --set datadogGenericResource.enabled=true
   ```

1. Create a file with the spec of your `DatadogGenericResource` configuration.

**Example**: Monitor

In the `datadog-generic-resource-monitor.yaml` file:

   ```yaml
      apiVersion: datadoghq.com/v1alpha1
      kind: DatadogGenericResource
      metadata:
        name: example-monitor
        namespace: <operator namespace>
      spec:
        type: monitor
        jsonSpec: |-
          {
            "name": "Example Monitor",
            "type": "metric alert",
            "query": "avg(last_10m):avg:system.cpu.user{*} > 80",
            "message": "CPU usage is high",
            "tags": [
              "team:example"
            ],
            "options": {
              "notify_no_data": false
            }
          }
      
```

1. Deploy your `DatadogGenericResource`:

   ```shell
   kubectl apply -f /path/to/your/datadog-generic-resource-monitor.yaml
   ```

## Further reading{% #further-reading %}

- [DatadogGenericResource guide](https://github.com/DataDog/datadog-operator/blob/main/docs/datadoggenericresource/datadog_generic_resource.md)
- [Migrating to DatadogGenericResource](https://github.com/DataDog/datadog-operator/blob/main/docs/datadoggenericresource/datadog_generic_resource_migration.md)
