-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
adding support for azure managed prometheus #4256
Conversation
Signed-off-by: Raghav Gupta <guptaraghav16@gmail.com>
@tomkerkhove @JorTurFer Created this PR. I am working on e2e tests, changelog and documentation parallely. I understand that this PR will not be merged until those are pending. Still raising this so that you can help in revieweing the changes and we are not blocked, in case you suggest any code changes. Please take a look. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good in general, I'll wait till all the things are ready, but in the meantime I have kept some comments inline.
BTW, thanks for this improvement.
For e2e tests, do you need some help?
You have to open a PR to the infra repo using terraform in order to create the needed resources
pkg/scalers/azure/azure_managed_prometheus_http_round_tripper.go
Outdated
Show resolved
Hide resolved
pkg/scalers/azure/azure_managed_prometheus_http_round_tripper.go
Outdated
Show resolved
Hide resolved
Terraform does not support it yet so we did it manually (as I shared offline with you :)) |
@JorTurFer Thanks for offering the help, I might need some actually! I am little confused on the flow of e2e tests, for example are all tests run in Azure env? Is it a requirement to run tests on ezisting AKS clusters? what if I create new for Azure Mnaged Prometheus - how would nightly and pr runs get affected? Azure Managed Prometheus and native Prometheus might not work on 1 cluster at a time. Yes I can think of cleanup but then, if installing and uninstalling an "addon" on AKS cluser is supported right now by test framework? And may be couple of more ques.. I am afraid, figuring all that by mysef will take time and I may miss next release. Is it possible to connect on a quick call? What would be your preferred time? I can ping you on slack.. |
We can deploy it using terraform + ARM, but I wouldn't add infra manually if it isn't the only option. I can tackle that PR for adding the manged Prometheus if @raggupta-ms faces with problems |
As mentioned, it's not supported yet :) |
I'm almost there :) |
Signed-off-by: Raghav Gupta <guptaraghav16@gmail.com>
Thank you @JorTurFer for the automation! |
You're welcome. It has been an interesting exercise 😝 |
Signed-off-by: Raghav Gupta <guptaraghav16@gmail.com>
Signed-off-by: Raghav Gupta <guptaraghav16@gmail.com>
Thank you very much @JorTurFer for helping out on this. It was not straight forward but you made it work :) |
@tomkerkhove @JorTurFer The code changes are done and updated in the PR. Please review. btw, do you know why e2e tests are not running in this PR? Seems like its queued but not getting picked up any worker. Do I need to do anythig special to triggere tests on the PR? |
vendor/github.com/Azure/go-autorest/autorest/azure/environments.go
Outdated
Show resolved
Hide resolved
Signed-off-by: Raghav Gupta <guptaraghav16@gmail.com>
Signed-off-by: Raghav Gupta <guptaraghav16@gmail.com>
tests/scalers/prometheus/azure_managed_prometheus/azure_managed_prometheus_test.go
Outdated
Show resolved
Hide resolved
I'm not sure if we should place the e2e test inside Prometheus folder or inside azure folder. @kedacore/keda-core-contributors ? |
pkg/scalers/azure/azure_managed_prometheus_http_round_tripper.go
Outdated
Show resolved
Hide resolved
/run-e2e prometheus* |
Signed-off-by: Raghav Gupta <guptaraghav16@gmail.com>
/run-e2e azure_managed_prometheus* |
I added that here since azure managed prometheus doesn't have its own scaler, but an extension to existing prometheus scaler. But I am open to putting beside other azure scalers since that also makes sense, based on what people think. |
Signed-off-by: Raghav Gupta <guptaraghav16@gmail.com>
/run-e2e prometheus* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/run-e2e prometheus*
/run-e2e prometheus* |
/run-e2e prometheus* |
Signed-off-by: Raghav Gupta <guptaraghav16@gmail.com>
/run-e2e prometheus* |
Signed-off-by: Raghav Gupta <guptaraghav16@gmail.com>
/run-e2e prometheus* |
/run-e2e prometheus* |
Given it works but it's a test optimization, we might want to do that in a seperate PR then - Make sense? |
I think that a test which requires being executed twice always is a flaky test. It isn't an optimization IMO |
Agreed but my point was more that I don't think it should block this PR from being merged and we can do it async? |
We should try to avoid merging flaky tests if possible 🙏 This one seems like an easy fix, so could be easily included in this PR. And the current behaviour also extends the execution time of e2e test suite, which is not great 😄 |
@tomkerkhove @JorTurFer @zroubalik regarding the flakyness of test, I think it makes sense to increase the timeout. Since this is managed prometheus running on cloud there are delays. Roughly like this:
so test can be flaky as it waits for scale out/in for 5 min. I will increase that timeout to 7min to be safe. Let me know if there are any concerns. Small fix, will update PR in shortly. Edit: |
Signed-off-by: Raghav Gupta <guptaraghav16@gmail.com>
@raggupta-ms My proposal is to move this code: func TestSetupAzureManagedPrometheusComponents(t *testing.T) {
// this will install config map in kube-system namespace, as needed by azure manage prometheus collector agent
KubectlApplyWithTemplate(t, helper.EmptyTemplateData{}, "azureManagedPrometheusConfigMapTemplate", helper.AzureManagedPrometheusConfigMapTemplate)
} between |
Signed-off-by: Raghav Gupta <guptaraghav16@gmail.com>
good call out, made that change. Also increased timout by 2 min. it should succeed now. Let's see.. please trigger e2e.. |
/run-e2e prometheus* |
/run-e2e prometheus* |
It seems that the change during the setup has been enough |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@tomkerkhove @JorTurFer @zroubalik Thankyou for all the help and support throught! I learned a lot during this contribution. |
You're welcome! Thanks to you for the contribution! :) |
Adding Azure Workload Identity and Azure Pod Identity Auth support to existing Prometheus scaler. This will enable Azure Managed Prometheus use case with KEDA.
Checklist
Relates to #4153