-
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
Add Azure monitor scaler #584
Add Azure monitor scaler #584
Conversation
Thanks for your PR! A few small questions:
|
From a happy user! :) Agree with @tomkerkhove about the prefix. It should be aad which is the common abbrevation for Azure Active Directory. Principle should be Principal. I would prefer aadClientId and aadClientSecret instead of using Principal. |
Update: all the above resolved after most recent commit. |
…, and resource name
e8a5d2e
to
a4dc5ce
Compare
@dimberman, @rasavant-ms, @ahmelsayed for review please |
… unused parts from struct
1793c62
to
a387532
Compare
a387532
to
866c2e9
Compare
…rror. Delete debugging comment
@ahmelsayed @dimberman, there are 3 more commits for you all to look at. I ran into some git troubles so ignore the force pushes and base branch changes. Didn't realize that you can't rebase against master mid pull request without those changes showing up. |
Awesome, I presume we'll wait with merging the PR then or?
Thanks 🙌 |
Would you mind opening a PR to https://github.com/kedacore/keda-docs as well please? |
@tomkerkhove For sure. It's next on my list after I finish my other to dos.
I think the plan is not to wait since I suspect (from my initial digging around in the codebase) that the nested format will not be an easy thing to fix. But I'm new to contributing so I could be wrong. I know for sure that there was no talk of waiting on my pr until the nesting format is supported. |
@lee0c for review |
…etAzureMetricValue into three smaller functions
@ahmelsayed, refactored the code to break it into smaller functions. Couldn't decide whether I should have |
@melmaliacone the change LGTM. are you still working on the pod identity and tests? a metadata parsing validation test would be great since it's easy to regress those. Pod identity can be a separate PR, but it's up to you if you're already working on it. |
I’m close to being done with the test so I think I’ll make pod identity a separate pr so we can get this merged sooner. |
What's the status of #590? If we merge this PR before this is implemented then we already have a breaking change on the trigger spec side which is not ideal. Personally, I would wait until #590 is resolved. What do you think @jeffhollan @ahmelsayed? |
I don't really know how a union/sum type could be implemented in go's type system. If this were json marshal/unmarshal, I think we'd need to use a json.RawMessage and a custom unmarshal method, but I have no idea how the controller/client code generation would handle that. Maybe someone more familiar with that might know. |
Not positive which comment the union/sum was in response to - but regardless to @tomkerkhove I don't think we should wait for #590 primarily because it's just proposed right now and not even aware if anyone is willing to pick up and size of work it would be. I want it - but I don't think it would make sense to block this scaler on it. Would be a future enhancement if / when #590 is resolved. EDIT: Ah - TIL about union/sum type. So yes we'd still need to sort out #590 specifics with how metdata works today |
@jeffhollan yes I was referring to me not knowing how to implement #590. sorry for the cryptic reply. If my understanding is correct, conceptually we want metadata to be one of many possible types based on the scaler or trigger type, which is what I was referring to as a sum/union type. I don't think that can be represented in Go/operator-sdk/kubernetes code-gen (as far as I know at least, but correct me please if it's possible). I agree with you that we shouldn't block this PR on #590. |
It's ok for me to go ahead but think we'll need #613 over time.
Isn't it a matter of how the spec (config) is mapped to internal object? I don't know Go but would surprise me if you can't map two config formats into an internal format? |
I got rid of any references to |
All done, but would like to do some more testing with different Azure Monitor metrics. I'll remove the WIP when I'm done. |
Added support for |
Fixes #155
Majority of the code in
azure_monitor.go
taken from azure-k8s-metrics-adapter.ScaledObject I used for testing authentication from metadata (minus the credentials)
Here's the file I used for testing custom
metricAggregationInterval
and authentication withauthParams
andresolvedEnv
TODO
metricAggregationInterval
other than 5 minute defaultresolvedEnv
orauthParams