Add role assignments for ingress application gateway and corresponding example#426
Add role assignments for ingress application gateway and corresponding example#426lonegunmanb merged 8 commits intoAzure:mainfrom
Conversation
|
Potential Breaking Changes in d1ea167: |
|
Potential Breaking Changes in 2b1ff07: |
|
Potential Breaking Changes in fb538b0: |
|
Hi @zioproto, would you please give this pr a review? Thanks! |
|
This PR fixes the roles assignments when the Application Gateway is created by user with an external to the module Terraform resource. The scenario depicted in issue #223 is when we expect the AGIC controller running in the cluster to create the Application Gateway on behalf of the user. I tried with the following config: And I still see in my |
|
|
||
| provider "kubernetes" { | ||
| host = module.aks.admin_host | ||
| client_certificate = base64decode(module.aks.admin_client_certificate) |
There was a problem hiding this comment.
Is using this output from the AKS module safe ?
The most reliable way to configure the Kubernetes provider is to ensure that the cluster itself and the Kubernetes provider resources can be managed with separate apply operations. Data-sources can be used to convey values between the two stages as needed.
Just double checking because we don't want to introduce random CI failures
| @@ -0,0 +1,65 @@ | |||
| resource "azurerm_log_analytics_workspace" "main" { | |||
There was a problem hiding this comment.
How this change about azurerm_log_analytics_workspace is related with the role assignments for ingress ? Should this go to a different PR ?
There was a problem hiding this comment.
I understand now you are moving this resource to a different file. You could do this cleanup in a different PR for readability.
| for_each = var.api_server_authorized_ip_ranges != null || var.api_server_subnet_id != null ? [ | ||
| "api_server_access_profile" | ||
| ] : [] | ||
| for_each = var.api_server_authorized_ip_ranges != null || var.api_server_subnet_id != null ? ["api_server_access_profile"] : [] |
There was a problem hiding this comment.
Is this a change in formatting that was applied automatically by terraform fmt ?
| for_each = var.load_balancer_profile_enabled && var.load_balancer_sku == "standard" ? [ | ||
| "load_balancer_profile" | ||
| ] : [] | ||
| for_each = var.load_balancer_profile_enabled && var.load_balancer_sku == "standard" ? ["load_balancer_profile"] : [] |
There was a problem hiding this comment.
Change in formatting, why ?
| description = "(Optional) The ID of the Subnet where the API server endpoint is delegated to." | ||
| } | ||
|
|
||
| variable "application_gateway_for_ingress" { |
There was a problem hiding this comment.
This is used when the Application Gateway is created with a resource outside of the module.
This change is not related to the issue #223 linked in this PR, where it is the AGIC controller running in the AKS cluster that is in charge of creating the Application Gateway.
| create_analytics_workspace = var.log_analytics_workspace_enabled && var.log_analytics_workspace == null | ||
| create_analytics_solution = var.log_analytics_workspace_enabled && var.log_analytics_solution == null | ||
| create_analytics_workspace = var.log_analytics_workspace_enabled && var.log_analytics_workspace == null | ||
| create_role_assignments_for_application_gateway = try(var.application_gateway_for_ingress.create_role_assignments, false) |
There was a problem hiding this comment.
The role assignments should be created if var.ingress_application_gateway_enabled = true
|
In my testing scenario each nodepool has a dedicated subnet. I have a https://github.com/zioproto/istio-aks-example/blob/main/multicluster-istio-on-aks/nodepools.tf When the AGIC creates the Application Gateway I see the error The problem seems to be there only for the |
|
Next steps:
|
|
Potential Breaking Changes in d5a2de4: |
|
Potential Breaking Changes in e388792: |
|
Potential Breaking Changes in b577a56: |
|
Hi @zioproto would you please give this pr another review? Thanks! |
|
Potential Breaking Changes in 399ab35: |
Describe your changes
This pr added
azurerm_role_assignmentresources so the existing application gateway could work immediately. It also added a working example.This pr contains breaking change.
Issue number
#223
Checklist before requesting a review
CHANGELOG.mdfileThanks for your cooperation!