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

Allow skipping service principle creation #47

Merged
merged 1 commit into from
Oct 3, 2024
Merged
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
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
}