---
isPrivate: true
title: Host Agent to monitor Kubernetes.
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: Docs > Integrations > FAQ Integrations > Host Agent to monitor Kubernetes.
---

# Host Agent to monitor Kubernetes.

## Setup the Kubernetes state integration{% #setup-the-kubernetes-state-integration %}

If you decide to run your Agent on your host to monitor kubernetes, in order to start collecting your Kubernetes metrics you should:

1. [Install the Agent on your host](https://app.datadoghq.com/account/settings/agent/latest)

1. Download the [Kube-State manifests folder](https://github.com/kubernetes/kube-state-metrics/tree/master/examples/standard).

1. Apply them to your Kubernetes cluster:

   ```shell
   kubectl apply -f <NAME_OF_THE_KUBE_STATE_MANIFESTS_FOLDER>
   ```

Once done, the Kubernetes State integration automatically collects kube-state metrics.

## Setup the kube-dns integration{% #setup-the-kube-dns-integration %}

### Configuration{% #configuration %}

Since [Agent v6](https://docs.datadoghq.com/agent/), Kubernetes DNS integration works automatically with the [Autodiscovery](https://docs.datadoghq.com/agent/kubernetes/integrations/).

Note: these metrics are unavailable for Azure Kubernetes Service (AKS).

## Collect container logs{% #collect-container-logs %}

**Available for Agent >6.0**

There are two ways to collect logs from containers running in Kubernetes:

- Through the Docker socket.
- Through the Kubernetes log files.

Datadog recommends using the Kubernetes log files approach when you are either not using Docker, or are using more than 10 containers per pod.

Datadog also recommends that you take advantage of DaemonSets to [automatically deploy the Datadog Agent on all your nodes](https://app.datadoghq.com/account/settings/agent/latest?platform=kubernetes). Otherwise, to manually enable log collection from one specific node, add the following parameters in the `datadog.yaml`:

```yaml
logs_enabled: true
listeners:
  - name: kubelet
config_providers:
  - name: kubelet
    polling: true
logs_config:
  container_collect_all: true
```

[Restart the Agent](https://docs.datadoghq.com/agent/guide/agent-commands/#start-stop-and-restart-the-agent).

Use [Autodiscovery with Pod Annotations](https://docs.datadoghq.com/agent/kubernetes/integrations/) to configure log collection to add multiline processing rules, or to customize the `source` and `service` attributes.

## Further Reading{% #further-reading %}

To get a better idea of how (or why) to integrate your Kubernetes service, see the related series of [Datadog blog posts](https://www.datadoghq.com/blog/monitoring-kubernetes-era).
