alibaba-cloud-metrics-adapter

command module
v0.1.0-alpha Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

README

alibaba-cloud-metrics-adapter

License Build Status

Overview

An implementation of the Kubernetes Custom Metrics API and External Metrics API for Alibaba Cloud.This adapter enables you to scale your application pods running on ACK using the Horizontal Pod Autoscaler (HPA) with External Metrics such as ingress QPS, ARMS jvm RT and so on.

Installation

kubectl apply -f deploy/deploy.yaml 

Example

HPA with external metric (sls_ingress_qps)

apiVersion: autoscaling/v2beta2
kind: HorizontalPodAutoscaler
metadata:
  name: kubecon-hpa
spec:
  scaleTargetRef:
    apiVersion: apps/v1beta2
    kind: Deployment
    name: kubecon-springboot-demo
  minReplicas: 2
  maxReplicas: 10
  metrics:
    - type: External
      external:
        metric:
          name: sls_ingress_qps
          selector:
            matchLabels:
              sls.project: "k8s-log-c550367cdf1e84dfabab013b277cc6bc2"
              sls.logStore: "nginx-ingress"
              sls.ingress.route: "default-kubecon-springboot-demo-6666"
        target:
          type: AverageValue
          averageValue: 10

setup stress engine and watch the hpa output.

NAME          REFERENCE                            TARGETS      MINPODS   MAXPODS   REPLICAS   AGE
kubecon-hpa   Deployment/kubecon-springboot-demo   120/10 (avg)   2         10        8          6m3s

Cloud Resource Metrics

Contributing

Please check CONTRIBUTING.md

License

This software is released under the Apache 2.0 license.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

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