This repository contains definitions and templates for monitoring Kubernetes using Wavefront.
- Deploy a Wavefront Proxy
- Update
YOUR_CLUSTER
andYOUR_API_TOKEN
according to your instance of Wavefront
- Update
Refer to the Wavefront Kubernetes Integration for core Kubernetes monitoring.
Config Maps allow for easy management and standardization of monitoring configuration and settings for any application and service. Some sample config maps are provided, and can be expanded upon. The sample deployment definitions for monitoring will reference these config maps, which are all Telegraf plugin configuration snippets. Sample Telegraf Config Maps
Use the Telegraf Sidecar container template to add Telegraf as a sidecar to your existing pod definitions
- Change references to
APPLICATION
to match your application name - Optionally update the
METRIC_SOURCE_NAME
environment variable to specify a metric source (default is to use Node name) - Update the config map reference to match the approrpriate deployed config map
:alpine
tag for the image can also be used (other version tags also supported)
When sidecar monitoring is not practical, use the standard Telegraf Deployment template to monitor the service. Prometheus endpoints can be scraped using this method.
- Change references to
APPLICATION
to match your application name - Optionally update the
METRIC_SOURCE_NAME
environment variable to specify a metric source (default is to use Node name) - Update the config map reference to match the approrpriate deployed config map
:alpine
tag for the image can also be used (other version tags also supported)
You may have want to monitor all individual endpoints (pods) associated with a given Kubernetes service that emit Prometheus metrics. Because the name, and number of endpoints can change this needs to be dynamic. The Telegraf Prometheus plugin, can be used in this situation with the following configuration setup.
- Create a new Headless service in Kubernetes where you expose your Prometheus http-metrics port
clusterIP
needs to be set toNone
type
should not be specified- make sure your service selector will select the required pods
- you only need to expose the Prometheus http-metrics port to be scraped
Sample service definition:
kind: Service
apiVersion: v1
metadata:
name: my-service-metrics
spec:
selector:
app: MyApp
clusterIp: None
ports:
- name: http-metrics
port: 8080