Is it feasible for PostgreSQL Scaler to support token authentication? #5541
Replies: 2 comments
-
For info I just wrote a message in the KEDA's Slack channel to better explain what I described in my original post, here is the message 😄 : I recently wrote a discussion post on KEDA’s GitHub repo about the possibility to use access token credentials for the KEDA’s Postgres scaler authentication. My initial post may not have been entirely clear, and the code proposal I shared might not have been the best approach to address the issue. Let me briefly recap my requirement: Since I wrote the discussion post, I forked and tried to implement the feature myself, I drew inspiration from the Azure Pipelines scaler’s implementation, and now I believe I have a viable approach to propose in a PR. It’s worth noting that my implementation deviates from the code snippet I initially described in the discussion. But I have the following interrogation though :
I am eager to contribute by implementing this feature along with all the necessary tests, but your guidance on how best to proceed would be greatly appreciated! |
Beta Was this translation helpful? Give feedback.
-
Hi,
Let me explain what I am facing:
My problem is the following:
Based on the documentation here that showcase an Airflow example and the code here , it seems that what I did presents some limits because, as I explained, I don't have any password for my Azure Managed Identity (I generate a token each time a process needs to interact with the PostgreSQL database).
As of now, the supported options seem to be that I provide a password as a hard-coded value, or I provide the name of an environment variable which value is either the password or the connection (that include the password).
I would like to know if it would be a good idea to support a new way of dealing with the password that looks like the following in pseudocode:
In my snippet,
cred, err := azidentity.NewDefaultAzureCredential(nil)
authenticates seamlessly as the clientID specified when deploying the Helm chart withhelm upgrade -i .... --set podIdentity.azureWorkload.enabled=true --set podIdentity.azureWorkload.clientId={azure-ad-client-id} --set podIdentity.azureWorkload.tenantId={azure-ad-tenant-id}
, as described here.If such an option is added, then it would be possible to use it in the official Airflow Helm chart here.
Would it be a good idea to include that kind of mechanism in order to connect to PostgreSQL in general?
My example is really specific to Azure, but I think that the behavior can be generalized for many cloud providers, isn't it?
I have the feeling that it could be a good feature (if it does not already exist) because that way we don't even have to manage password anymore.
Beta Was this translation helpful? Give feedback.
All reactions