Introduction

Infrastructure metrics provide deep insights into the health, performance, and reliability of core Kubernetes components. By monitoring these metrics, users can:

  • Detect issues before they impact workloads.
  • Optimize cluster resource usage.
  • Troubleshoot control-plane and node-level problems quickly.
  • Improve visibility into Kubernetes internals.

OpsRamp Kubernetes Agent 2.0 automatically collects these metrics from control-plane and worker nodes and makes them available for analysis.

Prerequisites

  • Install the Kubernetes 2.0 Agent. Refer to the Agent Installation Guide for detailed steps.
  • During installation, enable the required component metrics.

Supported Infrastructure Metrics

ConfigMap

All infrastructure metrics are managed using the opsramp-k8s-infra-metric-user-config ConfigMap. To view the current configuration, run:

kubectl get cm opsramp-k8s-infra-metric-user-config -n <agent-installed-namespace> -o yaml

Sample ConfigMap

apiVersion: v1
kind: ConfigMap
metadata:
  name: opsramp-k8s-infra-metric-user-config
  namespace: opsramp-agent
data:
  receivers.yaml: |
    apiserver:
      enabled: true
      config:
        scrape_interval: "2m"
        scrape_timeout: "59s"
        ca_file: "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt"

    coredns:
      enabled: true
      config:
        scrape_interval: "2m"
        scrape_timeout: "59s"

    k8s_cluster:
      enabled: true
      config:
        scrape_interval: "2m"

    kubelet_stats:
      enabled: true
      config:
        scrape_interval: "2m"
        port: "10250"

    kube_proxy:
      enabled: true
      config:
        scrape_interval: "2m"
        scrape_timeout: "59s"
        ipaddress: "127.0.0.1"
        port: "10249"

    kube_controller_manager:
      enabled: true
      config:
        scrape_interval: "2m"
        scrape_timeout: "59s"
        ipaddress: "127.0.0.1"
        port: "10257"

    kube_scheduler:
      enabled: true
      config:
        scrape_interval: "2m"
        scrape_timeout: "59s"
        ipaddress: "127.0.0.1"
        port: "10259"

    etcd:
      enabled: true

    node_ntp_offset:
      enabled: false
      config:
        ipaddress: "127.0.0.1"
        port: "123"

Configuration Parameters

ParameterDescriptionExample / Values
enabledEnables or disables the component.true / false
configContains configuration settings for the component.user-config.yaml
scrape_intervalFrequency of data collection.30s, 1m
scrape_timeoutMaximum time allowed for data collection.10s, 30s
ca_filePath to the certificate authority file./etc/ssl/certs/ca.crt
ipaddressIP address of the component.192.168.1.100
portPort number of the component.9090
cert_filePath to the certificate file./etc/ssl/certs/tls.crt
key_filePath to the key file./etc/ssl/certs/tls.key
schemeCommunication protocol.http, https

Troubleshooting

If you encounter infrastructure metrics related issues, see the Troubleshooting documentation.