datadogagent

package
v1.27.0-rc.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 8, 2026 License: Apache-2.0 Imports: 109 Imported by: 0

Documentation

Index

Constants

View Source
const ExperimentDefaultTimeout = 15 * time.Minute

ExperimentDefaultTimeout is the duration after which a running experiment is automatically rolled back.

Variables

This section is empty.

Functions

func CheckOwnerReference

func CheckOwnerReference(owner, object metav1.Object) bool

CheckOwnerReference return true if owner is the owner of the object

func GetAgentInstanceLabelValue added in v1.17.0

func GetAgentInstanceLabelValue(dda, profile metav1.Object) string

GetAgentInstanceLabelValue returns the instance name for the agent The current and default is DDA name + suffix (e.g. <dda-name>-agent) This is used when profiles are disabled or for the default profile If profiles are enabled, use the profile name (e.g. <profile-name>-agent) for profile DSs

func IsEqualStatus added in v1.19.0

func IsEqualStatus(current *v2alpha1.DatadogAgentStatus, newStatus *v2alpha1.DatadogAgentStatus) bool

func SetOwnerReference

func SetOwnerReference(owner, object metav1.Object, scheme *runtime.Scheme) error

SetOwnerReference sets owner as a OwnerReference.

Types

type BuilderOptions

type BuilderOptions struct {
	AllowOverride bool
}

BuilderOptions corresponds to Builders options.

func DefaultBuilderOptions

func DefaultBuilderOptions() BuilderOptions

DefaultBuilderOptions returns a default BuilderOptions instance.

type ClusterAgentComponent added in v1.22.0

type ClusterAgentComponent struct {
	// contains filtered or unexported fields
}

ClusterAgentComponent implements ComponentReconciler for the Cluster Agent deployment

func NewClusterAgentComponent added in v1.22.0

func NewClusterAgentComponent(reconciler *Reconciler) *ClusterAgentComponent

NewClusterAgentComponent creates a new ClusterAgent component

func (*ClusterAgentComponent) CleanupDependencies added in v1.25.0

func (c *ClusterAgentComponent) CleanupDependencies(ctx context.Context, logger logr.Logger, dda *datadoghqv2alpha1.DatadogAgent, resourcesManager feature.ResourceManagers) (reconcile.Result, error)

func (*ClusterAgentComponent) DeleteStatus added in v1.25.0

func (c *ClusterAgentComponent) DeleteStatus(newStatus *datadoghqv2alpha1.DatadogAgentStatus, conditionType string)

func (*ClusterAgentComponent) ForceDeleteComponent added in v1.25.0

func (c *ClusterAgentComponent) ForceDeleteComponent(dda *datadoghqv2alpha1.DatadogAgent, requiredComponents feature.RequiredComponents) bool

func (*ClusterAgentComponent) GetConditionType added in v1.22.0

func (c *ClusterAgentComponent) GetConditionType() string

GetConditionType returns the condition type for status updates

func (*ClusterAgentComponent) GetGlobalSettingsFunc added in v1.25.0

func (c *ClusterAgentComponent) GetGlobalSettingsFunc() func(logger logr.Logger, podManagers feature.PodTemplateManagers, dda metav1.Object, spec *datadoghqv2alpha1.DatadogAgentSpec, resourceManagers feature.ResourceManagers, requiredComponents feature.RequiredComponents)

func (*ClusterAgentComponent) GetManageFeatureFunc added in v1.25.0

func (c *ClusterAgentComponent) GetManageFeatureFunc() func(feat feature.Feature, managers feature.PodTemplateManagers, provider string) error

func (*ClusterAgentComponent) GetNewDeploymentFunc added in v1.25.0

func (c *ClusterAgentComponent) GetNewDeploymentFunc() func(dda metav1.Object, spec *datadoghqv2alpha1.DatadogAgentSpec) *appsv1.Deployment

func (*ClusterAgentComponent) IsEnabled added in v1.22.0

IsEnabled checks if the Cluster Agent component should be reconciled

func (*ClusterAgentComponent) Name added in v1.22.0

Name returns the component name

func (*ClusterAgentComponent) UpdateStatus added in v1.25.0

func (c *ClusterAgentComponent) UpdateStatus(deployment *appsv1.Deployment, newStatus *datadoghqv2alpha1.DatadogAgentStatus, updateTime metav1.Time, status metav1.ConditionStatus, reason, message string)

type ClusterChecksRunnerComponent added in v1.22.0

type ClusterChecksRunnerComponent struct {
	// contains filtered or unexported fields
}

ClusterChecksRunnerComponent implements ComponentReconciler for the Cluster Checks Runner deployment

func NewClusterChecksRunnerComponent added in v1.22.0

func NewClusterChecksRunnerComponent(reconciler *Reconciler) *ClusterChecksRunnerComponent

NewClusterChecksRunnerComponent creates a new ClusterChecksRunner component

func (*ClusterChecksRunnerComponent) CleanupDependencies added in v1.25.0

func (c *ClusterChecksRunnerComponent) CleanupDependencies(ctx context.Context, logger logr.Logger, dda *datadoghqv2alpha1.DatadogAgent, resourcesManager feature.ResourceManagers) (reconcile.Result, error)

func (*ClusterChecksRunnerComponent) DeleteStatus added in v1.25.0

func (c *ClusterChecksRunnerComponent) DeleteStatus(newStatus *datadoghqv2alpha1.DatadogAgentStatus, conditionType string)

func (*ClusterChecksRunnerComponent) ForceDeleteComponent added in v1.25.0

func (c *ClusterChecksRunnerComponent) ForceDeleteComponent(dda *datadoghqv2alpha1.DatadogAgent, requiredComponents feature.RequiredComponents) bool

func (*ClusterChecksRunnerComponent) GetConditionType added in v1.22.0

func (c *ClusterChecksRunnerComponent) GetConditionType() string

GetConditionType returns the condition type for status updates

func (*ClusterChecksRunnerComponent) GetGlobalSettingsFunc added in v1.25.0

func (c *ClusterChecksRunnerComponent) GetGlobalSettingsFunc() func(logger logr.Logger, podManagers feature.PodTemplateManagers, dda metav1.Object, spec *datadoghqv2alpha1.DatadogAgentSpec, resourceManagers feature.ResourceManagers, requiredComponents feature.RequiredComponents)

func (*ClusterChecksRunnerComponent) GetManageFeatureFunc added in v1.25.0

func (c *ClusterChecksRunnerComponent) GetManageFeatureFunc() func(feat feature.Feature, managers feature.PodTemplateManagers, provider string) error

func (*ClusterChecksRunnerComponent) GetNewDeploymentFunc added in v1.25.0

func (*ClusterChecksRunnerComponent) IsEnabled added in v1.22.0

IsEnabled checks if the ClusterChecksRunner component should be reconciled CCR requires the Cluster Agent to be enabled as well

func (*ClusterChecksRunnerComponent) Name added in v1.22.0

Name returns the component name

func (*ClusterChecksRunnerComponent) UpdateStatus added in v1.25.0

func (c *ClusterChecksRunnerComponent) UpdateStatus(deployment *appsv1.Deployment, newStatus *datadoghqv2alpha1.DatadogAgentStatus, updateTime metav1.Time, status metav1.ConditionStatus, reason, message string)

type ComponentReconciler added in v1.22.0

type ComponentReconciler interface {
	// Name returns the component name (e.g., "clusterAgent", "clusterChecksRunner")
	Name() datadoghqv2alpha1.ComponentName

	// IsEnabled checks if this component should be reconciled based on requiredComponents and override settings
	// Returns (enabled, conflict) where:
	//   - enabled=true, conflict=false: component should be reconciled normally
	//   - enabled=true, conflict=true: component enabled in features but disabled via override (cleanup with conflict status)
	//   - enabled=false, conflict=*: component disabled (cleanup without conflict status if conflict=false)
	IsEnabled(requiredComponents feature.RequiredComponents, overrides map[datadoghqv2alpha1.ComponentName]*datadoghqv2alpha1.DatadogAgentComponentOverride) (enabled bool, conflict bool)

	// GetConditionType returns the condition type used for status updates
	GetConditionType() string

	// GetGlobalSettingsFunc returns the function to apply global settings to the component
	GetGlobalSettingsFunc() func(logger logr.Logger, podManagers feature.PodTemplateManagers, dda metav1.Object, spec *datadoghqv2alpha1.DatadogAgentSpec, resourceManagers feature.ResourceManagers, requiredComponents feature.RequiredComponents)

	// GetNewDeploymentFunc returns the function to create a new deployment for the component
	GetNewDeploymentFunc() func(dda metav1.Object, spec *datadoghqv2alpha1.DatadogAgentSpec) *appsv1.Deployment

	// GetManageFeatureFunc feature function to manage the component
	GetManageFeatureFunc() func(feat feature.Feature, managers feature.PodTemplateManagers, provider string) error

	// UpdateStatus updates the status of the component
	UpdateStatus(deployment *appsv1.Deployment, newStatus *datadoghqv2alpha1.DatadogAgentStatus, updateTime metav1.Time, status metav1.ConditionStatus, reason, message string)

	// DeleteStatus deletes the status of the component
	DeleteStatus(newStatus *datadoghqv2alpha1.DatadogAgentStatus, conditionType string)

	// ForceDeleteComponent forces the deletion of the component
	ForceDeleteComponent(dda *datadoghqv2alpha1.DatadogAgent, requiredComponents feature.RequiredComponents) bool

	// CleanupDependencies deletes any dependencies associated with the component
	CleanupDependencies(ctx context.Context, logger logr.Logger, dda *datadoghqv2alpha1.DatadogAgent, resourcesManager feature.ResourceManagers) (reconcile.Result, error)
}

ComponentReconciler defines the interface that all deployment/daemonset components must implement

type ComponentRegistry added in v1.22.0

type ComponentRegistry struct {
	// contains filtered or unexported fields
}

ComponentRegistry manages the registration and reconciliation of all components

func NewComponentRegistry added in v1.22.0

func NewComponentRegistry(reconciler *Reconciler) *ComponentRegistry

NewComponentRegistry creates a new component registry

func (*ComponentRegistry) Cleanup added in v1.25.0

Cleanup removes the component deployment, associated resources and updates status

func (*ComponentRegistry) GetComponent added in v1.22.0

GetComponent returns a registered component by name

func (*ComponentRegistry) ListComponents added in v1.22.0

func (r *ComponentRegistry) ListComponents() []ComponentReconciler

ListComponents returns all registered components

func (*ComponentRegistry) ReconcileComponents added in v1.22.0

func (r *ComponentRegistry) ReconcileComponents(ctx context.Context, params *ReconcileComponentParams) (reconcile.Result, error)

ReconcileComponents reconciles all registered components in order

func (*ComponentRegistry) Register added in v1.22.0

func (r *ComponentRegistry) Register(component ComponentReconciler)

Register adds a component to the registry

type EnvVarBuilder

type EnvVarBuilder struct {
	// contains filtered or unexported fields
}

EnvVarBuilder used to generate a list of EnvVar.

func NewEnvVarsBuilder

func NewEnvVarsBuilder(envVars []corev1.EnvVar, opts *BuilderOptions) *EnvVarBuilder

NewEnvVarsBuilder returns a new EnvVarsBuilder instance.

func (*EnvVarBuilder) Add

func (b *EnvVarBuilder) Add(iEnvVar *corev1.EnvVar) *EnvVarBuilder

Add used to add an EnvVar to the EnvVarBuilder.

func (*EnvVarBuilder) Build

func (b *EnvVarBuilder) Build() []corev1.EnvVar

Build return the generated EnvVar list.

func (*EnvVarBuilder) Remove

func (b *EnvVarBuilder) Remove(volumeName string) *EnvVarBuilder

Remove used to remove an EnvVar to the EnvVarBuilder.

type OtelAgentGatewayComponent added in v1.23.0

type OtelAgentGatewayComponent struct {
	// contains filtered or unexported fields
}

OtelAgentGatewayComponent implements ComponentReconciler for the OTel Agent Gateway deployment

func NewOtelAgentGatewayComponent added in v1.23.0

func NewOtelAgentGatewayComponent(reconciler *Reconciler) *OtelAgentGatewayComponent

NewOtelAgentGatewayComponent creates a new OtelAgentGateway component

func (*OtelAgentGatewayComponent) CleanupDependencies added in v1.25.0

func (c *OtelAgentGatewayComponent) CleanupDependencies(ctx context.Context, logger logr.Logger, dda *datadoghqv2alpha1.DatadogAgent, resourcesManager feature.ResourceManagers) (reconcile.Result, error)

func (*OtelAgentGatewayComponent) DeleteStatus added in v1.25.0

func (c *OtelAgentGatewayComponent) DeleteStatus(newStatus *datadoghqv2alpha1.DatadogAgentStatus, conditionType string)

func (*OtelAgentGatewayComponent) ForceDeleteComponent added in v1.25.0

func (c *OtelAgentGatewayComponent) ForceDeleteComponent(dda *datadoghqv2alpha1.DatadogAgent, requiredComponents feature.RequiredComponents) bool

func (*OtelAgentGatewayComponent) GetConditionType added in v1.23.0

func (c *OtelAgentGatewayComponent) GetConditionType() string

GetConditionType returns the condition type for status updates

func (*OtelAgentGatewayComponent) GetGlobalSettingsFunc added in v1.25.0

func (c *OtelAgentGatewayComponent) GetGlobalSettingsFunc() func(logger logr.Logger, podManagers feature.PodTemplateManagers, dda metav1.Object, spec *datadoghqv2alpha1.DatadogAgentSpec, resourceManagers feature.ResourceManagers, requiredComponents feature.RequiredComponents)

func (*OtelAgentGatewayComponent) GetManageFeatureFunc added in v1.25.0

func (c *OtelAgentGatewayComponent) GetManageFeatureFunc() func(feat feature.Feature, managers feature.PodTemplateManagers, provider string) error

func (*OtelAgentGatewayComponent) GetNewDeploymentFunc added in v1.25.0

func (c *OtelAgentGatewayComponent) GetNewDeploymentFunc() func(dda metav1.Object, spec *datadoghqv2alpha1.DatadogAgentSpec) *appsv1.Deployment

func (*OtelAgentGatewayComponent) IsEnabled added in v1.23.0

IsEnabled checks if the OtelAgentGateway component should be reconciled

func (*OtelAgentGatewayComponent) Name added in v1.23.0

Name returns the component name

func (*OtelAgentGatewayComponent) UpdateStatus added in v1.25.0

func (c *OtelAgentGatewayComponent) UpdateStatus(deployment *appsv1.Deployment, newStatus *datadoghqv2alpha1.DatadogAgentStatus, updateTime metav1.Time, status metav1.ConditionStatus, reason, message string)

type ReconcileComponentParams added in v1.22.0

type ReconcileComponentParams struct {
	Logger             logr.Logger
	DDA                *datadoghqv2alpha1.DatadogAgent
	RequiredComponents feature.RequiredComponents
	Features           []feature.Feature
	ResourceManagers   feature.ResourceManagers
	Status             *datadoghqv2alpha1.DatadogAgentStatus
	Provider           string
	ProviderList       map[string]struct{}
}

ReconcileComponentParams bundles common parameters needed by all components

type Reconciler

type Reconciler struct {
	// contains filtered or unexported fields
}

Reconciler is the internal reconciler for Datadog Agent

func NewReconciler

func NewReconciler(options ReconcilerOptions, client client.Client, platformInfo kubernetes.PlatformInfo,
	scheme *runtime.Scheme, log logr.Logger, recorder record.EventRecorder, metricForwardersMgr datadog.MetricsForwardersManager,
) (*Reconciler, error)

NewReconciler returns a reconciler for DatadogAgent

func (*Reconciler) Reconcile

func (r *Reconciler) Reconcile(ctx context.Context, dda *v2alpha1.DatadogAgent) (reconcile.Result, error)

Reconcile is similar to reconciler.Reconcile interface, but taking a context

type ReconcilerOptions

type ReconcilerOptions struct {
	ExtendedDaemonsetOptions   componentagent.ExtendedDaemonsetOptions
	SupportCilium              bool
	OperatorMetricsEnabled     bool
	IntrospectionEnabled       bool
	DatadogAgentProfileEnabled bool
	DatadogCSIDriverEnabled    bool
	CreateControllerRevisions  bool
	// ExperimentTimeout overrides ExperimentDefaultTimeout. Zero means use the default.
	ExperimentTimeout time.Duration
}

ReconcilerOptions provides options read from command line

type VolumeBuilder

type VolumeBuilder struct {
	// contains filtered or unexported fields
}

VolumeBuilder used to generate a list of Volume.

func NewVolumeBuilder

func NewVolumeBuilder(volumes []corev1.Volume, opts *BuilderOptions) *VolumeBuilder

NewVolumeBuilder returns a new VolumeBuilder instance.

func (*VolumeBuilder) Add

func (b *VolumeBuilder) Add(iVolume *corev1.Volume) *VolumeBuilder

Add used to add an Volume to the VolumeBuilder.

func (*VolumeBuilder) Build

func (b *VolumeBuilder) Build() []corev1.Volume

Build used to generate a list of Volume.

func (*VolumeBuilder) Remove

func (b *VolumeBuilder) Remove(volumeName string) *VolumeBuilder

Remove used to remove an Volume from the VolumeBuilder.

type VolumeMountBuilder

type VolumeMountBuilder struct {
	// contains filtered or unexported fields
}

VolumeMountBuilder used to generate a list of VolumeMount.

func NewVolumeMountBuilder

func NewVolumeMountBuilder(volumeMounts []corev1.VolumeMount, opts *BuilderOptions) *VolumeMountBuilder

NewVolumeMountBuilder returns a new VolumeMountBuilder instance.

func (*VolumeMountBuilder) Add

Add used to add an VolumeMount to the VolumeMountBuilder.

func (*VolumeMountBuilder) Build

func (b *VolumeMountBuilder) Build() []corev1.VolumeMount

Build used to generate a list of VolumeMount

func (*VolumeMountBuilder) Remove

func (b *VolumeMountBuilder) Remove(volumeName string) *VolumeMountBuilder

Remove used to remove an VolumeMount from the VolumeMountBuilder.

Directories

Path Synopsis
Package feature provide the framework to manage Feature in a generic way.
Package feature provide the framework to manage Feature in a generic way.
apm
asm
cws
dogstatsd
Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
gpu
npm
otelagentgateway/defaultconfig
package defaultconfig exposes the otel-agent default config in gateway
package defaultconfig exposes the otel-agent default config in gateway
otelcollector/defaultconfig
package defaultconfig exposes the otel-agent default config
package defaultconfig exposes the otel-agent default config
usm
Package override provides a set of function to override generic resource such as corev1.PodTemplate and corev1.Container.
Package override provides a set of function to override generic resource such as corev1.PodTemplate and corev1.Container.
Package store provides a store use to manage deployment dependencies.
Package store provides a store use to manage deployment dependencies.
Package testutils_test contains a set of unit-test helper functions to ease the creation of unit-test around the DatadogAgent CRD controller
Package testutils_test contains a set of unit-test helper functions to ease the creation of unit-test around the DatadogAgent CRD controller

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL