-
Notifications
You must be signed in to change notification settings - Fork 98
/
datadogagent_types.go
1504 lines (1234 loc) · 59 KB
/
datadogagent_types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-present Datadog, Inc.
package v1alpha1
import (
edsdatadoghqv1alpha1 "github.com/DataDog/extendeddaemonset/api/v1alpha1"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/intstr"
)
// DatadogFeatures are Features running on the Agent and Cluster Agent.
// +k8s:openapi-gen=true
type DatadogFeatures struct {
// OrchestratorExplorer configuration.
OrchestratorExplorer *OrchestratorExplorerConfig `json:"orchestratorExplorer,omitempty"`
// KubeStateMetricsCore configuration.
KubeStateMetricsCore *KubeStateMetricsCore `json:"kubeStateMetricsCore,omitempty"`
// PrometheusScrape configuration.
PrometheusScrape *PrometheusScrapeConfig `json:"prometheusScrape,omitempty"`
// NetworkMonitoring configuration.
NetworkMonitoring *NetworkMonitoringConfig `json:"networkMonitoring,omitempty"`
// LogCollection configuration.
LogCollection *LogCollectionConfig `json:"logCollection,omitempty"`
}
// DatadogAgentSpec defines the desired state of DatadogAgent.
// +k8s:openapi-gen=true
type DatadogAgentSpec struct {
// Configure the credentials needed to run Agents. If not set, then the credentials
// set in the DatadogOperator will be used.
Credentials *AgentCredentials `json:"credentials,omitempty"`
// Features running on the Agent and Cluster Agent.
// +optional
Features DatadogFeatures `json:"features,omitempty"`
// The desired state of the Agent as an extended daemonset.
// Contains the Node Agent configuration and deployment strategy.
// +optional
Agent DatadogAgentSpecAgentSpec `json:"agent,omitempty"`
// The desired state of the Cluster Agent as a deployment.
// +optional
ClusterAgent DatadogAgentSpecClusterAgentSpec `json:"clusterAgent,omitempty"`
// The desired state of the Cluster Checks Runner as a deployment.
// +optional
ClusterChecksRunner DatadogAgentSpecClusterChecksRunnerSpec `json:"clusterChecksRunner,omitempty"`
// Set a unique cluster name to allow scoping hosts and Cluster Checks Runner easily.
// +optional
ClusterName string `json:"clusterName,omitempty"`
// The site of the Datadog intake to send Agent data to.
// Set to 'datadoghq.eu' to send data to the EU site.
// +optional
Site string `json:"site,omitempty"`
// Registry to use for all Agent images (default gcr.io/datadoghq).
// Use public.ecr.aws/datadog for AWS
// Use docker.io/datadog for DockerHub
// +optional
Registry *string `json:"registry,omitempty"`
}
// DatadogCredentials is a generic structure that holds credentials to access Datadog.
// +k8s:openapi-gen=true
type DatadogCredentials struct {
// APIKey Set this to your Datadog API key before the Agent runs.
// See also: https://app.datadoghq.com/account/settings#agent/kubernetes
APIKey string `json:"apiKey,omitempty"`
// APIKeyExistingSecret is DEPRECATED.
// In order to pass the API key through an existing secret, please consider "apiSecret" instead.
// If set, this parameter takes precedence over "apiKey".
// +optional
// +deprecated
APIKeyExistingSecret string `json:"apiKeyExistingSecret,omitempty"`
// APISecret Use existing Secret which stores API key instead of creating a new one.
// If set, this parameter takes precedence over "apiKey" and "apiKeyExistingSecret".
// +optional
APISecret *Secret `json:"apiSecret,omitempty"`
// If you are using clusterAgent.metricsProvider.enabled = true, you must set
// a Datadog application key for read access to your metrics.
// +optional
AppKey string `json:"appKey,omitempty"`
// AppKeyExistingSecret is DEPRECATED.
// In order to pass the APP key through an existing secret, please consider "appSecret" instead.
// If set, this parameter takes precedence over "appKey".
// +optional
// +deprecated
AppKeyExistingSecret string `json:"appKeyExistingSecret,omitempty"`
// APPSecret Use existing Secret which stores API key instead of creating a new one.
// If set, this parameter takes precedence over "apiKey" and "appKeyExistingSecret".
// +optional
APPSecret *Secret `json:"appSecret,omitempty"`
}
// AgentCredentials contains credentials values to configure the Agent.
// +k8s:openapi-gen=true
type AgentCredentials struct {
DatadogCredentials `json:",inline"`
// This needs to be at least 32 characters a-zA-z.
// It is a preshared key between the node agents and the cluster agent.
// +optional
Token string `json:"token,omitempty"`
// UseSecretBackend use the Agent secret backend feature for retreiving all credentials needed by
// the different components: Agent, Cluster, Cluster-Checks.
// default value is false.
UseSecretBackend *bool `json:"useSecretBackend,omitempty"`
}
// Secret contains a secret name and an included key.
// +k8s:openapi-gen=true
type Secret struct {
// SecretName is the name of the secret.
SecretName string `json:"secretName"`
// KeyName is the key of the secret to use.
// +optional
KeyName string `json:"keyName,omitempty"`
}
// DatadogAgentSpecAgentSpec defines the desired state of the node Agent.
// +k8s:openapi-gen=true
type DatadogAgentSpecAgentSpec struct {
// Enabled
Enabled *bool `json:"enabled,omitempty"`
// UseExtendedDaemonset use ExtendedDaemonset for Agent deployment.
// default value is false.
UseExtendedDaemonset *bool `json:"useExtendedDaemonset,omitempty"`
// The container image of the Datadog Agent.
Image *ImageConfig `json:"image,omitempty"`
// Name of the Daemonset to create or migrate from.
// +optional
DaemonsetName string `json:"daemonsetName,omitempty"`
// Agent configuration.
Config *NodeAgentConfig `json:"config,omitempty"`
// RBAC configuration of the Agent.
Rbac *RbacConfig `json:"rbac,omitempty"`
// Update strategy configuration for the DaemonSet.
DeploymentStrategy *DaemonSetDeploymentStrategy `json:"deploymentStrategy,omitempty"`
// AdditionalAnnotations provide annotations that will be added to the Agent Pods.
AdditionalAnnotations map[string]string `json:"additionalAnnotations,omitempty"`
// AdditionalLabels provide labels that will be added to the Agent Pods.
AdditionalLabels map[string]string `json:"additionalLabels,omitempty"`
// KeepLabels allows the specification of labels not managed by the Operator that will be kept on Agent DaemonSet.
// All labels containing 'datadoghq.com' are always included. This field uses glob syntax.
KeepLabels string `json:"keepLabels,omitempty"`
// KeepAnnotations allows the specification of annotations not managed by the Operator that will be kept on Agent DaemonSet.
// All annotations containing 'datadoghq.com' are always included. This field uses glob syntax.
KeepAnnotations string `json:"keepAnnotations,omitempty"`
// If specified, indicates the pod's priority. "system-node-critical" and "system-cluster-critical"
// are two special keywords which indicate the highest priorities with the former being the highest priority.
// Any other name must be defined by creating a PriorityClass object with that name. If not specified,
// the pod priority will be default or zero if there is no default.
PriorityClassName string `json:"priorityClassName,omitempty"`
// Set DNS policy for the pod.
// Defaults to "ClusterFirst".
// Valid values are 'ClusterFirstWithHostNet', 'ClusterFirst', 'Default' or 'None'.
// DNS parameters given in DNSConfig will be merged with the policy selected with DNSPolicy.
// To have DNS options set along with hostNetwork, you have to specify DNS policy
// explicitly to 'ClusterFirstWithHostNet'.
// +optional
DNSPolicy corev1.DNSPolicy `json:"dnsPolicy,omitempty" protobuf:"bytes,6,opt,name=dnsPolicy,casttype=DNSPolicy"`
// Specifies the DNS parameters of a pod.
// Parameters specified here will be merged to the generated DNS
// configuration based on DNSPolicy.
// +optional
DNSConfig *corev1.PodDNSConfig `json:"dnsConfig,omitempty"`
// Host networking requested for this pod. Use the host's network namespace.
// If this option is set, the ports that will be used must be specified.
// Default to false.
// +k8s:conversion-gen=false
// +optional
HostNetwork bool `json:"hostNetwork,omitempty"`
// Use the host's pid namespace.
// Optional: Default to false.
// +k8s:conversion-gen=false
// +optional
HostPID bool `json:"hostPID,omitempty"`
// Environment variables for all Datadog Agents.
// See also: https://docs.datadoghq.com/agent/docker/?tab=standard#environment-variables
//
// +optional
// +listType=map
// +listMapKey=name
Env []corev1.EnvVar `json:"env,omitempty"`
// Trace Agent configuration
// +optional
Apm *APMSpec `json:"apm,omitempty"`
// Log Agent configuration
// +optional
Log *LogCollectionConfig `json:"log,omitempty"`
// Process Agent configuration
// +optional
Process *ProcessSpec `json:"process,omitempty"`
// SystemProbe configuration
// +optional
SystemProbe *SystemProbeSpec `json:"systemProbe,omitempty"`
// Security Agent configuration
// +optional
Security *SecuritySpec `json:"security,omitempty"`
// Allow to put custom configuration for the agent, corresponding to the datadog.yaml config file.
// See https://docs.datadoghq.com/agent/guide/agent-configuration-files/?tab=agentv6 for more details.
// +optional
CustomConfig *CustomConfigSpec `json:"customConfig,omitempty"`
// Provide Agent Network Policy configuration
// +optional
NetworkPolicy *NetworkPolicySpec `json:"networkPolicy,omitempty"`
// If specified, the pod's scheduling constraints.
// +optional
Affinity *corev1.Affinity `json:"affinity,omitempty"`
// Options to customize the internal traffic policy service
// +optional
LocalService *LocalService `json:"localService,omitempty"`
}
// RbacConfig contains RBAC configuration.
// +k8s:openapi-gen=true
type RbacConfig struct {
// Used to configure RBAC resources creation.
Create *bool `json:"create,omitempty"`
// Used to set up the service account name to use.
// Ignored if the field Create is true.
ServiceAccountName *string `json:"serviceAccountName,omitempty"`
}
// DaemonSetDeploymentStrategy contains the node Agent deployment configuration.
// +k8s:openapi-gen=true
type DaemonSetDeploymentStrategy struct {
// The update strategy used for the DaemonSet.
UpdateStrategyType *appsv1.DaemonSetUpdateStrategyType `json:"updateStrategyType,omitempty"`
// Configure the rolling updater strategy of the DaemonSet or the ExtendedDaemonSet.
RollingUpdate DaemonSetRollingUpdateSpec `json:"rollingUpdate,omitempty"`
// Configure the canary deployment configuration using ExtendedDaemonSet.
Canary *edsdatadoghqv1alpha1.ExtendedDaemonSetSpecStrategyCanary `json:"canary,omitempty"`
// The reconcile frequency of the ExtendDaemonSet.
ReconcileFrequency *metav1.Duration `json:"reconcileFrequency,omitempty"`
}
// DaemonSetRollingUpdateSpec contains configuration fields of the rolling update strategy.
// The configuration is shared between DaemonSet and ExtendedDaemonSet.
// +k8s:openapi-gen=true
type DaemonSetRollingUpdateSpec struct {
// The maximum number of DaemonSet pods that can be unavailable during the
// update. Value can be an absolute number (ex: 5) or a percentage of total
// number of DaemonSet pods at the start of the update (ex: 10%). Absolute
// number is calculated from percentage by rounding up.
// This cannot be 0.
// Default value is 1.
MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty"`
// MaxPodSchedulerFailure the maxinum number of not scheduled on its Node due to a
// scheduler failure: resource constraints. Value can be an absolute number (ex: 5) or a percentage of total
// number of DaemonSet pods at the start of the update (ex: 10%). Absolute
MaxPodSchedulerFailure *intstr.IntOrString `json:"maxPodSchedulerFailure,omitempty"`
// The maxium number of pods created in parallel.
// Default value is 250.
MaxParallelPodCreation *int32 `json:"maxParallelPodCreation,omitempty"`
// SlowStartIntervalDuration the duration between to 2
// Default value is 1min.
SlowStartIntervalDuration *metav1.Duration `json:"slowStartIntervalDuration,omitempty"`
// SlowStartAdditiveIncrease
// Value can be an absolute number (ex: 5) or a percentage of total
// number of DaemonSet pods at the start of the update (ex: 10%).
// Default value is 5.
SlowStartAdditiveIncrease *intstr.IntOrString `json:"slowStartAdditiveIncrease,omitempty"`
}
// APMSpec contains the Trace Agent configuration.
// +k8s:openapi-gen=true
type APMSpec struct {
// Enable this to enable APM and tracing, on port 8126.
// See also: https://github.com/DataDog/docker-dd-agent#tracing-from-the-host
// +optional
Enabled *bool `json:"enabled,omitempty"`
// Number of port to expose on the host.
// If specified, this must be a valid port number, 0 < x < 65536.
// If HostNetwork is specified, this must match ContainerPort.
// Most containers do not need this.
//
// +optional
HostPort *int32 `json:"hostPort,omitempty"`
// UnixDomainSocket socket configuration.
// See also: https://docs.datadoghq.com/agent/kubernetes/apm/?tab=helm#agent-environment-variables
// +optional
UnixDomainSocket *APMUnixDomainSocketSpec `json:"unixDomainSocket,omitempty"`
// The Datadog Agent supports many environment variables.
// See also: https://docs.datadoghq.com/agent/docker/?tab=standard#environment-variables
//
// +optional
// +listType=map
// +listMapKey=name
Env []corev1.EnvVar `json:"env,omitempty"`
// Specify additional volume mounts in the APM Agent container.
// +optional
// +listType=map
// +listMapKey=name
// +listMapKey=mountPath
VolumeMounts []corev1.VolumeMount `json:"volumeMounts,omitempty"`
// Datadog APM Agent resource requests and limits.
// Make sure to keep requests and limits equal to keep the pods in the Guaranteed QoS class.
// See also: http://kubernetes.io/docs/user-guide/compute-resources/
Resources *corev1.ResourceRequirements `json:"resources,omitempty"`
// Command allows the specification of custom entrypoint for Trace Agent container
// +listType=atomic
Command []string `json:"command,omitempty"`
// Args allows the specification of extra args to `Command` parameter
// +listType=atomic
Args []string `json:"args,omitempty"`
// Configure the Liveness Probe of the APM container
// +optional
LivenessProbe *corev1.Probe `json:"livenessProbe,omitempty"`
}
// APMUnixDomainSocketSpec contains the APM Unix Domain Socket configuration.
// +k8s:openapi-gen=true
type APMUnixDomainSocketSpec struct {
// Enable APM over Unix Domain Socket
// See also: https://docs.datadoghq.com/agent/kubernetes/apm/?tab=helm#agent-environment-variables
// +optional
Enabled *bool `json:"enabled,omitempty"`
// Define the host APM socket filepath used when APM over Unix Domain Socket is enabled.
// (default value: /var/run/datadog/apm.sock)
// See also: https://docs.datadoghq.com/agent/kubernetes/apm/?tab=helm#agent-environment-variables
// +optional
HostFilepath *string `json:"hostFilepath,omitempty"`
}
// LogCollectionConfig contains the Log Agent configuration.
// +k8s:openapi-gen=true
type LogCollectionConfig struct {
// Enable this option to activate Datadog Agent log collection.
// See also: https://docs.datadoghq.com/agent/basic_agent_usage/kubernetes/#log-collection-setup
//
// +optional
Enabled *bool `json:"enabled,omitempty"`
// Enable this option to allow log collection for all containers.
// See also: https://docs.datadoghq.com/agent/basic_agent_usage/kubernetes/#log-collection-setup
//
// +optional
LogsConfigContainerCollectAll *bool `json:"logsConfigContainerCollectAll,omitempty"`
// Collect logs from files in `/var/log/pods instead` of using the container runtime API.
// Collecting logs from files is usually the most efficient way of collecting logs.
// See also: https://docs.datadoghq.com/agent/basic_agent_usage/kubernetes/#log-collection-setup
// Default is true
//
// +optional
ContainerCollectUsingFiles *bool `json:"containerCollectUsingFiles,omitempty"`
// Allows log collection from the container log path. Set to a different path if you are not using the Docker runtime.
// See also: https://docs.datadoghq.com/agent/kubernetes/daemonset_setup/?tab=k8sfile#create-manifest
// Defaults to `/var/lib/docker/containers`
//
// +optional
ContainerLogsPath *string `json:"containerLogsPath,omitempty"`
// Allows log collection from pod log path.
// Defaults to `/var/log/pods`.
//
// +optional
PodLogsPath *string `json:"podLogsPath,omitempty"`
// Allows the log collection to use symbolic links in this directory to
// validate container ID -> pod.
// Defaults to `/var/log/containers`
//
// +optional
ContainerSymlinksPath *string `json:"containerSymlinksPath,omitempty"`
// This path (always mounted from the host) is used by Datadog Agent to store information about processed log files.
// If the Datadog Agent is restarted, it starts tailing the log files immediately.
// Default to `/var/lib/datadog-agent/logs`
//
// +optional
TempStoragePath *string `json:"tempStoragePath,omitempty"`
// Sets the maximum number of log files that the Datadog Agent tails. Increasing this limit can
// increase resource consumption of the Agent.
// See also: https://docs.datadoghq.com/agent/basic_agent_usage/kubernetes/#log-collection-setup
// Default is 100
//
// +optional
OpenFilesLimit *int32 `json:"openFilesLimit,omitempty"`
}
// ProcessSpec contains the Process Agent configuration.
// +k8s:openapi-gen=true
type ProcessSpec struct {
// Enable this to activate the process-agent to collection live-containers and if activated process information.
// Enable the Process Agent container.
// See also: https://docs.datadoghq.com/infrastructure/process/?tab=kubernetes#installation
//
// +optional
Enabled *bool `json:"enabled,omitempty"`
// false (default): Only collect containers if available.
// true: collect process information as well.
// Note: If enabled, /etc/passwd is automatically mounted to allow username resolution.
ProcessCollectionEnabled *bool `json:"processCollectionEnabled,omitempty"`
// The Datadog Agent supports many environment variables.
// See also: https://docs.datadoghq.com/agent/docker/?tab=standard#environment-variables
//
// +optional
// +listType=map
// +listMapKey=name
Env []corev1.EnvVar `json:"env,omitempty"`
// Specify additional volume mounts in the Process Agent container.
// +optional
// +listType=map
// +listMapKey=name
// +listMapKey=mountPath
VolumeMounts []corev1.VolumeMount `json:"volumeMounts,omitempty"`
// Datadog Process Agent resource requests and limits.
// Make sure to keep requests and limits equal to keep the pods in the Guaranteed QoS class.
// See also: http://kubernetes.io/docs/user-guide/compute-resources/
Resources *corev1.ResourceRequirements `json:"resources,omitempty"`
// Command allows the specification of custom entrypoint for Process Agent container
// +listType=atomic
Command []string `json:"command,omitempty"`
// Args allows the specification of extra args to `Command` parameter
// +listType=atomic
Args []string `json:"args,omitempty"`
}
// KubeStateMetricsCore contains the required parameters to enable and override the configuration
// of the Kubernetes State Metrics Core check.
// +k8s:openapi-gen=true
type KubeStateMetricsCore struct {
// Enable this to start the Kubernetes State Metrics Core check.
// Refer to https://docs.datadoghq.com/integrations/kubernetes_state_core
// +optional
Enabled *bool `json:"enabled,omitempty"`
// To override the configuration for the default Kubernetes State Metrics Core check.
// Must point to a ConfigMap containing a valid cluster check configuration.
Conf *CustomConfigSpec `json:"conf,omitempty"`
// ClusterCheck configures the Kubernetes State Metrics Core check as a cluster check.
// +optional
ClusterCheck *bool `json:"clusterCheck,omitempty"`
}
// OrchestratorExplorerConfig contains the orchestrator explorer configuration.
// The orchestratorExplorer runs in the process-agent and DCA.
// +k8s:openapi-gen=true
type OrchestratorExplorerConfig struct {
// Enable this to activate live Kubernetes monitoring.
// See also: https://docs.datadoghq.com/infrastructure/livecontainers/#kubernetes-resources
//
// +optional
Enabled *bool `json:"enabled,omitempty"`
// To override the configuration for the default Orchestrator Explorer check.
// Must point to a ConfigMap containing a valid cluster check configuration.
Conf *CustomConfigSpec `json:"conf,omitempty"`
// ClusterCheck configures the Orchestrator Explorer check as a cluster check.
// +optional
ClusterCheck *bool `json:"clusterCheck,omitempty"`
// +optional
// Option to disable scrubbing of sensitive container data (passwords, tokens, etc. ).
Scrubbing *Scrubbing `json:"scrubbing,omitempty"`
// +optional
// Additional endpoints for shipping the collected data as json in the form of {"https://process.agent.datadoghq.com": ["apikey1", ...], ...}'.
AdditionalEndpoints *string `json:"additionalEndpoints,omitempty"`
// +optional
// Set this for the Datadog endpoint for the orchestrator explorer
DDUrl *string `json:"ddUrl,omitempty"`
// +optional
// +listType=set
// Additional tags for the collected data in the form of `a b c`
// Difference to DD_TAGS: this is a cluster agent option that is used to define custom cluster tags
ExtraTags []string `json:"extraTags,omitempty"`
}
// Scrubbing contains configuration to enable or disable scrubbing options
type Scrubbing struct {
// Deactivate this to stop the scrubbing of sensitive container data (passwords, tokens, etc. ).
Containers *bool `json:"containers,omitempty"`
}
// PrometheusScrapeConfig allows configuration of the Prometheus Autodiscovery feature.
// +k8s:openapi-gen=true
type PrometheusScrapeConfig struct {
// Enable autodiscovering pods and services exposing prometheus metrics.
// +optional
Enabled *bool `json:"enabled,omitempty"`
// ServiceEndpoints enables generating dedicated checks for service endpoints.
// +optional
ServiceEndpoints *bool `json:"serviceEndpoints,omitempty"`
// AdditionalConfigs allows adding advanced prometheus check configurations with custom discovery rules.
// +optional
AdditionalConfigs *string `json:"additionalConfigs,omitempty"`
}
// NetworkMonitoringConfig allows configuration of network performance monitoring.
type NetworkMonitoringConfig struct {
Enabled *bool `json:"enabled,omitempty"`
}
// SystemProbeSpec contains the SystemProbe Agent configuration.
// +k8s:openapi-gen=true
type SystemProbeSpec struct {
// Enable this to activate live process monitoring.
// Note: /etc/passwd is automatically mounted to allow username resolution.
// See also: https://docs.datadoghq.com/infrastructure/process/?tab=kubernetes#installation
// +optional
Enabled *bool `json:"enabled,omitempty"`
// SecCompRootPath specify the seccomp profile root directory.
// +optional
SecCompRootPath string `json:"secCompRootPath,omitempty"`
// SecCompCustomProfileConfigMap specify a pre-existing ConfigMap containing a custom SecComp profile.
// This ConfigMap must contain a file named system-probe-seccomp.json.
// +optional
SecCompCustomProfileConfigMap string `json:"secCompCustomProfileConfigMap,omitempty"`
// SecCompProfileName specify a seccomp profile.
// +optional
SecCompProfileName string `json:"secCompProfileName,omitempty"`
// AppArmorProfileName specify a apparmor profile.
// +optional
AppArmorProfileName string `json:"appArmorProfileName,omitempty"`
// ConntrackEnabled enable the system-probe agent to connect to the netlink/conntrack subsystem to add NAT information to connection data.
// See also: http://conntrack-tools.netfilter.org/
ConntrackEnabled *bool `json:"conntrackEnabled,omitempty"`
// BPFDebugEnabled logging for kernel debug.
BPFDebugEnabled *bool `json:"bpfDebugEnabled,omitempty"`
// DebugPort Specify the port to expose pprof and expvar for system-probe agent.
DebugPort int32 `json:"debugPort,omitempty"`
// EnableTCPQueueLength enables the TCP queue length eBPF-based check.
EnableTCPQueueLength *bool `json:"enableTCPQueueLength,omitempty"`
// EnableOOMKill enables the OOM kill eBPF-based check.
EnableOOMKill *bool `json:"enableOOMKill,omitempty"`
// CollectDNSStats enables DNS stat collection.
CollectDNSStats *bool `json:"collectDNSStats,omitempty"`
// Enable custom configuration for system-probe, corresponding to the system-probe.yaml config file.
// This custom configuration has less priority than all settings above.
// +optional
CustomConfig *CustomConfigSpec `json:"customConfig,omitempty"`
// The Datadog SystemProbe supports many environment variables.
// See also: https://docs.datadoghq.com/agent/docker/?tab=standard#environment-variables
//
// +optional
// +listType=map
// +listMapKey=name
Env []corev1.EnvVar `json:"env,omitempty"`
// Specify additional volume mounts in the Security Agent container.
// +optional
// +listType=map
// +listMapKey=name
// +listMapKey=mountPath
VolumeMounts []corev1.VolumeMount `json:"volumeMounts,omitempty"`
// Datadog SystemProbe resource requests and limits.
// Make sure to keep requests and limits equal to keep the pods in the Guaranteed QoS class.
// See also: http://kubernetes.io/docs/user-guide/compute-resources/
Resources *corev1.ResourceRequirements `json:"resources,omitempty"`
// Command allows the specification of custom entrypoint for System Probe container
// +listType=atomic
Command []string `json:"command,omitempty"`
// Args allows the specification of extra args to `Command` parameter
// +listType=atomic
Args []string `json:"args,omitempty"`
// You can modify the security context used to run the containers by
// modifying the label type.
// +optional
SecurityContext *corev1.SecurityContext `json:"securityContext,omitempty"`
}
// SecuritySpec contains the Security Agent configuration.
// +k8s:openapi-gen=true
type SecuritySpec struct {
// Compliance configuration.
// +optional
Compliance ComplianceSpec `json:"compliance,omitempty"`
// Runtime security configuration.
// +optional
Runtime RuntimeSecuritySpec `json:"runtime,omitempty"`
// The Datadog Security Agent supports many environment variables.
// See also: https://docs.datadoghq.com/agent/docker/?tab=standard#environment-variables
//
// +optional
// +listType=map
// +listMapKey=name
Env []corev1.EnvVar `json:"env,omitempty"`
// Specify additional volume mounts in the Security Agent container.
// +optional
// +listType=map
// +listMapKey=name
// +listMapKey=mountPath
VolumeMounts []corev1.VolumeMount `json:"volumeMounts,omitempty"`
// Datadog Security Agent resource requests and limits.
// Make sure to keep requests and limits equal to keep the pods in the Guaranteed QoS class.
// See also: http://kubernetes.io/docs/user-guide/compute-resources/
Resources *corev1.ResourceRequirements `json:"resources,omitempty"`
// Command allows the specification of custom entrypoint for Security Agent container
// +listType=atomic
Command []string `json:"command,omitempty"`
// Args allows the specification of extra args to `Command` parameter
// +listType=atomic
Args []string `json:"args,omitempty"`
}
// ComplianceSpec contains configuration for continuous compliance.
// +k8s:openapi-gen=true
type ComplianceSpec struct {
// Enables continuous compliance monitoring.
// +optional
Enabled *bool `json:"enabled,omitempty"`
// Check interval.
// +optional
CheckInterval *metav1.Duration `json:"checkInterval,omitempty"`
// Config dir containing compliance benchmarks.
// +optional
ConfigDir *ConfigDirSpec `json:"configDir,omitempty"`
}
// RuntimeSecuritySpec contains configuration for runtime security features.
// +k8s:openapi-gen=true
type RuntimeSecuritySpec struct {
// Enables runtime security features.
// +optional
Enabled *bool `json:"enabled,omitempty"`
// ConfigDir containing security policies.
// +optional
PoliciesDir *ConfigDirSpec `json:"policiesDir,omitempty"`
// Syscall monitor configuration.
// +optional
SyscallMonitor *SyscallMonitorSpec `json:"syscallMonitor,omitempty"`
}
// SyscallMonitorSpec contains configuration for syscall monitor.
// +k8s:openapi-gen=true
type SyscallMonitorSpec struct {
// Enabled enables syscall monitor
// +optional
Enabled *bool `json:"enabled,omitempty"`
}
// ConfigDirSpec contains config file directory configuration.
// +k8s:openapi-gen=true
type ConfigDirSpec struct {
// ConfigMapName name of a ConfigMap used to mount a directory.
ConfigMapName string `json:"configMapName,omitempty"`
// items mapping between configMap data key and file path mount.
// +optional
// +listType=map
// +listMapKey=key
Items []corev1.KeyToPath `json:"items,omitempty"`
}
// ConfigFileConfigMapSpec contains configMap information used to store a config file.
// +k8s:openapi-gen=true
type ConfigFileConfigMapSpec struct {
// The name of source ConfigMap.
Name string `json:"name,omitempty"`
// FileKey corresponds to the key used in the ConfigMap.Data to store the configuration file content.
FileKey string `json:"fileKey,omitempty"`
}
// CustomConfigSpec Allow to put custom configuration for the agent, corresponding to the datadog-cluster.yaml or datadog.yaml config file
// the configuration can be provided in the 'configData' field as raw data, or in a configmap thanks to `configMap` field.
// Important: `configData` and `configMap` can't be set together.
// +k8s:openapi-gen=true
type CustomConfigSpec struct {
// ConfigData corresponds to the configuration file content.
ConfigData *string `json:"configData,omitempty"`
// Enable to specify a reference to an already existing ConfigMap.
ConfigMap *ConfigFileConfigMapSpec `json:"configMap,omitempty"`
}
// NodeAgentConfig contains the configuration of the Node Agent.
// +k8s:openapi-gen=true
type NodeAgentConfig struct {
// Pod-level SecurityContext.
// +optional
SecurityContext *corev1.PodSecurityContext `json:"securityContext,omitempty"`
// The host of the Datadog intake server to send Agent data to, only set this option
// if you need the Agent to send data to a custom URL.
// Overrides the site setting defined in "site".
// +optional
DDUrl *string `json:"ddUrl,omitempty"`
// Set logging verbosity, valid log levels are:
// trace, debug, info, warn, error, critical, and off
LogLevel *string `json:"logLevel,omitempty"`
// Confd configuration allowing to specify config files for custom checks placed under /etc/datadog-agent/conf.d/.
// See https://docs.datadoghq.com/agent/guide/agent-configuration-files/?tab=agentv6 for more details.
// +optional
Confd *ConfigDirSpec `json:"confd,omitempty"`
// Checksd configuration allowing to specify custom checks placed under /etc/datadog-agent/checks.d/
// See https://docs.datadoghq.com/agent/guide/agent-configuration-files/?tab=agentv6 for more details.
// +optional
Checksd *ConfigDirSpec `json:"checksd,omitempty"`
// Provide a mapping of Kubernetes Namespace Labels to Datadog Tags.
// <KUBERNETES_LABEL>: <DATADOG_TAG_KEY>
// +optional
NamespaceLabelsAsTags map[string]string `json:"namespaceLabelsAsTags,omitempty"`
// Provide a mapping of Kubernetes Node Labels to Datadog Tags.
// <KUBERNETES_LABEL>: <DATADOG_TAG_KEY>
// +optional
NodeLabelsAsTags map[string]string `json:"nodeLabelsAsTags,omitempty"`
// Provide a mapping of Kubernetes Pod Labels to Datadog Tags.
// <KUBERNETES_LABEL>: <DATADOG_TAG_KEY>
// +optional
PodLabelsAsTags map[string]string `json:"podLabelsAsTags,omitempty"`
// Provide a mapping of Kubernetes Pod Annotations to Datadog Tags.
// <KUBERNETES_ANNOTATIONS>: <DATADOG_TAG_KEY>
// +optional
PodAnnotationsAsTags map[string]string `json:"podAnnotationsAsTags,omitempty"`
// List of tags to attach to every metric, event and service check collected by this Agent.
// Learn more about tagging: https://docs.datadoghq.com/tagging/
// +optional
// +listType=set
Tags []string `json:"tags,omitempty"`
// Enables this to start event collection from the Kubernetes API.
// See also: https://docs.datadoghq.com/agent/kubernetes/event_collection/
// +optional
CollectEvents *bool `json:"collectEvents,omitempty"`
// Enables leader election mechanism for event collection.
// +optional
LeaderElection *bool `json:"leaderElection,omitempty"`
// The Datadog Agent supports many environment variables.
// See also: https://docs.datadoghq.com/agent/docker/?tab=standard#environment-variables
//
// +optional
// +listType=map
// +listMapKey=name
Env []corev1.EnvVar `json:"env,omitempty"`
// Specify additional volume mounts in the Datadog Agent container.
// +optional
// +listType=map
// +listMapKey=name
// +listMapKey=mountPath
VolumeMounts []corev1.VolumeMount `json:"volumeMounts,omitempty"`
// Specify additional volumes in the Datadog Agent container.
// +optional
// +listType=map
// +listMapKey=name
Volumes []corev1.Volume `json:"volumes,omitempty"`
// Datadog Agent resource requests and limits.
// Make sure to keep requests and limits equal to keep the pods in the Guaranteed QoS class.
// See also: http://kubernetes.io/docs/user-guide/compute-resources/
Resources *corev1.ResourceRequirements `json:"resources,omitempty"`
// Command allows the specification of custom entrypoint for the Agent container
// +listType=atomic
Command []string `json:"command,omitempty"`
// Args allows the specification of extra args to `Command` parameter
// +listType=atomic
Args []string `json:"args,omitempty"`
// Configure the Liveness Probe of the Agent container
// +optional
LivenessProbe *corev1.Probe `json:"livenessProbe,omitempty"`
// Configure the Readiness Probe of the Agent container
// +optional
ReadinessProbe *corev1.Probe `json:"readinessProbe,omitempty"`
// HealthPort of the Agent container for internal liveness probe.
// Must be the same as the Liveness/Readiness probes.
// +optional
HealthPort *int32 `json:"healthPort,omitempty"`
// Configure the CRI Socket.
CriSocket *CRISocketConfig `json:"criSocket,omitempty"`
// Configure Dogstatsd.
Dogstatsd *DogstatsdConfig `json:"dogstatsd,omitempty"`
// If specified, the Agent pod's tolerations.
// +optional
// +listType=atomic
Tolerations []corev1.Toleration `json:"tolerations,omitempty"`
// Number of port to expose on the host.
// If specified, this must be a valid port number, 0 < x < 65536.
// If HostNetwork is specified, this must match ContainerPort.
// Most containers do not need this.
//
// +optional
HostPort *int32 `json:"hostPort,omitempty"`
// KubeletConfig contains the Kubelet configuration parameters
// +optional
Kubelet *KubeletConfig `json:"kubelet,omitempty"`
}
// KubeletConfig contains the Kubelet configuration parameters
// +k8s:openapi-gen=true
type KubeletConfig struct {
// Override host used to contact Kubelet API (default to status.hostIP)
// +optional
Host *corev1.EnvVarSource `json:"host,omitempty"`
// Toggle kubelet TLS verification (default to true)
// +optional
TLSVerify *bool `json:"tlsVerify,omitempty"`
// Path (on host) where the Kubelet CA certificate is stored
// +optional
HostCAPath string `json:"hostCAPath,omitempty"`
// Path (inside Agent containers) where the Kubelet CA certificate is stored
// Default to /var/run/host-kubelet-ca.crt if hostCAPath else /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
// +optional
AgentCAPath string `json:"agentCAPath,omitempty"`
}
// CRISocketConfig contains the CRI socket configuration parameters.
// +k8s:openapi-gen=true
type CRISocketConfig struct {
// Path to the docker runtime socket.
// +optional
DockerSocketPath *string `json:"dockerSocketPath,omitempty"`
// Path to the container runtime socket (if different from Docker).
// This is supported starting from agent 6.6.0.
// +optional
CriSocketPath *string `json:"criSocketPath,omitempty"`
}
// DogstatsdConfig contains the Dogstatsd configuration parameters.
// +k8s:openapi-gen=true
type DogstatsdConfig struct {
// Enable origin detection for container tagging.
// See also: https://docs.datadoghq.com/developers/dogstatsd/unix_socket/#using-origin-detection-for-container-tagging
// +optional
DogstatsdOriginDetection *bool `json:"dogstatsdOriginDetection,omitempty"`
// Configure the Dogstatsd Unix Domain Socket.
// See also: https://docs.datadoghq.com/developers/dogstatsd/unix_socket/
// +optional
UnixDomainSocket *DSDUnixDomainSocketSpec `json:"unixDomainSocket,omitempty"`
// Configure the Dogstasd Mapper Profiles.
// Can be passed as raw data or via a json encoded string in a config map.
// See also: https://docs.datadoghq.com/developers/dogstatsd/dogstatsd_mapper/
// +optional
MapperProfiles *CustomConfigSpec `json:"mapperProfiles,omitempty"`
}
// DSDUnixDomainSocketSpec contains the Dogstatsd Unix Domain Socket configuration.
// +k8s:openapi-gen=true
type DSDUnixDomainSocketSpec struct {
// Enable APM over Unix Domain Socket.
// See also: https://docs.datadoghq.com/developers/dogstatsd/unix_socket/
// +optional
Enabled *bool `json:"enabled,omitempty"`
// Define the host APM socket filepath used when APM over Unix Domain Socket is enabled.
// (default value: /var/run/datadog/statsd.sock).
// See also: https://docs.datadoghq.com/developers/dogstatsd/unix_socket/
// +optional
HostFilepath *string `json:"hostFilepath,omitempty"`
}
// DatadogAgentSpecClusterAgentSpec defines the desired state of the cluster Agent.
// +k8s:openapi-gen=true
type DatadogAgentSpecClusterAgentSpec struct {
// Enabled
Enabled *bool `json:"enabled,omitempty"`
// The container image of the Datadog Cluster Agent.
Image *ImageConfig `json:"image,omitempty"`
// Name of the Cluster Agent Deployment to create or migrate from.
// +optional
DeploymentName string `json:"deploymentName,omitempty"`
// Cluster Agent configuration.
Config *ClusterAgentConfig `json:"config,omitempty"`
// Allow to put custom configuration for the Agent, corresponding to the datadog-cluster.yaml config file.
// +optional
CustomConfig *CustomConfigSpec `json:"customConfig,omitempty"`
// RBAC configuration of the Datadog Cluster Agent.
Rbac *RbacConfig `json:"rbac,omitempty"`
// Number of the Cluster Agent replicas.
Replicas *int32 `json:"replicas,omitempty"`
// AdditionalAnnotations provide annotations that will be added to the Cluster Agent Pods.
AdditionalAnnotations map[string]string `json:"additionalAnnotations,omitempty"`
// AdditionalLabels provide labels that will be added to the Cluster Agent Pods.
AdditionalLabels map[string]string `json:"additionalLabels,omitempty"`
// KeepLabels allows the specification of labels not managed by the Operator that will be kept on ClusterAgent Deployment.
// All labels containing 'datadoghq.com' are always included. This field uses glob syntax.
KeepLabels string `json:"keepLabels,omitempty"`
// KeepAnnotations allows the specification of annotations not managed by the Operator that will be kept on ClusterAgent Deployment.
// All annotations containing 'datadoghq.com' are always included. This field uses glob syntax.
KeepAnnotations string `json:"keepAnnotations,omitempty"`
// If specified, indicates the pod's priority. "system-node-critical" and "system-cluster-critical"
// are two special keywords which indicate the highest priorities with the former being the highest priority.
// Any other name must be defined by creating a PriorityClass object with that name. If not specified,