Last active
May 11, 2020 15:28
-
-
Save lomkju/f8995a97a1b30d9610b11e4cc54dcf40 to your computer and use it in GitHub Desktop.
HPA Examples
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: autoscaling/v2beta2 | |
kind: HorizontalPodAutoscaler | |
metadata: | |
name: kafka-consumer | |
annotations: | |
# metric-config.<metricType>.<metricName>.<collectorName>/<configKey> | |
metric-config.external.http.json/json-key: "$stats" | |
metric-config.external.http.json/endpoint: "http://www.mocky.io/v2/5eb958772f0000b32c3c3098" | |
spec: | |
scaleTargetRef: | |
apiVersion: apps/v1 | |
kind: Deployment | |
name: kafka-consumer | |
minReplicas: 1 | |
maxReplicas: 10 | |
metrics: | |
- type: External | |
external: | |
metric: | |
name: http | |
selector: | |
matchLabels: | |
identifier: kafka_topic_length | |
target: | |
averageValue: 50 | |
type: AverageValue |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: autoscaling/v2beta2 | |
kind: HorizontalPodAutoscaler | |
metadata: | |
name: kafka-consumer-v2 | |
annotations: | |
# metric-config.<metricType>.<metricName>.<collectorName>/<configKey> | |
metric-config.external.prometheus-query.prometheus/prometheus-server: http://10.210.4.121:9090 | |
metric-config.external.prometheus-query.prometheus/event-process-latency: | | |
scalar(event_process_latency_last_10_seconds) | |
metric-config.external.http.json/json-key: "$stats" | |
metric-config.external.http.json/endpoint: "http://www.mocky.io/v2/5eb958772f0000b32c3c3098" | |
spec: | |
scaleTargetRef: | |
apiVersion: apps/v1 | |
kind: Deployment | |
name: kafka-consumer-v2 | |
minReplicas: 1 | |
maxReplicas: 10 | |
metrics: | |
- type: External | |
external: | |
metric: | |
name: http | |
selector: | |
matchLabels: | |
identifier: kafka_topic_length | |
target: | |
averageValue: 50 | |
type: AverageValue | |
- type: External | |
external: | |
metric: | |
name: prometheus-query | |
selector: | |
matchLabels: | |
query-name: event-process-latency | |
target: | |
type: AverageValue | |
averageValue: 150 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment