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

PMFR4PLTFND-1316: add rbac_aad_azure_rbac_enabled var #409

Open
wants to merge 1 commit into
base: staging
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/CONFIG-VARS.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,12 @@ The ability to manage RBAC for Kubernetes resources from Azure gives you the cho
Following are the possible ways to configure Authentication and Authorization in an AKS cluster:
1. Authentication using local accounts with Kubernetes RBAC. This is traditionally used and current default, see details [here](https://learn.microsoft.com/en-us/azure/aks/concepts-identity#kubernetes-rbac)
2. Microsoft Entra authentication with Kubernetes RBAC. See details [here](https://learn.microsoft.com/en-us/azure/aks/azure-ad-rbac)
3. Microsoft Entra authentication with Azure RBAC. See details [here](https://learn.microsoft.com/en-us/azure/aks/manage-azure-rbac)

| Name | Description | Type | Default |
| :--- | ---: | ---: | ---: |
| rbac_aad_enabled | Enables Azure Active Directory integration with Kubernetes RBAC. | bool | false |
| rbac_aad_azure_rbac_enabled | Enables Azure RBAC. If false, Kubernetes RBAC is used. Only relevant if rbac_aad_enabled is true. | bool | false |
| rbac_aad_admin_group_object_ids | A list of Object IDs of Azure Active Directory Groups which should have Admin Role on the Cluster. | list(string) | null |
| rbac_aad_tenant_id | (Optional) The Tenant ID used for Azure Active Directory Application. If this isn't specified the Tenant ID of the current Subscription is used.| string | |

Expand Down
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ module "aks" {
client_secret = var.client_secret
rbac_aad_tenant_id = var.rbac_aad_tenant_id
rbac_aad_enabled = var.rbac_aad_enabled
rbac_aad_azure_rbac_enabled = var.rbac_aad_azure_rbac_enabled
rbac_aad_admin_group_object_ids = var.rbac_aad_admin_group_object_ids
aks_private_cluster = var.cluster_api_mode == "private" ? true : false
depends_on = [module.vnet]
Expand Down
2 changes: 1 addition & 1 deletion modules/azure_aks/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ resource "azurerm_kubernetes_cluster" "aks" {
content {
tenant_id = var.rbac_aad_tenant_id
admin_group_object_ids = var.rbac_aad_admin_group_object_ids
azure_rbac_enabled = false
azure_rbac_enabled = var.rbac_aad_azure_rbac_enabled
}
}

Expand Down
9 changes: 8 additions & 1 deletion modules/azure_aks/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,13 @@ variable "aks_cluster_location" {

variable "rbac_aad_enabled" {
type = bool
description = "Enables Azure Active Directory integration with Kubernetes RBAC."
description = "Enables Azure Active Directory integration with Kubernetes or Azure RBAC."
default = false
}

variable "rbac_aad_azure_rbac_enabled" {
type = bool
description = "Enables Azure RBAC. If false, Kubernetes RBAC is used. Only relevant if rbac_aad_enabled is true."
default = false
}

Expand All @@ -40,6 +46,7 @@ variable "rbac_aad_tenant_id" {
default = null
}


variable "aks_cluster_sku_tier" {
description = "The SKU Tier that should be used for this Kubernetes Cluster. Possible values are Free, Standard (which includes the Uptime SLA) and Premium. Defaults to Free"
type = string
Expand Down
8 changes: 7 additions & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,13 @@ variable "location" {
## Azure AD
variable "rbac_aad_enabled" {
type = bool
description = "Enables Azure Active Directory integration with Kubernetes RBAC."
description = "Enables Azure Active Directory integration with Kubernetes or Azure RBAC."
default = false
}

variable "rbac_aad_azure_rbac_enabled" {
type = bool
description = "Enables Azure RBAC. If false, Kubernetes RBAC is used. Only relevant if rbac_aad_enabled is true."
default = false
}

Expand Down