Skip to content

Commit

Permalink
Merge pull request #26 from elastiflow/improve-autoscaling
Browse files Browse the repository at this point in the history
Improve Autoscaling
  • Loading branch information
kgrubb authored Jul 3, 2024
2 parents fc15e53 + 2be1baa commit b7df7a7
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 19 deletions.
2 changes: 1 addition & 1 deletion charts/netobserv/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: netobserv
description: ElastiFlow NetObserv
type: application
version: 0.3.1
version: 0.4.0
appVersion: 7.0.1

keywords:
Expand Down
23 changes: 7 additions & 16 deletions charts/netobserv/templates/hpa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,12 @@ spec:
name: {{ include "netobserv.fullname" . }}
minReplicas: {{ .Values.autoscaling.minReplicas }}
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
{{- with .Values.autoscaling.metrics }}
metrics:
{{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.autoscaling.behavior }}
behavior:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
9 changes: 9 additions & 0 deletions charts/netobserv/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ spec:
{{- if .Values.service.externalTrafficPolicy }}
externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy }}
{{- end }}
{{- if .Values.service.loadBalancerSourceRanges }}
loadBalancerSourceRanges:
{{- range .Values.service.loadBalancerSourceRanges }}
- {{ . }}
{{- end }}
{{- end }}
{{- if .Values.service.loadBalancerIP }}
loadBalancerIP: {{ .Values.service.loadBalancerIP }}
{{- end }}
ports: {{ .Values.service.ports | toYaml | nindent 4 }}
selector:
{{- include "netobserv.selectorLabels" . | nindent 4 }}
24 changes: 22 additions & 2 deletions charts/netobserv/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,28 @@ autoscaling:
enabled: false
minReplicas: 1
maxReplicas: 100
targetCPUUtilizationPercentage: 80
# targetMemoryUtilizationPercentage: 80
metrics:
- type: Resource
resource:
name: cpu
targetAverageUtilization: 80
# - type: Resource
# resource:
# name: memory
# targetAverageUtilization: 80
# behavior:
# scaleUp:
# stabilizationWindowSeconds: 300
# policies:
# - type: Percent
# value: 100
# periodSeconds: 15
# scaleDown:
# stabilizationWindowSeconds: 300
# policies:
# - type: Percent
# value: 10
# periodSeconds: 15

tolerations: []

Expand Down

0 comments on commit b7df7a7

Please sign in to comment.