Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[datadog-crds] add DatadogGenericResources CRD #1694

Merged
merged 3 commits into from
Feb 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions charts/datadog-crds/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

# 2.4.1

* Add DatadogGenericResources CRD.

# 2.4.0

* Update CRDs from Datadog Operator v1.12.0 tag.
Expand Down
2 changes: 1 addition & 1 deletion charts/datadog-crds/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
name: datadog-crds
description: Datadog Kubernetes CRDs chart
version: 2.4.0
version: 2.4.1
appVersion: "1"
keywords:
- monitoring
Expand Down
3 changes: 2 additions & 1 deletion charts/datadog-crds/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Datadog CRDs

![Version: 2.4.0](https://img.shields.io/badge/Version-2.4.0-informational?style=flat-square) ![AppVersion: 1](https://img.shields.io/badge/AppVersion-1-informational?style=flat-square)
![Version: 2.4.1](https://img.shields.io/badge/Version-2.4.1-informational?style=flat-square) ![AppVersion: 1](https://img.shields.io/badge/AppVersion-1-informational?style=flat-square)

This chart was designed to allow other "datadog" charts to share `CustomResourceDefinitions` such as the `DatadogMetric`.

Expand All @@ -25,6 +25,7 @@ But the recommended Kubernetes versions are `1.16+`.
| crds.datadogAgentProfiles | bool | `false` | Set to true to deploy the DatadogAgentProfiles CRD |
| crds.datadogAgents | bool | `false` | Set to true to deploy the DatadogAgents CRD |
| crds.datadogDashboards | bool | `false` | Set to true to deploy the DatadogDashboards CRD |
| crds.datadogGenericResources | bool | `false` | Set to true to deploy the DatadogGenericResources CRD |
| crds.datadogMetrics | bool | `false` | Set to true to deploy the DatadogMetrics CRD |
| crds.datadogMonitors | bool | `false` | Set to true to deploy the DatadogMonitors CRD |
| crds.datadogPodAutoscalers | bool | `false` | Set to true to deploy the DatadogPodAutoscalers CRD |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
{{- if and .Values.crds.datadogGenericResources (semverCompare ">1.21-0" .Capabilities.KubeVersion.GitVersion ) }}
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.3
name: datadoggenericresources.datadoghq.com
labels:
helm.sh/chart: '{{ include "datadog-crds.chart" . }}'
app.kubernetes.io/managed-by: '{{ .Release.Service }}'
app.kubernetes.io/name: '{{ include "datadog-crds.name" . }}'
app.kubernetes.io/instance: '{{ .Release.Name }}'
spec:
group: datadoghq.com
names:
kind: DatadogGenericResource
listKind: DatadogGenericResourceList
plural: datadoggenericresources
shortNames:
- ddgr
singular: datadoggenericresource
scope: Namespaced
versions:
- additionalPrinterColumns:
- jsonPath: .status.id
name: id
type: string
- jsonPath: .status.syncStatus
name: sync status
type: string
- jsonPath: .metadata.creationTimestamp
name: age
type: date
name: v1alpha1
schema:
openAPIV3Schema:
description: DatadogGenericResource is the Schema for the DatadogGenericResources API
properties:
apiVersion:
description: |-
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
description: |-
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
spec:
description: DatadogGenericResourceSpec defines the desired state of DatadogGenericResource
properties:
jsonSpec:
description: JsonSpec is the specification of the API object
type: string
type:
description: Type is the type of the API object
enum:
- notebook
- synthetics_api_test
- synthetics_browser_test
type: string
required:
- jsonSpec
- type
type: object
status:
description: DatadogGenericResourceStatus defines the observed state of DatadogGenericResource
properties:
conditions:
description: Conditions represents the latest available observations of the state of a DatadogGenericResource.
items:
description: Condition contains details for one aspect of the current state of this API Resource.
properties:
lastTransitionTime:
description: |-
lastTransitionTime is the last time the condition transitioned from one status to another.
This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
format: date-time
type: string
message:
description: |-
message is a human readable message indicating details about the transition.
This may be an empty string.
maxLength: 32768
type: string
observedGeneration:
description: |-
observedGeneration represents the .metadata.generation that the condition was set based upon.
For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
with respect to the current state of the instance.
format: int64
minimum: 0
type: integer
reason:
description: |-
reason contains a programmatic identifier indicating the reason for the condition's last transition.
Producers of specific condition types may define expected values and meanings for this field,
and whether the values are considered a guaranteed API.
The value should be a CamelCase string.
This field may not be empty.
maxLength: 1024
minLength: 1
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
type: string
status:
description: status of the condition, one of True, False, Unknown.
enum:
- "True"
- "False"
- Unknown
type: string
type:
description: type of condition in CamelCase or in foo.example.com/CamelCase.
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
required:
- lastTransitionTime
- message
- reason
- status
- type
type: object
type: array
x-kubernetes-list-map-keys:
- type
x-kubernetes-list-type: map
created:
description: Created is the time the object was created.
format: date-time
type: string
creator:
description: Creator is the identity of the creator.
type: string
currentHash:
description: |-
CurrentHash tracks the hash of the current DatadogGenericResourceSpec to know
if the JsonSpec has changed and needs an update.
type: string
id:
description: Id is the object unique identifier generated in Datadog.
type: string
lastForceSyncTime:
description: LastForceSyncTime is the last time the API object was last force synced with the custom resource
format: date-time
type: string
syncStatus:
description: SyncStatus shows the health of syncing the object state to Datadog.
type: string
type: object
type: object
served: true
storage: true
subresources:
status: {}
{{- end }}
1 change: 1 addition & 0 deletions charts/datadog-crds/update-crds.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,4 @@ download_crd "$DATADOG_OPERATOR_REPO" "$DATADOG_OPERATOR_TAG" datadogslos datado
download_crd "$DATADOG_OPERATOR_REPO" "$DATADOG_OPERATOR_TAG" datadogagentprofiles datadogAgentProfiles v1
download_crd "$DATADOG_OPERATOR_REPO" "$DATADOG_OPERATOR_TAG" datadogpodautoscalers datadogPodAutoscalers v1
download_crd "$DATADOG_OPERATOR_REPO" "$DATADOG_OPERATOR_TAG" datadogdashboards datadogDashboards v1
download_crd "$DATADOG_OPERATOR_REPO" "$DATADOG_OPERATOR_TAG" datadoggenericresources datadogGenericResources v1
2 changes: 2 additions & 0 deletions charts/datadog-crds/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ crds:
datadogPodAutoscalers: false
# crds.datadogDashboards -- Set to true to deploy the DatadogDashboards CRD
datadogDashboards: false
# crds.datadogGenericResources -- Set to true to deploy the DatadogGenericResources CRD
datadogGenericResources: false

# nameOverride -- Override name of app
nameOverride: ""
Expand Down
157 changes: 157 additions & 0 deletions crds/datadoghq.com_datadoggenericresources.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.3
name: datadoggenericresources.datadoghq.com
spec:
group: datadoghq.com
names:
kind: DatadogGenericResource
listKind: DatadogGenericResourceList
plural: datadoggenericresources
shortNames:
- ddgr
singular: datadoggenericresource
scope: Namespaced
versions:
- additionalPrinterColumns:
- jsonPath: .status.id
name: id
type: string
- jsonPath: .status.syncStatus
name: sync status
type: string
- jsonPath: .metadata.creationTimestamp
name: age
type: date
name: v1alpha1
schema:
openAPIV3Schema:
description: DatadogGenericResource is the Schema for the DatadogGenericResources API
properties:
apiVersion:
description: |-
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
description: |-
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
spec:
description: DatadogGenericResourceSpec defines the desired state of DatadogGenericResource
properties:
jsonSpec:
description: JsonSpec is the specification of the API object
type: string
type:
description: Type is the type of the API object
enum:
- notebook
- synthetics_api_test
- synthetics_browser_test
type: string
required:
- jsonSpec
- type
type: object
status:
description: DatadogGenericResourceStatus defines the observed state of DatadogGenericResource
properties:
conditions:
description: Conditions represents the latest available observations of the state of a DatadogGenericResource.
items:
description: Condition contains details for one aspect of the current state of this API Resource.
properties:
lastTransitionTime:
description: |-
lastTransitionTime is the last time the condition transitioned from one status to another.
This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
format: date-time
type: string
message:
description: |-
message is a human readable message indicating details about the transition.
This may be an empty string.
maxLength: 32768
type: string
observedGeneration:
description: |-
observedGeneration represents the .metadata.generation that the condition was set based upon.
For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
with respect to the current state of the instance.
format: int64
minimum: 0
type: integer
reason:
description: |-
reason contains a programmatic identifier indicating the reason for the condition's last transition.
Producers of specific condition types may define expected values and meanings for this field,
and whether the values are considered a guaranteed API.
The value should be a CamelCase string.
This field may not be empty.
maxLength: 1024
minLength: 1
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
type: string
status:
description: status of the condition, one of True, False, Unknown.
enum:
- "True"
- "False"
- Unknown
type: string
type:
description: type of condition in CamelCase or in foo.example.com/CamelCase.
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
required:
- lastTransitionTime
- message
- reason
- status
- type
type: object
type: array
x-kubernetes-list-map-keys:
- type
x-kubernetes-list-type: map
created:
description: Created is the time the object was created.
format: date-time
type: string
creator:
description: Creator is the identity of the creator.
type: string
currentHash:
description: |-
CurrentHash tracks the hash of the current DatadogGenericResourceSpec to know
if the JsonSpec has changed and needs an update.
type: string
id:
description: Id is the object unique identifier generated in Datadog.
type: string
lastForceSyncTime:
description: LastForceSyncTime is the last time the API object was last force synced with the custom resource
format: date-time
type: string
syncStatus:
description: SyncStatus shows the health of syncing the object state to Datadog.
type: string
type: object
type: object
served: true
storage: true
subresources:
status: {}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
namespace: datadog-agent
labels:
app.kubernetes.io/name: datadog-operator
helm.sh/chart: datadog-operator-2.5.1
helm.sh/chart: datadog-operator-2.5.2
app.kubernetes.io/instance: datadog-operator
app.kubernetes.io/version: "1.11.1"
app.kubernetes.io/managed-by: Helm
Expand Down
Loading