circonus-kubernetes-agent

command module
v0.9.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 11, 2020 License: BSD-3-Clause Imports: 2 Imported by: 0

README

Circonus Kubernetes Agent

An agent designed to retrieve metrics from a Kubernetes cluster. Runs as a deployment, forwards Kubernetes provided metrics for cluster, nodes, pods, and containers to Circonus.

Prerequisites

kube-state-metrics

For full functionality kube-state-metrics should be installed in the cluster

DNS

For DNS metrics the agent will look for a service named kube-dns in the kube-system namespace. It will check for two annotations prometheus.io/scrape and prometheus.io/port. If scrape is true, the agent will collect metrics from the endpoints listed for the target port. For example:

apiVersion: v1
kind: Service
metadata:
  annotations:
    prometheus.io/port: "9153"
    prometheus.io/scrape: "true"
  labels:
    k8s-app: kube-dns
    kubernetes.io/cluster-service: "true"
    kubernetes.io/name: KubeDNS
  name: kube-dns
  namespace: kube-system
spec:
  selector:
    k8s-app: kube-dns
  type: ClusterIP
  ports:
  - name: dns
    port: 53
    protocol: UDP
    targetPort: 53
  - name: dns-tcp
    port: 53
    protocol: TCP
    targetPort: 53
  - name: metrics
    port: 9153
    protocol: TCP
    targetPort: 9153

NOTE: if the annotations are not defined on the service, and the service cannot be modfied for any reason. If the pods backing the kube-dns service do expose metrics use kube-dns-metrics-port to define the port from which to request /metrics.

Installation

kubectl
Default (simple)
  1. Clone repo
  2. In deploy/default/configuration.yaml set the following required attributes:
    • Circonus API Token - circonus-api-key
    • Kubernetes Cluster Name - kubernetes-name - short, unique string w/o spaces
    • Circonus Alert Email - default-alerts.json->contact.email - email address for default alerts
  3. Apply kubectl apply -f deploy/default/
Custom
  1. Clone repo
  2. Verify deploy/custom/authrbac.yaml, alter any applicable settings for cluster security
  3. Change any applicable settings in deploy/custom/configuration.yaml, minimum required:
    • Circonus API Token
    • Check Target (optional, Kubernetes cluster name will be used if not supplied) - so agent can find check on restart (short, unique string w/o spaces - normally this is a FQDN)
    • Kubernetes Cluster Name - used for check title when creating a check
    • Circonus Alert Email - email address for default alerts
  4. Change any applicable settings in deploy/custom/deployment.yaml
  5. Apply kubectl apply -f deploy/custom/
helm (contrib)
  1. Clone repo
  2. Make updates to files in contrib/helm to customize settings
  3. Install
helm install contrib/helm \
  --name=<Helm release name> \
  --set=circonus_api_key=<some valid Circonus API key> \
  --set=kubernetes_name=<kubernetes-name> \
  --set=circonus_check_target=<circonus-check-target> \
  --wait

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package cmd provides the cli interface and configuration handling
Package cmd provides the cli interface and configuration handling
internal
agent
Package agent defines the main process
Package agent defines the main process
as
Package as is the api-server collector
Package as is the api-server collector
circonus
Package circonus contains methods for interfacing with circonus
Package circonus contains methods for interfacing with circonus
cluster
Package cluster is the collection manager for a cluster
Package cluster is the collection manager for a cluster
config
Package config defines the configuration and configuration helper methods for agent
Package config defines the configuration and configuration helper methods for agent
config/defaults
Package defaults contains the default values for configuration options
Package defaults contains the default values for configuration options
config/keys
Package keys defines the configuration keys used to access viper
Package keys defines the configuration keys used to access viper
dns
Package dns is the kube-dns collector
Package dns is the kube-dns collector
events
Package events is the cluster events collector
Package events is the cluster events collector
health
Package health contains collection/calculation of derived metrics used for dashboard and alerting
Package health contains collection/calculation of derived metrics used for dashboard and alerting
k8s
Package k8s defines types needed
Package k8s defines types needed
ksm
Package ksm is the kube-state-metrics collector
Package ksm is the kube-state-metrics collector
nodes
Package nodes is the collector for nodes, pods, and optionally containers
Package nodes is the collector for nodes, pods, and optionally containers
nodes/collector
Package collector collects metrics from nodes
Package collector collects metrics from nodes
promtext
Package promtext parses prometheus text metrics
Package promtext parses prometheus text metrics
release
Package release provides placeholders for build tags
Package release provides placeholders for build tags

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL