Skip to content

Instantly share code, notes, and snippets.

@reynldi
Created April 25, 2023 05:35
Show Gist options
  • Select an option

  • Save reynldi/48050ffc634da87e2377d5b945da1c05 to your computer and use it in GitHub Desktop.

Select an option

Save reynldi/48050ffc634da87e2377d5b945da1c05 to your computer and use it in GitHub Desktop.
HPA Custom Metrics
{{- if .Values.autoscaling.enabled }}
apiVersion: autoscaling/v2beta2
kind: HorizontalPodAutoscaler
metadata:
name: {{ .Values.image.name }}
namespace: {{ .Values.namespace }}
labels:
app: {{ .Values.image.name }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ .Values.image.name }}
minReplicas: {{ .Values.autoscaling.minReplicas }}
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
metrics:
- type: Pods
pods:
metric:
name: container_network_receive_bytes_per_second // see configmap for custom metrics definition
target:
type: AverageValue
averageValue: 10000000
{{- end }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment