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
- Kube Cluster Receiver
- Kube API Server
- Kube Controller Manager
- Kube Scheduler
- Kube Proxy
- Kubelet Stats
- ETCD
- CoreDNS
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 yamlSample 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
| Parameter | Description | Example / Values |
|---|---|---|
| enabled | Enables or disables the component. | true / false |
| config | Contains configuration settings for the component. | user-config.yaml |
| scrape_interval | Frequency of data collection. | 30s, 1m |
| scrape_timeout | Maximum time allowed for data collection. | 10s, 30s |
| ca_file | Path to the certificate authority file. | /etc/ssl/certs/ca.crt |
| ipaddress | IP address of the component. | 192.168.1.100 |
| port | Port number of the component. | 9090 |
| cert_file | Path to the certificate file. | /etc/ssl/certs/tls.crt |
| key_file | Path to the key file. | /etc/ssl/certs/tls.key |
| scheme | Communication protocol. | http, https |
Important Note
Users can enable or disable specific components and modify configuration parameters within the opsramp-k8s-infra-metric-user-config ConfigMap.
scrape_intervalshould be greater than or equal toscrape_timeout.- minimum
scrape_intervaltime is 1 minute.
Troubleshooting
If you encounter infrastructure metrics related issues, see the Troubleshooting documentation.