Skip to content

Latest commit

 

History

History

kube_apiserver_metrics

Agent Check: Kubernetes API server metrics

Overview

This check monitors Kube_apiserver_metrics.

Setup

Installation

The Kube_apiserver_metrics check is included in the Datadog Agent package, so you do not need to install anything else on your server.

Configuration

The main use case to run the kube_apiserver_metrics check is as a Cluster Level Check. Refer to the dedicated documentation for Cluster Level Checks. You can annotate the service of your apiserver with the following:

Annotations:       ad.datadoghq.com/endpoint.check_names: ["kube_apiserver_metrics"]
                   ad.datadoghq.com/endpoint.init_configs: [{}]
                   ad.datadoghq.com/endpoint.instances:
                     [
                       {
                         "prometheus_url": "%%host%%:%%port%%/metrics",
                         "bearer_token_auth": "true"
                       }
                     ]
                   ad.datadoghq.com/service.check_names: [""]
                   ad.datadoghq.com/service.init_configs: [{}]
                   ad.datadoghq.com/service.instances: [{}]

Then the Datadog Cluster Agent schedules the check(s) for each endpoint onto Datadog Agent(s).

Disclaimer: Your apiserver(s) need to run as pods, other methods (e.g. systemd unit) are not supported at the moment.

You can also run the check by configuring the endpoints directly in the kube_apiserver_metrics.d/conf.yaml file, in the conf.d/ folder at the root of your Agent’s configuration directory. See the sample kube_apiserver_metrics.d/conf.yaml for all available configuration options.

By default the Agent running the check tries to get the service account bearer token to authenticate against the APIServer. If you are not using RBACs, set bearer_token_auth to false.

Finally, if you run the Datadog Agent on the master nodes, you can rely on Autodiscovery to schedule the check. It is automatic if you are running the official image k8s.gcr.io/kube-apiserver.

Validation

Run the Agent's status subcommand and look for kube_apiserver_metrics under the Checks section.

Data Collected

Metrics

See metadata.csv for a list of metrics provided by this integration.

Service Checks

Kube_apiserver_metrics does not include any service checks.

Events

Kube_apiserver_metrics does not include any events.

Troubleshooting

Need help? Contact Datadog support.