common

package
v1.9.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConfName

func GetConfName(owner metav1.Object, conf *CustomConfig, defaultName string) string

GetConfName get the name of the Configmap for a CustomConfigSpec

Types

type AgentContainerName

type AgentContainerName string

AgentContainerName is the name of a container inside an Agent component

const (
	// InitVolumeContainerName is the name of the Init Volume init container
	InitVolumeContainerName AgentContainerName = "init-volume"
	// InitConfigContainerName is the name of the Init config Volume init container
	InitConfigContainerName AgentContainerName = "init-config"
	// SeccompSetupContainerName is the name of the Seccomp Setup init container
	SeccompSetupContainerName AgentContainerName = "seccomp-setup"

	// UnprivilegedSingleAgentContainerName is the name of a container which may run
	// any combination of Core, Trace and Process Agent processes in a single container.
	UnprivilegedSingleAgentContainerName AgentContainerName = "unprivileged-single-agent"
	// CoreAgentContainerName is the name of the Core Agent container
	CoreAgentContainerName AgentContainerName = "agent"
	// TraceAgentContainerName is the name of the Trace Agent container
	TraceAgentContainerName AgentContainerName = "trace-agent"
	// ProcessAgentContainerName is the name of the Process Agent container
	ProcessAgentContainerName AgentContainerName = "process-agent"
	// SecurityAgentContainerName is the name of the Security Agent container
	SecurityAgentContainerName AgentContainerName = "security-agent"
	// SystemProbeContainerName is the name of the System Probe container
	SystemProbeContainerName AgentContainerName = "system-probe"
	// OtelAgent is the name of the OTel container
	OtelAgent AgentContainerName = "otel-agent"
	// AllContainers is used internally to reference all containers in the pod
	AllContainers AgentContainerName = "all"
	// ClusterAgentContainerName is the name of the Cluster Agent container
	ClusterAgentContainerName AgentContainerName = "cluster-agent"

	// ClusterChecksRunnersContainerName is the name of the Agent container in Cluster Checks Runners
	ClusterChecksRunnersContainerName AgentContainerName = "agent"

	// FIPSProxyContainerName is the name of the FIPS Proxy container
	FIPSProxyContainerName AgentContainerName = "fips-proxy"
)

type AgentImageConfig

type AgentImageConfig struct {
	// Define the image to use:
	// Use "gcr.io/datadoghq/agent:latest" for Datadog Agent 7.
	// Use "datadog/dogstatsd:latest" for standalone Datadog Agent DogStatsD 7.
	// Use "gcr.io/datadoghq/cluster-agent:latest" for Datadog Cluster Agent.
	// Use "agent" with the registry and tag configurations for <registry>/agent:<tag>.
	// Use "cluster-agent" with the registry and tag configurations for <registry>/cluster-agent:<tag>.
	// If the name is the full image string—`<name>:<tag>` or `<registry>/<name>:<tag>`, then `tag`, `jmxEnabled`,
	// and `global.registry` values are ignored.
	// Otherwise, image string is created by overriding default settings with supplied `name`, `tag`, and `jmxEnabled` values;
	// image string is created using default registry unless `global.registry` is configured.
	Name string `json:"name,omitempty"`

	// Define the image tag to use.
	// To be used if the Name field does not correspond to a full image string.
	// +optional
	Tag string `json:"tag,omitempty"`

	// Define whether the Agent image should support JMX.
	// To be used if the Name field does not correspond to a full image string.
	// +optional
	JMXEnabled bool `json:"jmxEnabled,omitempty"`

	// The Kubernetes pull policy:
	// Use Always, Never, or IfNotPresent.
	PullPolicy *corev1.PullPolicy `json:"pullPolicy,omitempty"`

	// It is possible to specify Docker registry credentials.
	// See https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod
	// +optional
	PullSecrets *[]corev1.LocalObjectReference `json:"pullSecrets,omitempty"`
}

AgentImageConfig defines the agent container image config. +kubebuilder:object:generate=true

func (*AgentImageConfig) DeepCopy

func (in *AgentImageConfig) DeepCopy() *AgentImageConfig

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

func (*AgentImageConfig) DeepCopyInto

func (in *AgentImageConfig) DeepCopyInto(out *AgentImageConfig)

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

type ConfigMapConfig

type ConfigMapConfig struct {
	// Name is the name of the ConfigMap.
	Name string `json:"name,omitempty"`

	// Items maps a ConfigMap data `key` to a file `path` mount.
	// +listType=map
	// +listMapKey=key
	// +optional
	Items []corev1.KeyToPath `json:"items,omitempty"`
}

ConfigMapConfig contains ConfigMap information used to store a configuration file. +kubebuilder:object:generate=true

func (*ConfigMapConfig) DeepCopy

func (in *ConfigMapConfig) DeepCopy() *ConfigMapConfig

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

func (*ConfigMapConfig) DeepCopyInto

func (in *ConfigMapConfig) DeepCopyInto(out *ConfigMapConfig)

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

type CustomConfig

type CustomConfig struct {
	// ConfigData corresponds to the configuration file content.
	// +optional
	ConfigData *string
	// Enable to specify a reference to an already existing ConfigMap.
	// +optional
	ConfigMap *ConfigMapConfig
}

CustomConfig allows one to put custom configurations for the agent. +kubebuilder:object:generate=true

func (*CustomConfig) DeepCopy

func (in *CustomConfig) DeepCopy() *CustomConfig

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

func (*CustomConfig) DeepCopyInto

func (in *CustomConfig) DeepCopyInto(out *CustomConfig)

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

type DaemonSetStatus

type DaemonSetStatus struct {
	// Number of desired pods in the DaemonSet.
	Desired int32 `json:"desired"`

	// Number of current pods in the DaemonSet.
	Current int32 `json:"current"`

	// Number of ready pods in the DaemonSet.
	Ready int32 `json:"ready"`

	// Number of available pods in the DaemonSet.
	Available int32 `json:"available"`

	// Number of up to date pods in the DaemonSet.
	UpToDate int32 `json:"upToDate"`

	// LastUpdate is the last time the status was updated.
	LastUpdate *metav1.Time `json:"lastUpdate,omitempty"`

	// CurrentHash is the stored hash of the DaemonSet.
	CurrentHash string `json:"currentHash,omitempty"`

	// Status corresponds to the DaemonSet computed status.
	Status string `json:"status,omitempty"`

	// State corresponds to the DaemonSet state.
	State string `json:"state,omitempty"`

	// DaemonsetName corresponds to the name of the created DaemonSet.
	DaemonsetName string `json:"daemonsetName,omitempty"`
}

DaemonSetStatus defines the observed state of Agent running as DaemonSet. +k8s:openapi-gen=true +kubebuilder:object:generate=true

func (*DaemonSetStatus) DeepCopy

func (in *DaemonSetStatus) DeepCopy() *DaemonSetStatus

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

func (*DaemonSetStatus) DeepCopyInto

func (in *DaemonSetStatus) DeepCopyInto(out *DaemonSetStatus)

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

type DeploymentStatus

type DeploymentStatus struct {
	// Total number of non-terminated pods targeted by this Deployment (their labels match the selector).
	// +optional
	Replicas int32 `json:"replicas,omitempty"`

	// Total number of non-terminated pods targeted by this Deployment that have the desired template spec.
	// +optional
	UpdatedReplicas int32 `json:"updatedReplicas,omitempty"`

	// Total number of ready pods targeted by this Deployment.
	// +optional
	ReadyReplicas int32 `json:"readyReplicas,omitempty"`

	// Total number of available pods (ready for at least minReadySeconds) targeted by this Deployment.
	// +optional
	AvailableReplicas int32 `json:"availableReplicas,omitempty"`

	// Total number of unavailable pods targeted by this Deployment. This is the total number of
	// pods that are still required for the Deployment to have 100% available capacity. They may
	// either be pods that are running but not yet available or pods that still have not been created.
	// +optional
	UnavailableReplicas int32 `json:"unavailableReplicas,omitempty"`

	// LastUpdate is the last time the status was updated.
	LastUpdate *metav1.Time `json:"lastUpdate,omitempty"`

	// CurrentHash is the stored hash of the Deployment.
	CurrentHash string `json:"currentHash,omitempty"`

	// GeneratedToken corresponds to the generated token if any token was provided in the Credential configuration when ClusterAgent is
	// enabled.
	// +optional
	GeneratedToken string `json:"generatedToken,omitempty"`

	// Status corresponds to the Deployment computed status.
	Status string `json:"status,omitempty"`

	// State corresponds to the Deployment state.
	State string `json:"state,omitempty"`

	// DeploymentName corresponds to the name of the Deployment.
	DeploymentName string `json:"deploymentName,omitempty"`
}

DeploymentStatus type representing a Deployment status. +k8s:openapi-gen=true +kubebuilder:object:generate=true

func (*DeploymentStatus) DeepCopy

func (in *DeploymentStatus) DeepCopy() *DeploymentStatus

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

func (*DeploymentStatus) DeepCopyInto

func (in *DeploymentStatus) DeepCopyInto(out *DeploymentStatus)

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

type KubeletConfig

type KubeletConfig struct {
	// Host overrides the host used to contact kubelet API (default to status.hostIP).
	// +optional
	Host *corev1.EnvVarSource `json:"host,omitempty"`

	// TLSVerify toggles kubelet TLS verification.
	// Default: true
	// +optional
	TLSVerify *bool `json:"tlsVerify,omitempty"`

	// HostCAPath is the host path where the kubelet CA certificate is stored.
	// +optional
	HostCAPath string `json:"hostCAPath,omitempty"`

	// AgentCAPath is the container path where the kubelet CA certificate is stored.
	// Default: '/var/run/host-kubelet-ca.crt' if hostCAPath is set, else '/var/run/secrets/kubernetes.io/serviceaccount/ca.crt'
	// +optional
	AgentCAPath string `json:"agentCAPath,omitempty"`
}

KubeletConfig contains the kubelet configuration parameters. +kubebuilder:object:generate=true

func (*KubeletConfig) DeepCopy

func (in *KubeletConfig) DeepCopy() *KubeletConfig

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

func (*KubeletConfig) DeepCopyInto

func (in *KubeletConfig) DeepCopyInto(out *KubeletConfig)

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

type RollingUpdate

type RollingUpdate struct {
	// The maximum number of pods that can be unavailable during the update.
	// Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%).
	// Refer to the Kubernetes API documentation for additional details..
	MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty"`

	// MaxSurge behaves differently based on the Kubernetes resource. Refer to the
	// Kubernetes API documentation for additional details.
	MaxSurge *intstr.IntOrString `json:"maxSurge,omitempty"`
}

RollingUpdate describes how to replace existing pods with new ones. +k8s:openapi-gen=true +kubebuilder:object:generate=true

func (*RollingUpdate) DeepCopy

func (in *RollingUpdate) DeepCopy() *RollingUpdate

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

func (*RollingUpdate) DeepCopyInto

func (in *RollingUpdate) DeepCopyInto(out *RollingUpdate)

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

type SecretConfig

type SecretConfig 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"`
}

SecretConfig contains a secret name and an included key. +kubebuilder:object:generate=true

func (*SecretConfig) DeepCopy

func (in *SecretConfig) DeepCopy() *SecretConfig

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

func (*SecretConfig) DeepCopyInto

func (in *SecretConfig) DeepCopyInto(out *SecretConfig)

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

type UpdateStrategy

type UpdateStrategy struct {
	// Type can be "RollingUpdate" or "OnDelete" for DaemonSets and "RollingUpdate"
	// or "Recreate" for Deployments
	Type string `json:"type,omitempty"`
	// Configure the rolling update strategy of the Deployment or DaemonSet.
	RollingUpdate *RollingUpdate `json:"rollingUpdate,omitempty"`
}

The deployment strategy to use to replace existing pods with new ones. +k8s:openapi-gen=true +kubebuilder:object:generate=true

func (*UpdateStrategy) DeepCopy

func (in *UpdateStrategy) DeepCopy() *UpdateStrategy

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

func (*UpdateStrategy) DeepCopyInto

func (in *UpdateStrategy) DeepCopyInto(out *UpdateStrategy)

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