Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TargetMemoryUtilization metric for AutoScaling #1223

Merged
Merged
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
1401868
Add TargetMemoryUtilization metric for AutoScaling
kevinearls Nov 4, 2022
c76eda2
Add changes to v2beta2 as there is no way to un e2e tests just for on…
kevinearls Nov 4, 2022
5f1130f
See if we just have a race condition
kevinearls Nov 4, 2022
f2d5652
Reset kuttl timeout
kevinearls Nov 7, 2022
de45a09
Add some debugging code to help analyze failures on github
kevinearls Nov 7, 2022
06c9d4c
Try to appease the linter
kevinearls Nov 7, 2022
80a1ce1
Merge branch 'main' into add-memory-utilization-metric
kevinearls Nov 8, 2022
7d3eede
Restore autoscale tests
kevinearls Nov 8, 2022
f80f9f4
Cleanup
kevinearls Nov 8, 2022
04402d3
More cleanup
kevinearls Nov 8, 2022
6f96d55
Merge branch 'main' into add-memory-utilization-metric
kevinearls Nov 14, 2022
52efcce
Respond to comments
kevinearls Nov 14, 2022
bc6ecb0
Cleanup whitespace so linter will rerun
kevinearls Nov 14, 2022
a7cfe40
Merge branch 'main' into add-memory-utilization-metric
kevinearls Nov 16, 2022
db1a05d
Merge branch 'main' into add-memory-utilization-metric
kevinearls Nov 18, 2022
df93b23
Merge branch 'main' into add-memory-utilization-metric
kevinearls Nov 22, 2022
6e87294
Don't set TargetCPUUtilization to default if another metric is set
kevinearls Nov 23, 2022
e8e489b
Merge branch 'main' into add-memory-utilization-metric
kevinearls Nov 30, 2022
0a7f5fe
Merge branch 'main' into add-memory-utilization-metric
kevinearls Nov 30, 2022
def0cc9
Merge branch 'main' into add-memory-utilization-metric
kevinearls Nov 30, 2022
76b9d46
Merge branch 'main' into add-memory-utilization-metric
kevinearls Nov 30, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Cleanup
Signed-off-by: Kevin Earls <[email protected]>
  • Loading branch information
kevinearls committed Nov 8, 2022
commit f80f9f4add095d6d30118146c4712fa0b1edf164
3 changes: 0 additions & 3 deletions pkg/collector/reconcile/horizontalpodautoscaler.go
Original file line number Diff line number Diff line change
@@ -131,12 +131,9 @@ func setAutoscalerSpec(params Params, autoscalingVersion autodetect.AutoscalingV

// This will update memory and CPU usage for now, and can be used to update other metrics in the future
for _, metric := range updated.(*autoscalingv2.HorizontalPodAutoscaler).Spec.Metrics {
fmt.Println(">>>>>>>>> In metrics for ", metric.Resource.Name)
if metric.Resource.Name == corev1.ResourceCPU {
fmt.Println(">>>>>>>>>> HPA Reconciler setting ", metric.Resource.Name, "to", *params.Instance.Spec.Autoscaler.TargetCPUUtilization)
metric.Resource.Target.AverageUtilization = params.Instance.Spec.Autoscaler.TargetCPUUtilization
} else if metric.Resource.Name == corev1.ResourceMemory {
fmt.Println(">>>>>>>>>> HPA Reconciler setting ", metric.Resource.Name, "to", *params.Instance.Spec.Autoscaler.TargetMemoryUtilization)
metric.Resource.Target.AverageUtilization = params.Instance.Spec.Autoscaler.TargetMemoryUtilization
}
}
5 changes: 2 additions & 3 deletions tests/e2e/autoscale/00-install.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# This creates three different deployments. The last two are to check the targetCPUUtilization and targetMemoryUtilization
# options. The first one will be used to see if we scale properly. Note that we are only scaling up to 2 because of
# limitations of KUTTL
# This creates two different deployments. The first one will be used to see if we scale properly. (Note that we are
# only scaling up to 2 because of limitations of KUTTL). The second is to check the targetCPUUtilization option.
#
apiVersion: opentelemetry.io/v1alpha1
kind: OpenTelemetryCollector