Skip to content

20180503_talk_1

20180503_talk_1

Autoscaling with Prometheus

Type of scales

Vertical
* Increase the resource liit when necessary

Horizontal
* Increase the number of instances

History in K8s

k8s 1.1

Used to rely on Heapster
* Heapster collects metrics and write to TSDB
* Heapster was compiled to the kubelet
* Added manifests Kind: HorizontalPodAutoscaler

....
spec:
  scaleRef:
    ...
  minReplicas:
  maxReplicas:

BUT
* Only based on CPU % resource
* Loosely specified APIs
* Unmaintained vendor implem
* Push only TSDB

New Resource & Custom Metrics APis

Prometheus intro
HorizontalPodAutoscaler (v2Bbta1)

Resource Metrics APis

...
spec:
  scaleRef:
    ...
  minReplicas:
  maxReplicas:

  metrics:
  - type: Pods
    pods:
      metricName: http_requets
      targetAverageValue: 200

Prom query

sum(rate(http_requests_total{namespace="..."}[5min]))

Custum Metrics APis
* Need a k8s-prometheus-adapter + Prometheus

=> k8s 1.10

Future

Heapster deprecation
* Planned for 1.13

VerticalPod
* AutoSizing in alpha for Prometheus

CRD AutoScale
* Planned for 1.11

Stable metrics !

Cluster AutoScaler
* Try to not be a separate thing

Standardization of Monitoring
* With OpenMetrics project