Skip to content

Commit

Permalink
adding support for external metric
Browse files Browse the repository at this point in the history
  • Loading branch information
skmannion committed Jul 14, 2023
1 parent f39f186 commit daaae12
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 4 deletions.
4 changes: 2 additions & 2 deletions ndustrial/deployment/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ maintainers:
- email: [email protected]
name: DevOps
# Please make sure that version and appVersion are always the same.
version: 0.1.57
appVersion: 0.1.57
version: 0.1.58
appVersion: 0.1.58
15 changes: 15 additions & 0 deletions ndustrial/deployment/templates/datadogmetric.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{{- if .Values.datadogmetric.enabled }}
apiVersion: datadoghq.com/v1alpha1
kind: DatadogMetric
metadata:
name: {{ include "nio-common.names.fullname" $ }}-{{ required "A deployment must have a name" .name }}-metric
annotations: {{- toYaml .Values.annotations | nindent 4 }}
labels: {{- include "nio-common.labels.standard" . | nindent 4 }}
ndustrial.io/component: deployment
{{- if .Values.labels }}
{{- include "nio-common.tplvalues.render" (dict "value" .Values.labels "context" $) | nindent 4 }}
{{- end }}
spec:
query: "{{ $.Values.datadogmetric.query }}"
---
{{- end }}
9 changes: 9 additions & 0 deletions ndustrial/deployment/templates/hpa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,13 @@ spec:
name: memory
targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
{{- if .Values.autoscaling.externalMetric.metricName }}
- type: External
external:
metric:
name: "{{ $.Values.autoscaling.externalMetric.metricName }}"
target:
type: Value
value: {{ $.Values.autoscaling.externalMetric.metricTarget }}
{{- end }}
{{- end }}
14 changes: 12 additions & 2 deletions ndustrial/deployment/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,19 @@ autoscaling:
## @param autoscaling.maxReplicas
maxReplicas: 10
## @param autoscaling.targetCPUUtilizationPercentage
targetCPUUtilizationPercentage: 80
targetCPUUtilizationPercentage:
## @param autoscaling.targetMemoryUtilizationPercentage
targetMemoryUtilizationPercentage: 80
targetMemoryUtilizationPercentage:
## @param autoscaling.externalMetric
externalMetric:
metricName: ""
metricValue:

## @section DatadogMetric parameters

datadogmetric:
enabled: false
query: ""

## @section Pod Image parameters

Expand Down

0 comments on commit daaae12

Please sign in to comment.