oneagent

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OneAgentTenantSecretSuffix            = "-oneagent-tenant-secret"
	OneAgentConnectionInfoConfigMapSuffix = "-oneagent-connection-info"
	PodNameOsAgent                        = "oneagent"
	DefaultOneAgentImageRegistrySubPath   = "/linux/oneagent"
	StorageVolumeDefaultHostPath          = "/var/opt/dynatrace"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AppInjectionSpec

type AppInjectionSpec struct {
	// Define resources requests and limits for the initContainer. For details, see Managing resources for containers
	// (https://kubernetes.io/docs/concepts/configuration/manage-resources-containers).
	// +kubebuilder:validation:Optional
	// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Resource Requirements",order=15,xDescriptors={"urn:alm:descriptor:com.tectonic.ui:advanced","urn:alm:descriptor:com.tectonic.ui:resourceRequirements"}
	InitResources *corev1.ResourceRequirements `json:"initResources,omitempty"`

	// Use a custom OneAgent CodeModule image to download binaries.
	// +kubebuilder:validation:Optional
	// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="CodeModulesImage",order=12,xDescriptors={"urn:alm:descriptor:com.tectonic.ui:advanced","urn:alm:descriptor:com.tectonic.ui:text"}
	CodeModulesImage string `json:"codeModulesImage,omitempty"`

	// Applicable only for applicationMonitoring or cloudNativeFullStack configuration types. The namespaces where you want Dynatrace Operator to inject.
	// For more information, see Configure monitoring for namespaces and pods (https://www.dynatrace.com/support/help/setup-and-configuration/setup-on-container-platforms/kubernetes/get-started-with-kubernetes-monitoring/dto-config-options-k8s#annotate).
	// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Namespace Selector",order=17,xDescriptors="urn:alm:descriptor:com.tectonic.ui:selector:core:v1:Namespace"
	NamespaceSelector metav1.LabelSelector `json:"namespaceSelector,omitempty"`
}

+kubebuilder:object:generate=true

func (*AppInjectionSpec) DeepCopy

func (in *AppInjectionSpec) DeepCopy() *AppInjectionSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppInjectionSpec.

func (*AppInjectionSpec) DeepCopyInto

func (in *AppInjectionSpec) DeepCopyInto(out *AppInjectionSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ApplicationMonitoringSpec

type ApplicationMonitoringSpec struct {

	// Use a specific OneAgent CodeModule version. Defaults to the latest version from the Dynatrace cluster.
	// +kubebuilder:validation:Optional
	// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="OneAgent version",order=11,xDescriptors={"urn:alm:descriptor:com.tectonic.ui:advanced","urn:alm:descriptor:com.tectonic.ui:text"}
	Version string `json:"version,omitempty"`

	AppInjectionSpec `json:",inline"`
}

+kubebuilder:object:generate=true

func (*ApplicationMonitoringSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApplicationMonitoringSpec.

func (*ApplicationMonitoringSpec) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type CloudNativeFullStackSpec

type CloudNativeFullStackSpec struct {
	HostInjectSpec   `json:",inline"`
	AppInjectionSpec `json:",inline"`
}

+kubebuilder:object:generate=true

func (*CloudNativeFullStackSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CloudNativeFullStackSpec.

func (*CloudNativeFullStackSpec) DeepCopyInto

func (in *CloudNativeFullStackSpec) DeepCopyInto(out *CloudNativeFullStackSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type CodeModulesStatus

type CodeModulesStatus struct {
	status.VersionStatus `json:",inline"`
}

+kubebuilder:object:generate=true

func (*CodeModulesStatus) DeepCopy

func (in *CodeModulesStatus) DeepCopy() *CodeModulesStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CodeModulesStatus.

func (*CodeModulesStatus) DeepCopyInto

func (in *CodeModulesStatus) DeepCopyInto(out *CodeModulesStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type CommunicationHostStatus

type CommunicationHostStatus struct {
	// Connection protocol
	Protocol string `json:"protocol,omitempty"`

	// Host domain
	Host string `json:"host,omitempty"`

	// Connection port
	Port uint32 `json:"port,omitempty"`
}

+kubebuilder:object:generate=true

func (*CommunicationHostStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CommunicationHostStatus.

func (*CommunicationHostStatus) DeepCopyInto

func (in *CommunicationHostStatus) DeepCopyInto(out *CommunicationHostStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ConnectionInfoStatus

type ConnectionInfoStatus struct {
	// Information for communicating with the tenant
	communication.ConnectionInfo `json:",inline"`

	// List of communication hosts
	CommunicationHosts []CommunicationHostStatus `json:"communicationHosts,omitempty"`
}

+kubebuilder:object:generate=true

func (*ConnectionInfoStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConnectionInfoStatus.

func (*ConnectionInfoStatus) DeepCopyInto

func (in *ConnectionInfoStatus) DeepCopyInto(out *ConnectionInfoStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type HostInjectSpec

type HostInjectSpec struct {

	// Add custom OneAgent annotations.
	// +kubebuilder:validation:Optional
	// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Annotations",order=27,xDescriptors={"urn:alm:descriptor:com.tectonic.ui:advanced","urn:alm:descriptor:com.tectonic.ui:text"}
	Annotations map[string]string `json:"annotations,omitempty"`

	// Your defined labels for OneAgent pods in order to structure workloads as desired.
	// +kubebuilder:validation:Optional
	// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Labels",order=26,xDescriptors={"urn:alm:descriptor:com.tectonic.ui:advanced","urn:alm:descriptor:com.tectonic.ui:text"}
	Labels map[string]string `json:"labels,omitempty"`

	// Specify the node selector that controls on which nodes OneAgent will be deployed.
	// +kubebuilder:validation:Optional
	// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Node Selector",order=17,xDescriptors="urn:alm:descriptor:com.tectonic.ui:selector:Node"
	NodeSelector map[string]string `json:"nodeSelector,omitempty"`

	// Deprecated: This field will be removed in a future release.
	// Disables automatic restarts of OneAgent pods in case a new version is available (https://www.dynatrace.com/support/help/setup-and-configuration/setup-on-container-platforms/kubernetes/get-started-with-kubernetes-monitoring#disable-auto).
	// Enabled by default.
	// +kubebuilder:validation:Optional
	// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Automatically update Agent",order=13,xDescriptors={"urn:alm:descriptor:com.tectonic.ui:advanced","urn:alm:descriptor:com.tectonic.ui:booleanSwitch"}
	AutoUpdate *bool `json:"autoUpdate"`

	// Use a specific OneAgent version. Defaults to the latest version from the Dynatrace cluster.
	// +kubebuilder:validation:Optional
	// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="OneAgent version",order=11,xDescriptors={"urn:alm:descriptor:com.tectonic.ui:advanced","urn:alm:descriptor:com.tectonic.ui:text"}
	Version string `json:"version,omitempty"`

	// Use a custom OneAgent image. Defaults to the latest image from the Dynatrace cluster.
	// +kubebuilder:validation:Optional
	// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Image",order=12,xDescriptors={"urn:alm:descriptor:com.tectonic.ui:advanced","urn:alm:descriptor:com.tectonic.ui:text"}
	Image string `json:"image,omitempty"`

	// Set the DNS Policy for OneAgent pods. For details, see Pods DNS Policy (https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-s-dns-policy).
	// +kubebuilder:validation:Optional
	// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="DNS Policy",order=24,xDescriptors={"urn:alm:descriptor:com.tectonic.ui:advanced","urn:alm:descriptor:com.tectonic.ui:text"}
	DNSPolicy corev1.DNSPolicy `json:"dnsPolicy,omitempty"`

	// Assign a priority class to the OneAgent pods. By default, no class is set.
	// For details, see Pod Priority and Preemption (https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/).
	// +kubebuilder:validation:Optional
	// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Priority Class name",order=23,xDescriptors={"urn:alm:descriptor:com.tectonic.ui:advanced","urn:alm:descriptor:io.kubernetes:PriorityClass"}
	PriorityClassName string `json:"priorityClassName,omitempty"`

	// The SecComp Profile that will be configured in order to run in secure computing mode.
	// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="OneAgent SecComp Profile",order=17,xDescriptors="urn:alm:descriptor:com.tectonic.ui:selector:core:v1:Namespace"
	SecCompProfile string `json:"secCompProfile,omitempty"`

	// StorageHostPath is the writable directory on the host filesystem where OneAgent configurations will be stored.
	// +kubebuilder:validation:Optional
	// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="StorageHostPath",order=28,xDescriptors={"urn:alm:descriptor:com.tectonic.ui:advanced","urn:alm:descriptor:com.tectonic.ui:hidden"}
	StorageHostPath string `json:"storageHostPath,omitempty"`

	// Resource settings for OneAgent container. Consumption of the OneAgent heavily depends on the workload to monitor. You can use the default settings in the CR.
	// Note: resource.requests shows the values needed to run; resource.limits shows the maximum limits for the pod.
	// +kubebuilder:validation:Optional
	// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Resource Requirements",order=20,xDescriptors={"urn:alm:descriptor:com.tectonic.ui:advanced","urn:alm:descriptor:com.tectonic.ui:resourceRequirements"}
	OneAgentResources corev1.ResourceRequirements `json:"oneAgentResources,omitempty"`

	// Tolerations to include with the OneAgent DaemonSet. For details, see Taints and Tolerations (https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/).
	// +kubebuilder:validation:Optional
	// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Tolerations",order=18,xDescriptors={"urn:alm:descriptor:com.tectonic.ui:advanced","urn:alm:descriptor:com.tectonic.ui:hidden"}
	Tolerations []corev1.Toleration `json:"tolerations,omitempty"`

	// Set additional environment variables for the OneAgent pods.
	// +kubebuilder:validation:Optional
	// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="OneAgent environment variable installer arguments",order=22,xDescriptors={"urn:alm:descriptor:com.tectonic.ui:advanced","urn:alm:descriptor:com.tectonic.ui:hidden"}
	Env []corev1.EnvVar `json:"env,omitempty"`

	// Set additional arguments to the OneAgent installer.
	// For available options, see Linux custom installation (https://www.dynatrace.com/support/help/setup-and-configuration/dynatrace-oneagent/installation-and-operation/linux/installation/customize-oneagent-installation-on-linux).
	// For the list of limitations, see Limitations (https://www.dynatrace.com/support/help/setup-and-configuration/setup-on-container-platforms/docker/set-up-dynatrace-oneagent-as-docker-container#limitations).
	// +kubebuilder:validation:Optional
	// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="OneAgent installer arguments",order=21,xDescriptors={"urn:alm:descriptor:com.tectonic.ui:advanced","urn:alm:descriptor:com.tectonic.ui:hidden"}
	// +listType=set
	Args []string `json:"args,omitempty"`
}

+kubebuilder:object:generate=true

func (*HostInjectSpec) DeepCopy

func (in *HostInjectSpec) DeepCopy() *HostInjectSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HostInjectSpec.

func (*HostInjectSpec) DeepCopyInto

func (in *HostInjectSpec) DeepCopyInto(out *HostInjectSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Instance

type Instance struct {
	// Name of the OneAgent pod
	PodName string `json:"podName,omitempty"`

	// IP address of the pod
	IPAddress string `json:"ipAddress,omitempty"`
}

+kubebuilder:object:generate=true

func (*Instance) DeepCopy

func (in *Instance) DeepCopy() *Instance

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Instance.

func (*Instance) DeepCopyInto

func (in *Instance) DeepCopyInto(out *Instance)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Mode

type Mode string

type OneAgent

type OneAgent struct {
	*Spec
	*Status
	*CodeModulesStatus
	// contains filtered or unexported fields
}

func NewOneAgent

func NewOneAgent(spec *Spec, status *Status, codeModulesStatus *CodeModulesStatus,
	name, apiURLHost string,
	featureOneAgentPrivileged, featureOneAgentSkipLivenessProbe, featureBootstrapperInjection bool) *OneAgent

func (*OneAgent) GetArguments

func (oa *OneAgent) GetArguments() []string

func (*OneAgent) GetArgumentsMap

func (oa *OneAgent) GetArgumentsMap() map[string][]string

func (*OneAgent) GetCodeModulesImage

func (oa *OneAgent) GetCodeModulesImage() string

GetCodeModulesImage provides the image reference set in Status for the CodeModules. Format: repo@sha256:digest.

func (*OneAgent) GetCodeModulesVersion

func (oa *OneAgent) GetCodeModulesVersion() string

GetCodeModulesVersion provides version set in Status for the CodeModules.

func (*OneAgent) GetConnectionInfoConfigMapName

func (oa *OneAgent) GetConnectionInfoConfigMapName() string

func (*OneAgent) GetCustomCodeModulesImage

func (oa *OneAgent) GetCustomCodeModulesImage() string

GetCustomCodeModulesImage provides the image reference for the CodeModules provided in the Spec.

func (*OneAgent) GetCustomCodeModulesVersion

func (oa *OneAgent) GetCustomCodeModulesVersion() string

GetCustomCodeModulesVersion provides the version for the CodeModules provided in the Spec.

func (*OneAgent) GetCustomImage

func (oa *OneAgent) GetCustomImage() string

GetCustomImage provides the image reference for the OneAgent provided in the Spec.

func (*OneAgent) GetCustomVersion

func (oa *OneAgent) GetCustomVersion() string

GetCustomVersion provides the version for the OneAgent provided in the Spec.

func (*OneAgent) GetDaemonsetName

func (oa *OneAgent) GetDaemonsetName() string

func (*OneAgent) GetDefaultImage

func (oa *OneAgent) GetDefaultImage(version string) string

GetDefaultImage provides the image reference for the OneAgent from tenant registry.

func (*OneAgent) GetEndpoints

func (oa *OneAgent) GetEndpoints() string

func (*OneAgent) GetEnvironment

func (oa *OneAgent) GetEnvironment() []corev1.EnvVar

func (*OneAgent) GetHostGroup

func (oa *OneAgent) GetHostGroup() string

func (*OneAgent) GetHostGroupAsParam

func (oa *OneAgent) GetHostGroupAsParam() string

func (*OneAgent) GetHostPath

func (oa *OneAgent) GetHostPath() string

GetHostPath provides the host path for the storage volume if CSI driver is absent.

func (*OneAgent) GetImage

func (oa *OneAgent) GetImage() string

GetImage provides the image reference set in Status for the OneAgent. Format: repo@sha256:digest.

func (*OneAgent) GetInitResources

func (oa *OneAgent) GetInitResources() *corev1.ResourceRequirements

func (*OneAgent) GetNamespaceSelector

func (oa *OneAgent) GetNamespaceSelector() *metav1.LabelSelector

func (*OneAgent) GetNodeSelector

func (oa *OneAgent) GetNodeSelector(fallbackNodeSelector map[string]string) map[string]string

func (*OneAgent) GetSecCompProfile

func (oa *OneAgent) GetSecCompProfile() string

func (*OneAgent) GetTenantSecret

func (oa *OneAgent) GetTenantSecret() string

GetTenantSecret returns the name of the secret containing the token for the OneAgent.

func (*OneAgent) GetVersion

func (oa *OneAgent) GetVersion() string

GetVersion provides version set in Status for the OneAgent.

func (*OneAgent) IsAppInjectionNeeded

func (oa *OneAgent) IsAppInjectionNeeded() bool

func (*OneAgent) IsApplicationMonitoringMode

func (oa *OneAgent) IsApplicationMonitoringMode() bool

IsApplicationMonitoringMode returns true when application only section is used.

func (*OneAgent) IsAutoUpdateEnabled

func (oa *OneAgent) IsAutoUpdateEnabled() bool

IsAutoUpdateEnabled returns true if the Operator should update OneAgent instances automatically.

func (*OneAgent) IsCSIAvailable

func (oa *OneAgent) IsCSIAvailable() bool

func (*OneAgent) IsClassicFullStackMode

func (oa *OneAgent) IsClassicFullStackMode() bool

IsClassicFullStackMode returns true when classic fullstack section is used.

func (*OneAgent) IsCloudNativeFullstackMode

func (oa *OneAgent) IsCloudNativeFullstackMode() bool

IsCloudNativeFullstackMode returns true when cloud native fullstack section is used.

func (*OneAgent) IsCommunicationRouteClear

func (oa *OneAgent) IsCommunicationRouteClear() bool

func (*OneAgent) IsDaemonsetRequired

func (oa *OneAgent) IsDaemonsetRequired() bool

IsDaemonsetRequired returns true when a feature requires OneAgent instances.

func (*OneAgent) IsHostMonitoringMode

func (oa *OneAgent) IsHostMonitoringMode() bool

IsHostMonitoringMode returns true when host monitoring section is used.

func (*OneAgent) IsLivenessProbeNeeded

func (oa *OneAgent) IsLivenessProbeNeeded() bool

func (*OneAgent) IsPrivilegedNeeded

func (oa *OneAgent) IsPrivilegedNeeded() bool

func (*OneAgent) IsReadOnlyFSSupported

func (oa *OneAgent) IsReadOnlyFSSupported() bool

func (*OneAgent) IsReadinessProbeNeeded

func (oa *OneAgent) IsReadinessProbeNeeded() bool

type Spec

type Spec struct {
	// Has a single OneAgent per node via DaemonSet.
	// Injection is performed via the same OneAgent DaemonSet.
	// +nullable
	ClassicFullStack *HostInjectSpec `json:"classicFullStack,omitempty"`

	// Has a single OneAgent per node via DaemonSet.
	// dynatrace-webhook injects into application pods based on labeled namespaces.
	// Has a CSI driver per node via DaemonSet to provide binaries to pods.
	// +nullable
	CloudNativeFullStack *CloudNativeFullStackSpec `json:"cloudNativeFullStack,omitempty"`

	// dynatrace-webhook injects into application pods based on labeled namespaces.
	// Has an optional CSI driver per node via DaemonSet to provide binaries to pods.
	// +nullable
	ApplicationMonitoring *ApplicationMonitoringSpec `json:"applicationMonitoring,omitempty"`

	// Has a single OneAgent per node via DaemonSet.
	// Doesn't inject into application pods.
	// +nullable
	HostMonitoring *HostInjectSpec `json:"hostMonitoring,omitempty"`

	// Sets a host group for OneAgent.
	// +kubebuilder:validation:Optional
	// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Host Group",order=5,xDescriptors={"urn:alm:descriptor:com.tectonic.ui:advanced","urn:alm:descriptor:com.tectonic.ui:text"}
	HostGroup string `json:"hostGroup,omitempty"`
}

+kubebuilder:object:generate=true

func (*Spec) DeepCopy

func (in *Spec) DeepCopy() *Spec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Spec.

func (*Spec) DeepCopyInto

func (in *Spec) DeepCopyInto(out *Spec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Status

type Status struct {
	status.VersionStatus `json:",inline"`

	// List of deployed OneAgent instances
	Instances map[string]Instance `json:"instances,omitempty"`

	// Time of the last instance status update
	LastInstanceStatusUpdate *metav1.Time `json:"lastInstanceStatusUpdate,omitempty"`

	// Commands used for OneAgent's readiness probe
	// +kubebuilder:validation:Type=object
	// +kubebuilder:validation:Schemaless
	// +kubebuilder:pruning:PreserveUnknownFields
	Healthcheck *containerv1.HealthConfig `json:"healthcheck,omitempty"`

	// Information about OneAgent's connections
	ConnectionInfoStatus ConnectionInfoStatus `json:"connectionInfoStatus,omitempty"`
}

+kubebuilder:object:generate=true

func (*Status) DeepCopy

func (in *Status) DeepCopy() *Status

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Status.

func (*Status) DeepCopyInto

func (in *Status) DeepCopyInto(out *Status)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

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