Documentation
¶
Index ¶
- Constants
- func BuildEnvVarFromSecret(name, key string) *corev1.EnvVarSource
- func BuildEnvVarFromSource(name string, source *corev1.EnvVarSource) *corev1.EnvVar
- func GetAgentLocalServiceSelector(dda metav1.Object) map[string]string
- func GetAgentVersion(dda metav1.Object) string
- func GetAgentVersionFromImage(imageConfig v2alpha1.AgentImageConfig) string
- func GetComponentVersion(dda metav1.Object, componentName v2alpha1.ComponentName) string
- func GetDefaultLabels(owner metav1.Object, componentKind, instanceName, version string) map[string]string
- func GetDefaultMetadata(owner metav1.Object, componentKind, instanceName, version string, ...) (map[string]string, map[string]string, *metav1.LabelSelector)
- func GetDefaultSeccompConfigMapName(dda metav1.Object) string
- func GetInstallInfoConfigMapName(dda metav1.Object) string
- func GetOtelAgentGatewayServiceSelector(dda metav1.Object) map[string]string
- func GetVolumeForAuth() corev1.Volume
- func GetVolumeForCertificates() corev1.Volume
- func GetVolumeForCgroups() corev1.Volume
- func GetVolumeForChecksd() corev1.Volume
- func GetVolumeForConfd() corev1.Volume
- func GetVolumeForConfig() corev1.Volume
- func GetVolumeForDogstatsd() corev1.Volume
- func GetVolumeForLogs() corev1.Volume
- func GetVolumeForProc() corev1.Volume
- func GetVolumeForRmCorechecks() corev1.Volume
- func GetVolumeForRunPath() corev1.Volume
- func GetVolumeForRuntimeSocket() corev1.Volume
- func GetVolumeForSeccomp() corev1.Volume
- func GetVolumeForSecurity(owner metav1.Object) corev1.Volume
- func GetVolumeForTmp() corev1.Volume
- func GetVolumeInstallInfo(owner metav1.Object) corev1.Volume
- func GetVolumeMountForAuth(readOnly bool) corev1.VolumeMount
- func GetVolumeMountForCertificates() corev1.VolumeMount
- func GetVolumeMountForCgroups() corev1.VolumeMount
- func GetVolumeMountForChecksd() corev1.VolumeMount
- func GetVolumeMountForConfd() corev1.VolumeMount
- func GetVolumeMountForConfig() corev1.VolumeMount
- func GetVolumeMountForDogstatsdSocket(readOnly bool) corev1.VolumeMount
- func GetVolumeMountForInstallInfo() corev1.VolumeMount
- func GetVolumeMountForLogs() corev1.VolumeMount
- func GetVolumeMountForProc() corev1.VolumeMount
- func GetVolumeMountForRmCorechecks() corev1.VolumeMount
- func GetVolumeMountForRunPath() corev1.VolumeMount
- func GetVolumeMountForRuntimeSocket(readOnly bool) corev1.VolumeMount
- func GetVolumeMountForSeccomp() corev1.VolumeMount
- func GetVolumeMountForSecurity() corev1.VolumeMount
- func GetVolumeMountForTmp() corev1.VolumeMount
- func MergeAffinities(affinity1 *v1.Affinity, affinity2 *v1.Affinity) *v1.Affinity
- func NewDeployment(owner metav1.Object, componentKind, componentName, version string, ...) *appsv1.Deployment
- func ShouldCreateAgentLocalService(versionInfo *version.Info, forceEnableLocalService bool) bool
Constants ¶
const ( DatadogTokenOldResourceName = "datadogtoken" // Kept for backward compatibility with agent <7.37.0 DatadogLeaderElectionOldResourceName = "datadog-leader-election" // Kept for backward compatibility with agent <7.37.0 DatadogCustomMetricsResourceName = "datadog-custom-metrics" DatadogClusterIDResourceName = "datadog-cluster-id" ExtensionAPIServerAuthResourceName = "extension-apiserver-authentication" KubeSystemResourceName = "kube-system" NodeAgentSuffix = "node" ChecksRunnerSuffix = "ccr" ClusterAgentSuffix = "dca" CustomResourceDefinitionsName = "customresourcedefinitions" DefaultAgentInstallType = "k8s_manual" )
Resource names
const ( APMTelemetryConfigMapName = "datadog-apm-telemetry-kpi" APMTelemetryInstallIdKey = "install_id" APMTelemetryInstallTimeKey = "install_time" APMTelemetryInstallTypeKey = "install_type" )
APM Telemetry
const ( AppArmorAnnotationKey = "container.apparmor.security.beta.kubernetes.io" SystemProbeAppArmorAnnotationKey = "container.apparmor.security.beta.kubernetes.io/system-probe" SystemProbeAppArmorAnnotationValue = "unconfined" )
Annotations
const ( // ClusterAgentReconcileConditionType ReconcileConditionType for Cluster Agent component ClusterAgentReconcileConditionType = "ClusterAgentReconcile" // AgentReconcileConditionType ReconcileConditionType for Agent component AgentReconcileConditionType = "AgentReconcile" // ClusterChecksRunnerReconcileConditionType ReconcileConditionType for Cluster Checks Runner component ClusterChecksRunnerReconcileConditionType = "ClusterChecksRunnerReconcile" // OtelAgentGatewayReconcileConditionType ReconcileConditionType for OTel Agent Gateway component OtelAgentGatewayReconcileConditionType = "OtelAgentGatewayReconcile" // OverrideReconcileConflictConditionType ReconcileConditionType for override conflict OverrideReconcileConflictConditionType = "OverrideReconcileConflict" // DatadogAgentReconcileErrorConditionType ReconcileConditionType for DatadogAgent reconcile error DatadogAgentReconcileErrorConditionType = "DatadogAgentReconcileError" )
Condition types
const ( // DefaultTokenKey default token key (use in secret for instance). DefaultTokenKey = "token" // DefaultClusterAgentServicePort default cluster-agent service port DefaultClusterAgentServicePort = 5005 // DefaultDogstatsdPort default dogstatsd port DefaultDogstatsdPort = 8125 // DefaultSystemProbeSocketPath default System Probe socket path DefaultSystemProbeSocketPath string = "/var/run/sysprobe/sysprobe.sock" )
const ( ConfdVolumeName = "confd" ConfdVolumePath = "/conf.d" ConfigVolumeName = "config" ConfigVolumePath = "/etc/datadog-agent" ChecksdVolumeName = "checksd" ChecksdVolumePath = "/checks.d" HostRootVolumeName = "hostroot" HostRootHostPath = "/" HostRootMountPath = "/host/root" GroupVolumeName = "group" GroupHostPath = "/etc/group" GroupMountPath = "/etc/group" PasswdVolumeName = "passwd" PasswdHostPath = "/etc/passwd" PasswdMountPath = "/etc/passwd" ProcdirVolumeName = "procdir" ProcdirHostPath = "/proc" ProcdirMountPath = "/host/proc" CgroupsVolumeName = "cgroups" CgroupsHostPath = "/sys/fs/cgroup" CgroupsMountPath = "/host/sys/fs/cgroup" SystemProbeOSReleaseDirVolumeName = "host-osrelease" SystemProbeOSReleaseDirVolumePath = "/etc/os-release" SystemProbeOSReleaseDirMountPath = "/host/etc/os-release" SystemProbeSocketVolumeName = "sysprobe-socket-dir" SystemProbeSocketVolumePath = "/var/run/sysprobe" DebugfsVolumeName = "debugfs" // same path on host and container DebugfsPath = "/sys/kernel/debug" ModulesVolumeName = "modules" // same path on host and container ModulesVolumePath = "/lib/modules" SrcVolumeName = "src" // same path on host and container SrcVolumePath = "/usr/src" LogDatadogVolumeName = "logdatadog" LogDatadogVolumePath = "/var/log/datadog" DefaultLogTempStoragePath = "/var/lib/datadog-agent/logs" TmpVolumeName = "tmp" TmpVolumePath = "/tmp" CertificatesVolumeName = "certificates" CertificatesVolumePath = "/etc/datadog-agent/certificates" AuthVolumeName = "datadog-agent-auth" AuthVolumePath = "/etc/datadog-agent/auth" InstallInfoVolumeName = "installinfo" InstallInfoVolumeSubPath = "install_info" InstallInfoVolumePath = "/etc/datadog-agent/install_info" InstallInfoVolumeReadOnly = true DogstatsdSocketVolumeName = "dsdsocket" DogstatsdAPMSocketHostPath = "/var/run/datadog" DogstatsdSocketLocalPath = "/var/run/datadog" DogstatsdSocketName = "dsd.socket" HostCriSocketPathPrefix = "/host" CriSocketVolumeName = "runtimesocketdir" RuntimeDirVolumePath = "/var/run" KubeletAgentCAPath = "/var/run/host-kubelet-ca.crt" KubeletPodResourcesVolumeName = "kubelet-pod-resources" APMSocketVolumeName = "apmsocket" APMSocketName = "apm.socket" SeccompSecurityVolumeName = "datadog-agent-security" SeccompSecurityVolumePath = "/etc/config" SeccompRootVolumeName = "seccomp-root" SeccompRootVolumePath = "/host/var/lib/kubelet/seccomp" SeccompRootPath = "/var/lib/kubelet/seccomp" SystemProbeSeccompKey = "system-probe-seccomp.json" SystemProbeAgentSecurityConfigMapSuffixName = "system-probe-seccomp" SystemProbeSeccompProfileName = "system-probe" HostRunVolumeName = "hostrun" HostRunPath = "/run" HostRunMountPath = "/host/run" RunPathVolumeName = "pointerdir" RunPathVolumeMount = "/opt/datadog-agent/run" )
Volumes and paths
const ( // FieldPathSpecNodeName used as FieldPath for selecting the NodeName FieldPathSpecNodeName = "spec.nodeName" // FieldPathStatusHostIP used as FieldPath to retrieve the host ip FieldPathStatusHostIP = "status.hostIP" // FieldPathStatusPodIP used as FieldPath to retrieve the pod ip FieldPathStatusPodIP = "status.podIP" // FieldPathMetaName used as FieldPath to retrieve the pod name FieldPathMetaName = "metadata.name" )
Field paths
const ( DDAPMEnabled = "DD_APM_ENABLED" DDAPMInstrumentationInstallTime = "DD_INSTRUMENTATION_INSTALL_TIME" DDAPMInstrumentationInstallId = "DD_INSTRUMENTATION_INSTALL_ID" DDAPMInstrumentationInstallType = "DD_INSTRUMENTATION_INSTALL_TYPE" DDAPMErrorTrackingStandaloneEnabled = "DD_APM_ERROR_TRACKING_STANDALONE_ENABLED" DDClusterAgentEnabled = "DD_CLUSTER_AGENT_ENABLED" DDClusterAgentKubeServiceName = "DD_CLUSTER_AGENT_KUBERNETES_SERVICE_NAME" DDClusterAgentURL = "DD_CLUSTER_AGENT_URL" DDClusterAgentTokenName = "DD_CLUSTER_AGENT_TOKEN_NAME" DDAuthTokenFilePath = "DD_AUTH_TOKEN_FILE_PATH" DDContainerCollectionEnabled = "DD_PROCESS_CONFIG_CONTAINER_COLLECTION_ENABLED" DDDogstatsdEnabled = "DD_USE_DOGSTATSD" DDHealthPort = "DD_HEALTH_PORT" DDHostRootEnvVar = "HOST_ROOT" DDKubeletHost = "DD_KUBERNETES_KUBELET_HOST" DDLeaderElection = "DD_LEADER_ELECTION" DDLogsEnabled = "DD_LOGS_ENABLED" DDProcessCollectionEnabled = "DD_PROCESS_CONFIG_PROCESS_COLLECTION_ENABLED" DDProcessConfigRunInCoreAgent = "DD_PROCESS_CONFIG_RUN_IN_CORE_AGENT_ENABLED" DDSystemProbeEnabled = "DD_SYSTEM_PROBE_ENABLED" DDSystemProbeExternal = "DD_SYSTEM_PROBE_EXTERNAL" DDSystemProbeSocket = "DD_SYSPROBE_SOCKET" DDADPEnabled = "DD_ADP_ENABLED" DDKubernetesPodResourcesSocket = "DD_KUBERNETES_KUBELET_PODRESOURCES_SOCKET" DDCELWorkloadExclude = "DD_CEL_WORKLOAD_EXCLUDE" // KubernetesEnvvarName Env var used by the Datadog Agent container entrypoint // to add kubelet config provider and listener KubernetesEnvVar = "KUBERNETES" //common )
Variables ¶
This section is empty.
Functions ¶
func BuildEnvVarFromSecret ¶
func BuildEnvVarFromSecret(name, key string) *corev1.EnvVarSource
BuildEnvVarFromSecret return an corev1.EnvVarSource correspond to a secret reference
func BuildEnvVarFromSource ¶
func BuildEnvVarFromSource(name string, source *corev1.EnvVarSource) *corev1.EnvVar
BuildEnvVarFromSource return an *corev1.EnvVar from a Env Var name and *corev1.EnvVarSource
func GetAgentLocalServiceSelector ¶
GetAgentLocalServiceSelector creates the selector to be used for the agent local service
func GetAgentVersion ¶
GetAgentVersion return the Agent version based on the DatadogAgent info
func GetAgentVersionFromImage ¶
func GetAgentVersionFromImage(imageConfig v2alpha1.AgentImageConfig) string
GetAgentVersionFromImage returns the Agent version based on the AgentImageConfig
func GetComponentVersion ¶ added in v1.23.0
func GetComponentVersion(dda metav1.Object, componentName v2alpha1.ComponentName) string
GetComponentVersion returns the component version based on the DDA spec. It returns the default latest version if no override is specified.
func GetDefaultLabels ¶
func GetDefaultMetadata ¶
func GetDefaultSeccompConfigMapName ¶
GetDefaultSeccompConfigMapName returns the default seccomp configmap name based on the DatadogAgent name
func GetInstallInfoConfigMapName ¶
GetInstallInfoConfigMapName return the InstallInfo config map name base on the dda name
func GetOtelAgentGatewayServiceSelector ¶ added in v1.23.0
func GetVolumeForAuth ¶
GetVolumeForAuth return the Volume container authentication information
func GetVolumeForCertificates ¶
GetVolumeForCertificates return the Volume use to store certificates
func GetVolumeForCgroups ¶
GetVolumeForCgroups returns the volume that contains the cgroup directory
func GetVolumeForChecksd ¶
GetVolumeForChecksd return the volume that contains the agent confd config files
func GetVolumeForConfd ¶
GetVolumeForConfd return the volume that contains the agent confd config files
func GetVolumeForConfig ¶
GetVolumeForConfig return the volume that contains the agent config
func GetVolumeForDogstatsd ¶
GetVolumeForDogstatsd returns the volume with the Dogstatsd socket
func GetVolumeForLogs ¶
GetVolumeForLogs return the Volume that should container generated logs
func GetVolumeForProc ¶
GetVolumeForProc returns the volume with /proc
func GetVolumeForRmCorechecks ¶
GetVolumeForRmCorechecks return the volume that overwrites the corecheck directory
func GetVolumeForRunPath ¶ added in v1.22.0
GetVolumeForRunPath returns the volume for the agent run path
func GetVolumeForRuntimeSocket ¶
GetVolumeForRuntimeSocket returns the Volume for the runtime socket
func GetVolumeForSeccomp ¶
GetVolumeForSeccomp returns the volume for seccomp root
func GetVolumeForSecurity ¶
GetVolumeForSecurity returns the Volume for datadog-agent-security
func GetVolumeForTmp ¶
GetVolumeForTmp return the Volume use for /tmp
func GetVolumeInstallInfo ¶
GetVolumeInstallInfo return the Volume that should install-info file
func GetVolumeMountForAuth ¶
func GetVolumeMountForAuth(readOnly bool) corev1.VolumeMount
GetVolumeMountForAuth returns the VolumeMount that contains the authentication information
func GetVolumeMountForCertificates ¶
func GetVolumeMountForCertificates() corev1.VolumeMount
GetVolumeMountForCertificates return the VolumeMount use to store certificates
func GetVolumeMountForCgroups ¶
func GetVolumeMountForCgroups() corev1.VolumeMount
GetVolumeMountForCgroups returns the VolumeMount that contains the cgroups info
func GetVolumeMountForChecksd ¶
func GetVolumeMountForChecksd() corev1.VolumeMount
GetVolumeMountForChecksd return the VolumeMount that contains the agent checksd config files
func GetVolumeMountForConfd ¶
func GetVolumeMountForConfd() corev1.VolumeMount
GetVolumeMountForConfd return the VolumeMount that contains the agent confd config files
func GetVolumeMountForConfig ¶
func GetVolumeMountForConfig() corev1.VolumeMount
GetVolumeMountForConfig return the VolumeMount that contains the agent config
func GetVolumeMountForDogstatsdSocket ¶
func GetVolumeMountForDogstatsdSocket(readOnly bool) corev1.VolumeMount
GetVolumeMountForDogstatsdSocket returns the VolumeMount with the Dogstatsd socket
func GetVolumeMountForInstallInfo ¶
func GetVolumeMountForInstallInfo() corev1.VolumeMount
GetVolumeMountForInstallInfo return the VolumeMount that contains the agent install-info file
func GetVolumeMountForLogs ¶
func GetVolumeMountForLogs() corev1.VolumeMount
GetVolumeMountForLogs return the VolumeMount for the container generated logs
func GetVolumeMountForProc ¶
func GetVolumeMountForProc() corev1.VolumeMount
GetVolumeMountForProc returns the VolumeMount that contains /proc
func GetVolumeMountForRmCorechecks ¶
func GetVolumeMountForRmCorechecks() corev1.VolumeMount
GetVolumeMountForRmCorechecks return the VolumeMount that overwrites the corechecks directory
func GetVolumeMountForRunPath ¶ added in v1.22.0
func GetVolumeMountForRunPath() corev1.VolumeMount
GetVolumeMountForRunPath returns the VolumeMount for the run path
func GetVolumeMountForRuntimeSocket ¶
func GetVolumeMountForRuntimeSocket(readOnly bool) corev1.VolumeMount
GetVolumeMountForRuntimeSocket returns the VolumeMount with the runtime socket
func GetVolumeMountForSeccomp ¶
func GetVolumeMountForSeccomp() corev1.VolumeMount
GetVolumeMountForSeccomp returns the VolumeMount for seccomp root
func GetVolumeMountForSecurity ¶
func GetVolumeMountForSecurity() corev1.VolumeMount
GetVolumeMountForSecurity returns the VolumeMount for datadog-agent-security
func GetVolumeMountForTmp ¶
func GetVolumeMountForTmp() corev1.VolumeMount
GetVolumeMountForTmp return the VolumeMount for /tmp
func MergeAffinities ¶ added in v1.16.0
func NewDeployment ¶
func NewDeployment(owner metav1.Object, componentKind, componentName, version string, inputSelector *metav1.LabelSelector) *appsv1.Deployment
NewDeployment use to generate the skeleton of a new deployment based on few information
Types ¶
This section is empty.