-
Notifications
You must be signed in to change notification settings - Fork 475
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 role assignments for ingress application gateway and corresponding example #426
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
log_analytics.tf
Outdated
@@ -0,0 +1,65 @@ | |||
resource "azurerm_log_analytics_workspace" "main" { |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand now you are moving this resource to a different file. You could do this cleanup in a different PR for readability.
main.tf
Outdated
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a change in formatting that was applied automatically by terraform fmt
?
main.tf
Outdated
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change in formatting, why ?
variables.tf
Outdated
@@ -222,6 +222,20 @@ variable "api_server_subnet_id" { | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
locals.tf
Outdated
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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_assignment
resources 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.md
fileThanks for your cooperation!