38 lines
994 B
YAML
38 lines
994 B
YAML
{{- if .Values.autoscaling.enabled }}
|
|
---
|
|
apiVersion: autoscaling/v2
|
|
kind: HorizontalPodAutoscaler
|
|
metadata:
|
|
name: {{ include "hyc.fullname" . }}-hpa
|
|
labels:
|
|
{{- include "hyc.labels" . | nindent 4 }}
|
|
spec:
|
|
scaleTargetRef:
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
name: {{ include "hyc.fullname" . }}
|
|
minReplicas: {{ .Values.autoscaling.minReplicas }}
|
|
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
|
|
metrics:
|
|
{{- toYaml .Values.autoscaling.metrics | nindent 4 }}
|
|
{{- end }}
|
|
|
|
{{- if .Values.metrics.enabled }}
|
|
---
|
|
apiVersion: monitoring.coreos.com/v1
|
|
kind: ServiceMonitor
|
|
metadata:
|
|
name: {{ include "hyc.fullname" . }}-monitor
|
|
labels:
|
|
{{- include "hyc.labels" . | nindent 4 }}
|
|
release: {{ .Values.metrics.release }}
|
|
spec:
|
|
selector:
|
|
matchLabels:
|
|
{{- include "hyc.selectorLabels" . | nindent 6 }}
|
|
endpoints:
|
|
- port: http
|
|
path: /metrics
|
|
interval: {{ .Values.metrics.interval }}
|
|
{{- end }}
|