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

feat: add ContainerResource type for HPA cpu/memory scaler #3513

Merged
merged 3 commits into from
Aug 8, 2022

Conversation

surki
Copy link
Contributor

@surki surki commented Aug 5, 2022

Context: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#container-resource-metrics

Added feature to target to a specific container in cpu/memory scalers

Checklist

Fixes #1378

Copy link
Member

@zroubalik zroubalik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if we apply this resource on k8s < 1.20?

CHANGELOG.md Outdated Show resolved Hide resolved
@zroubalik
Copy link
Member

zroubalik commented Aug 5, 2022

/run-e2e cpu*
Update: You can check the progress here

@zroubalik
Copy link
Member

zroubalik commented Aug 5, 2022

/run-e2e memory*
Update: You can check the progress here

@surki
Copy link
Contributor Author

surki commented Aug 8, 2022

What happens if we apply this resource on k8s < 1.20?

When we run it in k8s < 1.20 or with 1.20+ with the HPAContainerMetrics feature disabled, HPA object creation will fail, which I suppose the KEDA will propagate back to the user.

Signed-off-by: Suresh Kumar <[email protected]>
@zroubalik
Copy link
Member

zroubalik commented Aug 8, 2022

/run-e2e cpu*
Update: You can check the progress here

@tomkerkhove
Copy link
Member

What happens if we apply this resource on k8s < 1.20?

When we run it in k8s < 1.20 or with 1.20+ with the HPAContainerMetrics feature disabled, HPA object creation will fail, which I suppose the KEDA will propagate back to the user.

I would, however, improve this so that there is no HPA failure and we log an error + block ScaledObject/ScaledJob creation/edit to fail fast and notify the user.

@zroubalik
Copy link
Member

What happens if we apply this resource on k8s < 1.20?

When we run it in k8s < 1.20 or with 1.20+ with the HPAContainerMetrics feature disabled, HPA object creation will fail, which I suppose the KEDA will propagate back to the user.

I would, however, improve this so that there is no HPA failure and we log an error + block ScaledObject/ScaledJob creation/edit to fail fast and notify the user.

That happens already, failure in HPA -> failure in ScaledObject/Job.

@zroubalik zroubalik merged commit acb03ab into kedacore:main Aug 8, 2022
goku321 pushed a commit to goku321/keda that referenced this pull request Aug 8, 2022
@surki surki deleted the hpa-container-resource branch August 10, 2022 12:04
@aaron-sysdig
Copy link

hey @zroubalik was this change ever released? I dont see it in main? https://github.com/surki/keda/commits/main/pkg/scalers/cpu_memory_scaler.go

@zroubalik
Copy link
Member

Yes, it was. You need to check https://github.com/kedacore/keda/ not a fork

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow cpu/memory scaler to target a specific container in the pod
4 participants