dilinade 99a194fe1a change apiVersion for k8s autoscaling
Signed-off-by: Dilina <macowtdy@gmail.com>

Signed-off-by: dilinade <nisalya@gmail.com>
2023-12-14 22:01:31 +00:00

62 lines
1.7 KiB
YAML

apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: custom-metrics-consumer
namespace: default
labels:
application: custom-metrics-consumer
annotations:
# metric-config.<metricType>.<metricName>.<collectorType>/<configKey>
metric-config.pods.queue-length.json-path/json-key: "$.queue.length"
metric-config.pods.queue-length.json-path/path: /metrics
metric-config.pods.queue-length.json-path/port: "9090"
# metric-config.object.requests-per-second.prometheus/query: |
# scalar(sum(rate(skipper_serve_host_duration_seconds_count{host="custom-metrics_example_org"}[1m])))
# metric-config.object.requests-per-second.prometheus/per-replica: "true"
# metric-config.object.requests-per-second.skipper/interval: "1s"
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: custom-metrics-consumer
minReplicas: 1
maxReplicas: 10
metrics:
# - type: Resource
# resource:
# name: cpu
# current:
# averageUtilization: 50
- type: Pods
pods:
metric:
name: queue-length
target:
averageValue: 1k
type: AverageValue
- type: Object
object:
describedObject:
apiVersion: networking.k8s.io/v1
kind: Ingress
name: custom-metrics-consumer
metric:
name: requests-per-second
target:
averageValue: "10"
type: AverageValue
- type: External
external:
metric:
name: app-queue-length
selector:
matchLabels:
type: sqs-queue-length
queue-name: foobar
region: eu-central-1
target:
averageValue: "30"
type: AverageValue