Skip to content

Commit

Permalink
Update hpa from autoscaling/v1 to autoscaling/v2beta2 (#1071)
Browse files Browse the repository at this point in the history
  • Loading branch information
pmalek-sumo committed Nov 13, 2020
1 parent 81622de commit 70b2a17
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 4 deletions.
18 changes: 16 additions & 2 deletions deploy/helm/sumologic/templates/hpa.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if .Values.fluentd.logs.autoscaling.enabled}}
apiVersion: autoscaling/v1
apiVersion: autoscaling/v2beta2
kind: HorizontalPodAutoscaler
metadata:
name: {{ template "sumologic.metadata.name.logs.hpa" . }}
Expand All @@ -13,5 +13,19 @@ spec:
name: {{ template "sumologic.metadata.name.logs.statefulset" . }}
minReplicas: {{ .Values.fluentd.logs.autoscaling.minReplicas }}
maxReplicas: {{ .Values.fluentd.logs.autoscaling.maxReplicas }}
targetCPUUtilizationPercentage: {{ .Values.fluentd.logs.autoscaling.targetCPUUtilizationPercentage }}
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ .Values.fluentd.logs.autoscaling.targetCPUUtilizationPercentage }}
{{- if .Values.fluentd.logs.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: {{ .Values.fluentd.logs.autoscaling.targetMemoryUtilizationPercentage }}
{{- end -}}
{{- end -}}
18 changes: 16 additions & 2 deletions deploy/helm/sumologic/templates/metrics-hpa.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if .Values.fluentd.metrics.autoscaling.enabled}}
apiVersion: autoscaling/v1
apiVersion: autoscaling/v2beta2
kind: HorizontalPodAutoscaler
metadata:
name: {{ template "sumologic.metadata.name.metrics.hpa" . }}
Expand All @@ -13,5 +13,19 @@ spec:
name: {{ template "sumologic.metadata.name.metrics.statefulset" . }}
minReplicas: {{ .Values.fluentd.metrics.autoscaling.minReplicas }}
maxReplicas: {{ .Values.fluentd.metrics.autoscaling.maxReplicas }}
targetCPUUtilizationPercentage: {{ .Values.fluentd.metrics.autoscaling.targetCPUUtilizationPercentage }}
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ .Values.fluentd.metrics.autoscaling.targetCPUUtilizationPercentage }}
{{- if .Values.fluentd.metrics.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: {{ .Values.fluentd.metrics.autoscaling.targetMemoryUtilizationPercentage }}
{{- end -}}
{{- end -}}
2 changes: 2 additions & 0 deletions deploy/helm/sumologic/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@ fluentd:
minReplicas: 3
maxReplicas: 10
targetCPUUtilizationPercentage: 50
# targetMemoryUtilizationPercentage: 50

## Option to specify PodDisrutionBudgets
## You can specify only one of maxUnavailable and minAvailable in a single PodDisruptionBudget
Expand Down Expand Up @@ -572,6 +573,7 @@ fluentd:
minReplicas: 3
maxReplicas: 10
targetCPUUtilizationPercentage: 50
# targetMemoryUtilizationPercentage: 50

## Option to specify PodDisrutionBudgets
## You can specify only one of maxUnavailable and minAvailable in a single PodDisruptionBudget
Expand Down

0 comments on commit 70b2a17

Please sign in to comment.