//// This file is generated! See scripts/docs_collector.py //// [[metricbeat-module-kubernetes]] == Kubernetes module This module fetches metrics from Kubernetes https://kubernetes.io/docs/admin/kubelet/[kubelet] agent and https://github.com/kubernetes/kube-state-metrics[kube-state-metrics] service. All metricsets with the `state_` prefix require `hosts` field pointing to kube-stat-metrics service within the cluster, while the rest should be pointed to kubelet service. Check the example configuration on how to do it. The default metricsets are `container`, `node`, `pod`, `system` and `volume`. [float] === Compability The Kubernetes module is tested with Kubernetes 1.8.0, 1.9.4 and 1.10.0. [float] === Example configuration The Kubernetes module supports the standard configuration options that are described in <>. Here is an example configuration: [source,yaml] ---- metricbeat.modules: # Node metrics, from kubelet: - module: kubernetes metricsets: - container - node - pod - system - volume period: 10s hosts: ["localhost:10255"] enabled: true #bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token #ssl.certificate_authorities: # - /var/run/secrets/kubernetes.io/serviceaccount/service-ca.crt #ssl.certificate: "/etc/pki/client/cert.pem" #ssl.key: "/etc/pki/client/cert.key" # Enriching parameters: add_metadata: true in_cluster: true # When used outside the cluster: #host: node_name #kube_config: ~/.kube/config # State metrics from kube-state-metrics service: - module: kubernetes enabled: true metricsets: - state_node - state_deployment - state_replicaset - state_statefulset - state_pod - state_container period: 10s hosts: ["kube-state-metrics:8080"] # Enriching parameters: add_metadata: true in_cluster: true # When used outside the cluster: #host: node_name #kube_config: ~/.kube/config # Kubernetes events - module: kubernetes enabled: true metricsets: - event # Kubernetes API server - module: kubernetes enabled: true metricsets: - apiserver hosts: ["https://${KUBERNETES_SERVICE_HOST}:${KUBERNETES_SERVICE_PORT}"] ---- This module supports TLS connections when using `ssl` config field, as described in <>. It also supports the options described in <>. [float] === Metricsets The following metricsets are available: * <> * <> * <> * <> * <> * <> * <> * <> * <> * <> * <> * <> * <> include::kubernetes/apiserver.asciidoc[] include::kubernetes/container.asciidoc[] include::kubernetes/event.asciidoc[] include::kubernetes/node.asciidoc[] include::kubernetes/pod.asciidoc[] include::kubernetes/state_container.asciidoc[] include::kubernetes/state_deployment.asciidoc[] include::kubernetes/state_node.asciidoc[] include::kubernetes/state_pod.asciidoc[] include::kubernetes/state_replicaset.asciidoc[] include::kubernetes/state_statefulset.asciidoc[] include::kubernetes/system.asciidoc[] include::kubernetes/volume.asciidoc[]