clusteragent

package
v0.0.0-...-45a9bcf Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: Apache-2.0 Imports: 1 Imported by: 5

README

Datadog Cluster Agent - DCA

CircleCI Build status GoDoc

The Datadog Cluster Agent (referred to as DCA) faithfully collects events and metrics and brings them to Datadog on your behalf so that you can do something useful with your monitoring and performance data.

The purpose of the DCA is to be used alongside of an orchestrator. So far, only Kubernetes is supported. Without the DCA, node agents would have to hit the API Server, which would apply an important pressure on it especially in large clusters.

The DCA has two goals:

  • Be the main interface with the API server to collect and forward events.
  • Implement the backend for applications requiring a single interface, for instance:
    • Keep a map of container and their metadata associated that would otherwise need to be queried by each agent to the API Server.
    • Collect the Control Plane health check

The present repository contains the source code of the Datadog Cluster Agent version 6, currently in Alpha.

Getting started

For pre-requisite, refer to the Agent's Getting Started section in the README

To start working on the Cluster Agent, you can build the main branch:

  1. Clone the repo: git clone https://github.com/DataDog/datadog-agent.git $GOPATH/src/github.com/DataDog/datadog-agent.
  2. cd into the project folder: cd $GOPATH/src/github.com/DataDog/datadog-agent.
  3. Install go tools: invoke install-tools.
  4. Build the whole project with invoke cluster-agent.build

Please refer to the Agent Developer Guide for more details.

Run

To start the agent type cluster-agent start from the bin/datadog-cluster-agent folder, it will take care of adjusting paths and run the binary in foreground.

You need to provide a valid API key, either through the config file or passing the environment variable like:

DD_API_KEY=12345678990 ./bin/datadog-cluster-agent/datadog-cluster-agent

Features

Once built, you can use the start command and the DCA will also try to connect to the API Server. If successful, it will forward the events from the API Server to your Datadog app and a health check for each component of the control pane.

Secondly, it will start serving the DD_CLUSTER_AGENT.CMD_PORT if set or 5005 by default with the following endpoints:

- /hostname
- /version
- /api/v1/{check}/checks (available for Kubernetes only in 6.0.0)
- /api/v1/metadata/{host}/{container:[0-9a-z]{64}} (returning the metadata of the said source available in the API Server)
- /flare
- /stop
- /status

Documentation

The general documentation of the project (including instructions on the Beta builds, Agent installation, development, etc) is located under the docs directory of the present repo.

Contributing code

You must sign a CLA before we can accept your contributions. If you submit a PR without having signed it, our bot will prompt you to do so. Once signed you will be set for all contributions going forward.

Pre-requisites for the DCA to interact with the API server.

For the DCA to produce events, service checks and run checks one needs to enable it to perform a few actions. Please find the minimum RBAC here to get the full scope of features. This manifest will create a Service Account, a Cluster Role with a restricted scope and actions detailed below and a Cluster Role Binding as well.

Documentation

Overview

Package clusteragent contains the functionality of the Cluster Agent.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ServerContext

type ServerContext struct {
	ClusterCheckHandler *clusterchecks.Handler
}

ServerContext holds business logic classes required to setup API endpoints

Directories

Path Synopsis
api
Package api contains the telemetry of the Cluster Agent API and implements the forwarding of queries from Cluster Agent followers to the leader.
Package api contains the telemetry of the Cluster Agent API and implements the forwarding of queries from Cluster Agent followers to the leader.
v1
Package v1 contains the types of the Cluster Agent API (v1).
Package v1 contains the types of the Cluster Agent API (v1).
Package autoscaling implements common components for all autoscaling controllers.
Package autoscaling implements common components for all autoscaling controllers.
custommetrics
Package custommetrics implements the part of the Cluster Agent that's responsible for providing custom metrics to the Kubernetes apiserver for Horizontal Pod Autoscalers.
Package custommetrics implements the part of the Cluster Agent that's responsible for providing custom metrics to the Kubernetes apiserver for Horizontal Pod Autoscalers.
externalmetrics
Package externalmetrics implements the part of the Cluster Agent that's responsible for providing custom metrics to the Kubernetes apiserver for Horizontal Pod Autoscalers.
Package externalmetrics implements the part of the Cluster Agent that's responsible for providing custom metrics to the Kubernetes apiserver for Horizontal Pod Autoscalers.
workload
Package workload implements the DatadogPodAutoscaler controller and related components to implement horizontal and vertical pod autoscaling.
Package workload implements the DatadogPodAutoscaler controller and related components to implement horizontal and vertical pod autoscaling.
workload/model
Package model implements data model structures and helpers for workload autoscaling.
Package model implements data model structures and helpers for workload autoscaling.
types
Package types implements the types used by the Cluster checks dispatching functionality.
Package types implements the types used by the Cluster checks dispatching functionality.
Package languagedetection implements the language detection patcher.
Package languagedetection implements the language detection patcher.

Jump to

Keyboard shortcuts

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