Skip to content
Wavefront HPA Adapter for Kubernetes
Go Makefile Dockerfile
Branch: master
Clone or download

Latest commit

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
cmd/wavefront-adapter glog -> logrus Feb 12, 2020
deploy bump versions Feb 12, 2020
docs doc updates Feb 12, 2020
pkg glog -> logrus Feb 12, 2020
.gitignore Added wavefront adapter Aug 27, 2018
.travis.yml fix travis Jan 17, 2020
LICENSE
Makefile bump versions Feb 12, 2020
README.md doc updates Feb 12, 2020
go.mod updated deps to kube-1.11.3 Mar 26, 2020
go.sum updated deps to kube-1.11.3 Mar 26, 2020

README.md

Wavefront HPA Adapter for Kubernetes

build status Go Report Card Docker Pulls

Wavefront is a high-performance streaming analytics platform for monitoring and optimizing your environment and applications.

The Wavefront HPA (Horizontal Pod Autoscaler) adapter for Kubernetes implements the Kubernetes custom.metrics.k8s.io/v1beta1 and external.metrics.k8s.io/v1beta1 APIs allowing you to autoscale pods based on metrics available within Wavefront.

Prerequisites

  • Kubernetes 1.9+
  • The aggregation layer needs to be enabled in your Kubernetes cluster prior to deploying the Wavefront adapter.

Getting Started

Refer the Getting Started guide for an overview of the functionality provided by this adapter.

Configuration

Refer the documentation for detailed configuration options.

Installation

  1. Clone this repo.
  2. Edit the wavefront-url and wavefront-token properties in deploy/manifests/05-custom-metrics-apiserver-deployment.yaml.
  3. Optionally, edit the deploy/manifests/04-custom-metrics-config-map.yaml and modify the external metrics you wish to export.
  4. Finally run kubectl apply -f deploy/manifests to deploy the adapter in your Kubernetes cluster.

Debugging

To verify the installation, run kubectl get --raw "/apis/custom.metrics.k8s.io/v1beta1" | jq .. You should get the list of supported metrics similar to:

{
  "kind": "APIResourceList",
  "apiVersion": "v1",
  "groupVersion": "custom.metrics.k8s.io/v1beta1",
  "resources": [
    {
      "name": "nodes/cpu.node_reservation",
      "singularName": "",
      "namespaced": false,
      "kind": "MetricValueList",
      "verbs": [
        "get"
      ]
    },
    {
      "name": "pods/network.rx_errors_rate",
      "singularName": "",
      "namespaced": true,
      "kind": "MetricValueList",
      "verbs": [
        "get"
      ]
    },
    {
      "name": "pods/network.tx_rate",
      "singularName": "",
      "namespaced": true,
      "kind": "MetricValueList",
      "verbs": [
        "get"
      ]
    },
    {
      "name": "pods/cpu.request",
      "singularName": "",
      "namespaced": true,
      "kind": "MetricValueList",
      "verbs": [
        "get"
      ]
    }
  ]
}    

You can similarly run kubectl get --raw "/apis/external.metrics.k8s.io/v1beta1" | jq . to verify the external metrics API.

HPA Autoscaling

See the sample configurations under hpa-examples on how to autoscale deployments based on metrics under the custom or external metrics APIs.

Run kubectl describe hpa example-hpa-custom-metrics to verify the autoscaling works.

You can’t perform that action at this time.