-
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
TriggerAuthentication
with Azure Key Vault and azure-workload causes Panic/crash after upgrade to 2.9.0
#4010
Comments
The reason for the change is that there's no problem in the key-vault itself using the |
As @v-shenoy said, there were a race condition in Azure Scalers and we move the section as you have said. I guess that the problem is that you were using Azure Key Vault secret provider with pod identity, right? The support was added to the code but never was officially released, you saw it browsing the code or just by luck, but not in the documentation. Once again, sorry for the inconvenience generated, but a change of something not officially documented and released isn't a breaking change, at least IMO |
In v2.9 the support for pod identities has been added, documented and released, and now we will maintain it as part of our deprecation policy |
We should fix the code anyway, to not panic. |
Hrmm... I don't remember ever seeing the line about it not being supported. I did at the time browse the code, etc. so perhaps I picked it up from there (?). There also were a few issues with the docs at the time and the current versions weren't in sync with the updates and I think were outdated in general so it's possible that warning just wasn't yet there in the right spot. So to be clear:
If someone is using both, it seems a little weird to require both properties be set, especially if they are the same thing. I've no problem moving my settings, but is there any reason it can't fall-back to the spec-level property if the vault-specific one is not specified? And yes--at the very least it shouldn't panic :-) Technically-breaking change or not, it did work in some circumstances. A little note about the fact it now definitely won't couldn't hurt... |
yes, we should |
The main reason IMO is that the podIdentity here is the mechanism to authenticate the Key Vault, and not the scaler, that's why it makes sense to me. As we have a section for client info inside the section because it's an authentication method, we have another section inside to pod identity. But I'm not the owner of the truth, WDYT @kedacore/keda-core-contributors ? |
I can agree there, but I feel like it might be a common case to be using the same identity to authenticate both scenarios. Perhaps specifying the vault-level pod-identity property without the clientId could fall back to the top/scaler-level clientId (if specified) and then otherwise to the SA-level one? Then you're at least saying "hey I want podIdentity for key vault" but not repeating the clientId if they're going to be the same. Though...I suppose that falls apart if you want it to fall back to the SA's clientId and not the scaler's. OK, so I guess I can see the need to be explicit. /shrug... Sorry, thinking out loud here |
Report
We are using Azure Workload Identity as our
podIdentity
provider. We have aTriggerAuthentication
that usespodIdentity
and Azure Key Vault. Prior to upgrading to 2.9.0 everything worked fine. Now, KEDA operator crashes with the below.It seems like the upgrade has stopped KEDA from recognizing the
spec.podIdentity
settings of aTriggerAuthentication
when communicating with Azure Key Vault, despite having worked before. KEDA 2.9.0 introduced a newspec.azureKeyVault.podIdentity
field (I don't quite understand why) and the operator attempts to use, even whennil
. At the very least I'd expect the operator to fall back to the pre-existing settings inspec.podIdentity
.Expected Behavior
TriggerAuthentication
with Azure Keyvault and theazure-workload
pod-identity provider works without issue (especially following an upgrade). TheTriggerAuthentication
specification now contains twopodIdentity
properties; at the very least it should fallback to thespec.podIdentity
field when absent.Actual Behavior
KEDA Operator crashes with the above panic
Steps to Reproduce the Problem
This requires Azure Workload Identity, a Key Vault with secrets, an identity with access to the vault and a federated credential created on the Identity for keda/keda-operator service account. This example uses a Redis scaler and pulls values from Key Vault
Trigger Authentication:
Scaler:
KEDA Version
2.9.0
Kubernetes Version
1.24
Platform
Microsoft Azure
Scaler Details
Redis, among others
Anything else?
This appears to have been introduced here: #3814
The CRDS/configuration were updated and now contain two
podIdentity
properties. The pre-existing one is a top-level property of the spec (spec.podIdentity
), while the new one is a child of the Azure Key Vault settingsspec.azureKeyVault.podIdentity
. If I move thepodIdentity
configuration from the top-level to underazureKeyVault
everything now works:The
spec.podIdentity
property has existed forever... it received updates (for azure workload) as part of 2.8.0 (#2907), though there were some issues with the chart-bundled CRDs and Docs being misaligned and needing backporting.I checked the changelog/Readme and didn't see anything about this being a breaking change. I still don't quite understand why there are two different properties serving the same purpose... at the very least it seems one should fall back to the other. If this is in fact intentional, can someone explain which property you are meant to use under what circumstances? I suppose it might make sense if you needed one identity for Key Vault and another for connecting to the target resource;. Being able to specify them separately could be useful in that scenario, but the operator should fall back to the "nearest" settings that exist--or document as a breaking change!
You can see it still exists at the top-level:
keda/apis/keda/v1alpha1/triggerauthentication_types.go
Lines 65 to 68 in f4bee67
But it also exists as part of the AzureKeyVault settings:
keda/apis/keda/v1alpha1/triggerauthentication_types.go
Lines 185 to 191 in f4bee67
And in the CRDS:
keda/config/crd/bases/keda.sh_triggerauthentications.yaml
Line 100 in f4bee67
keda/config/crd/bases/keda.sh_triggerauthentications.yaml
Line 195 in f4bee67
The text was updated successfully, but these errors were encountered: