-
Notifications
You must be signed in to change notification settings - Fork 7
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 module for Azure PG flex server #152
Add module for Azure PG flex server #152
Conversation
…aged Identities modules Signed-off-by: Ferdinand de Baecque <45566171+Ferdinanddb@users.noreply.github.com>
Signed-off-by: Ferdinand de Baecque <45566171+Ferdinanddb@users.noreply.github.com>
…connect to it and create tables for the e2e test Signed-off-by: Ferdinand de Baecque <45566171+Ferdinanddb@users.noreply.github.com>
Signed-off-by: Ferdinand de Baecque <45566171+Ferdinanddb@users.noreply.github.com>
Looking really good, some comments inline |
Signed-off-by: Ferdinand de Baecque <45566171+Ferdinanddb@users.noreply.github.com>
@JorTurFer I took your comments in account and adapted the code accordingly :). |
Signed-off-by: Ferdinand de Baecque <45566171+Ferdinanddb@users.noreply.github.com>
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, great job
@zroubalik Thanks for your feedback and merging it! However, I see that the CICD stage that runs the Terraform In my case, I used the Switzerland North region to test this locally and I only created an AKS cluster and the resources from this module. Let me know if I can do something regarding this. |
Add a new module to create an Azure Postgres Flexible Server and modify the AKS and Managed Identities modules. I listed the following in the issue associated to this PR.
Modification of the managed identities module
azurerm_user_assigned_identity
that will be used by the e2e testsModification of the AKS module
azurerm_federated_identity_credential
to map the newly created user assigned identity to thekeda-operator
Kubernetes service account.New module for Azure Postgres Flexible Server
azurerm_postgresql_flexible_server
,azurerm_postgresql_flexible_server_active_directory_administrator
to grant admin role to the newly created user assigned identity,azurerm_postgresql_flexible_server_firewall_rule
to allow access to all Azure IPs.azurerm_postgresql_flexible_server_database
What do you think about this?
EDIT: I decided to add support for basic Postgres authentication, so that the current way of performing actions in the server (creating a table, write to the table, ...) for the e2e tests can persist. But the
ScaledObject
of the e2e tests will authenticate as the user managed identity added by this PR to interact with the server.There could be another way to handle this, but it is not as simple:
azurerm_postgresql_flexible_server_active_directory_administrator
for the service principal used by Terraform,azurerm_postgresql_flexible_server_firewall_rule
to add the public IP (or range) of the machines from where the GitHub Actions workflows are executed. This is not necessary if Terraform is being executed from a resource having an Azure IP.null_resource
resources + provisionerlocal-exec
to add Azure Managed Identities, see this link for an example of the queries to run. This query must be executed by a user AD admin within Postgres (this is why the resource from the 1st bullet point is needed).Checklist
Related to #151