Skip to content

Latest commit

 

History

History
102 lines (71 loc) · 5.25 KB

kubernetes-volumes.md

File metadata and controls

102 lines (71 loc) · 5.25 KB

kubernetes-volumes

Monitor Type: kubernetes-volumes (Source)

Accepts Endpoints: No

Multiple Instances Allowed: Yes

Overview

This monitor sends usage stats about volumes mounted to Kubernetes pods (e.g. free space/inodes). This information is gotten from the Kubelet /stats/summary endpoint. The normal collectd/df monitor generally will not report Persistent Volume usage metrics because those volumes are not seen by the agent since they can be mounted dynamically and older versions of K8s don't support mount propagation of those mounts to the agent container.

Dimensions that identify the underlying volume source will be added for awsElasticBlockStore and glusterfs volumes. Support for more can be easily added as needed.

Configuration

To activate this monitor in the Smart Agent, add the following to your agent config:

monitors:  # All monitor config goes under this key
 - type: kubernetes-volumes
   ...  # Additional config

For a list of monitor options that are common to all monitors, see Common Configuration.

Config option Required Type Description
kubeletAPI no object (see below) Kubelet kubeletClient configuration
kubernetesAPI no object (see below) Configuration of the Kubernetes API kubeletClient

The nested kubeletAPI config object has the following fields:

Config option Required Type Description
url no string URL of the Kubelet instance. This will default to https://<current node hostname>:10250 if not provided.
authType no string Can be none for no auth, tls for TLS client cert auth, or serviceAccount to use the pod's default service account token to authenticate. (default: none)
skipVerify no bool Whether to skip verification of the Kubelet's TLS cert (default: true)
caCertPath no string Path to the CA cert that has signed the Kubelet's TLS cert, unnecessary if skipVerify is set to false.
clientCertPath no string Path to the client TLS cert to use if authType is set to tls
clientKeyPath no string Path to the client TLS key to use if authType is set to tls
logResponses no bool Whether to log the raw cadvisor response at the debug level for debugging purposes. (default: false)

The nested kubernetesAPI config object has the following fields:

Config option Required Type Description
authType no string How to authenticate to the K8s API server. This can be one of none (for no auth), tls (to use manually specified TLS client certs, not recommended), serviceAccount (to use the standard service account token provided to the agent pod), or kubeConfig to use credentials from ~/.kube/config. (default: serviceAccount)
skipVerify no bool Whether to skip verifying the TLS cert from the API server. Almost never needed. (default: false)
clientCertPath no string The path to the TLS client cert on the pod's filesystem, if using tls auth.
clientKeyPath no string The path to the TLS client key on the pod's filesystem, if using tls auth.
caCertPath no string Path to a CA certificate to use when verifying the API server's TLS cert. Generally this is provided by K8s alongside the service account token, which will be picked up automatically, so this should rarely be necessary to specify.

Metrics

These are the metrics available for this monitor. This monitor emits all metrics by default; however, none are categorized as container/host -- they are all custom.

  • kubernetes.volume_available_bytes (gauge)
    The number of available bytes in the volume
  • kubernetes.volume_capacity_bytes (gauge)
    The total capacity in bytes of the volume The agent does not do any built-in filtering of metrics coming out of this monitor.

Dimensions

The following dimensions may occur on metrics emitted by this monitor. Some dimensions may be specific to certain metrics.

Name Description
VolumeId (EBS volumes only) The EBS volume id of the underlying volume source
endpoints_name (GlusterFS volumes only) The endpoint name used for the GlusterFS volume
glusterfs_path (GlusterFS volumes only) The GlusterFS volume path
kubernetes_namespace The namespace of the pod that has this volume
kubernetes_pod_name The name of the pod that has this volume
kubernetes_pod_uid The UID of the pod that has this volume
partition (EBS volumes only) The partition number of the underlying EBS volume (0 indicates the entire disk)
volume The volume name as given in the pod spec under volumes
volume_type The type of the underlying volume -- this will be the key used in the k8s volume config spec (e.g. awsElasticBlockStore, etc.)