Skip to content
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

fix: Updated aks module according to latest azurerm version #27

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

vjdbj
Copy link
Member

@vjdbj vjdbj commented Oct 11, 2024

what

  • Added subscription_id for provider in root module
  • Also updated the modules release version in root modules
  • Fixed automerge workflow.
  • Added flux extension to integrate fluxcd with aks.
  • Added Nodepool for spot instances

why

  • subscription_id is compulsory to add for terraform planning
  • Added Nodepool for spot instances so that we can use node with spot instances for less important work or testing.

@clouddrove-ci clouddrove-ci self-assigned this Oct 11, 2024
aks.tf Outdated
Comment on lines 2 to 432
client_secret = var.client_secret
}
}
dynamic "storage_profile" {
for_each = var.storage_profile_enabled ? ["storage_profile"] : []

content {
blob_driver_enabled = var.storage_profile.blob_driver_enabled
disk_driver_enabled = var.storage_profile.disk_driver_enabled
# disk_driver_version = var.storage_profile.disk_driver_version
file_driver_enabled = var.storage_profile.file_driver_enabled
snapshot_controller_enabled = var.storage_profile.snapshot_controller_enabled
}
}

identity {
type = var.private_cluster_enabled && var.private_dns_zone_type == "Custom" ? "UserAssigned" : "SystemAssigned"
}

dynamic "web_app_routing" {
for_each = var.web_app_routing == null ? [] : ["web_app_routing"]

content {
dns_zone_ids = var.web_app_routing.dns_zone_id
}
}

dynamic "linux_profile" {
for_each = var.linux_profile != null ? [true] : []
iterator = lp
content {
admin_username = var.linux_profile.username

ssh_key {
key_data = var.linux_profile.ssh_key
}
}
}

dynamic "workload_autoscaler_profile" {
for_each = var.workload_autoscaler_profile == null ? [] : [var.workload_autoscaler_profile]

content {
keda_enabled = workload_autoscaler_profile.value.keda_enabled
vertical_pod_autoscaler_enabled = workload_autoscaler_profile.value.vertical_pod_autoscaler_enabled
}
}




dynamic "windows_profile" {
for_each = var.windows_profile != null ? [var.windows_profile] : []

content {
admin_username = windows_profile.value.admin_username
admin_password = windows_profile.value.admin_password
license = windows_profile.value.license

dynamic "gmsa" {
for_each = windows_profile.value.gmsa != null ? [windows_profile.value.gmsa] : []

content {
dns_server = gmsa.value.dns_server
root_domain = gmsa.value.root_domain
}
}
}
}

network_profile {
network_plugin = var.network_plugin
network_policy = var.network_policy
network_data_plane = var.network_data_plane
dns_service_ip = cidrhost(var.service_cidr, 10)
service_cidr = var.service_cidr
load_balancer_sku = var.load_balancer_sku
network_plugin_mode = var.network_plugin_mode
outbound_type = var.outbound_type
pod_cidr = var.net_profile_pod_cidr


dynamic "load_balancer_profile" {
for_each = var.load_balancer_profile_enabled && var.load_balancer_sku == "standard" ? [1] : []

content {
idle_timeout_in_minutes = var.load_balancer_profile_idle_timeout_in_minutes
managed_outbound_ip_count = var.load_balancer_profile_managed_outbound_ip_count
managed_outbound_ipv6_count = var.load_balancer_profile_managed_outbound_ipv6_count
outbound_ip_address_ids = var.load_balancer_profile_outbound_ip_address_ids
outbound_ip_prefix_ids = var.load_balancer_profile_outbound_ip_prefix_ids
outbound_ports_allocated = var.load_balancer_profile_outbound_ports_allocated
}
}
}
depends_on = [
azurerm_role_assignment.aks_uai_private_dns_zone_contributor,
]
tags = module.labels.tags
}

Check warning

Code scanning / defsec

Ensure AKS logging to Azure Monitoring is Configured Warning

Cluster does not have logging enabled via OMS Agent.
@clouddrove-ci
Copy link
Member

Terraform Security Scan Failed

Show Output

@clouddrove-ci
Copy link
Member

Terraform Security Scan Failed

Show Output

@clouddrove-ci
Copy link
Member

Terraform Security Scan Failed

Show Output

aks.tf Outdated
}
}

# dynamic "api_server_access_profile" {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this commented? If not required please remove it or uncomment.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uncommented

aks.tf Outdated
dynamic "azure_active_directory_role_based_access_control" {
for_each = var.role_based_access_control == null ? [] : var.role_based_access_control
content {
# managed = azure_active_directory_role_based_access_control.value.managed
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this commented?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its Deprecated.

locals.tf Outdated
## Managed By : CloudDrove
## Copyright @ CloudDrove. All Right Reserved.

## Vritual Network and Subnet Creation
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove this part and above one also

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

locals.tf Outdated Show resolved Hide resolved
locals.tf Outdated Show resolved Hide resolved
@clouddrove-ci
Copy link
Member

Terraform Security Scan Failed

Show Output

@clouddrove-ci
Copy link
Member

Terraform Security Scan Failed

Show Output

@clouddrove-ci
Copy link
Member

Terraform Security Scan Failed

Show Output

@clouddrove-ci
Copy link
Member

Terraform Security Scan Failed

Show Output

@vjdbj vjdbj requested a review from 13archit November 12, 2024 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants