Skip to content

Commit

Permalink
Merge pull request #47 from isovalent/pr/ayuspin/allow-disabling-sp
Browse files Browse the repository at this point in the history
Allow skipping service principle creation
  • Loading branch information
ayuspin authored Oct 3, 2024
2 parents 8844041 + 8e625bd commit 7dfa5af
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ An opinionated Terraform module that can be used to create and manage an AKS clu
| <a name="input_resource_group_name"></a> [resource\_group\_name](#input\_resource\_group\_name) | The name of the Azure resource group in which to create the AKS cluster. | `string` | n/a | yes |
| <a name="input_root_disk_size"></a> [root\_disk\_size](#input\_root\_disk\_size) | The size (in GB) of the root disk. | `number` | `100` | no |
| <a name="input_service_cidr"></a> [service\_cidr](#input\_service\_cidr) | The CIDR block to use for services. | `string` | n/a | yes |
| <a name="input_sp_enabled"></a> [sp\_enabled](#input\_sp\_enabled) | Set to false to disable service principle creation | `bool` | `true` | no |
| <a name="input_subnet_id"></a> [subnet\_id](#input\_subnet\_id) | The ID of the subnet where to place the node pool. | `string` | n/a | yes |

## Outputs
Expand Down
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ module "main" {

// Create an Azure AD service principal that Cilium can run under.
module "cilium_service_principal" {
count = var.sp_enabled == true ? 1 : 0
source = "git::https://github.com/isovalent/terraform-azure-service-principal.git?ref=v1.1"

application_name = "${var.name}-cilium"
Expand Down
4 changes: 2 additions & 2 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
// limitations under the License.

output "cilium_service_principal_client_id" {
value = module.cilium_service_principal.client_id
value = length(module.cilium_service_principal) > 0 ? module.cilium_service_principal[0].client_id : null
}

output "cilium_service_principal_client_secret" {
value = module.cilium_service_principal.client_secret
value = length(module.cilium_service_principal) > 0 ? module.cilium_service_principal[0].client_secret : null
}

output "cluster_name" {
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,10 @@ variable "kube_proxy_disabled" {
description = "Disable kube-proxy"
default = false
type = bool
}

variable "sp_enabled" {
description = "Set to false to disable service principle creation"
default = true
type = bool
}

0 comments on commit 7dfa5af

Please sign in to comment.