Skip to content

Commit fd36745

Browse files
Add Omni support (#123)
1 parent d52950a commit fd36745

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

main.tf

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,3 +1104,28 @@ resource "helm_release" "castai_ai_optimizer_proxy_self_managed" {
11041104

11051105
depends_on = [helm_release.castai_agent, helm_release.castai_cluster_controller]
11061106
}
1107+
1108+
data "azurerm_kubernetes_cluster" "aks" {
1109+
count = var.install_omni && !var.self_managed ? 1 : 0
1110+
1111+
name = var.aks_cluster_name
1112+
resource_group_name = var.resource_group
1113+
}
1114+
1115+
module "castai_omni_cluster" {
1116+
count = var.install_omni && !var.self_managed ? 1 : 0
1117+
# tflint-ignore: terraform_module_pinned_source
1118+
source = "github.com/castai/terraform-castai-omni-cluster"
1119+
1120+
k8s_provider = "aks"
1121+
api_url = var.api_url
1122+
api_token = var.castai_api_token
1123+
organization_id = castai_aks_cluster.castai_cluster.organization_id
1124+
cluster_id = castai_aks_cluster.castai_cluster.id
1125+
cluster_name = var.aks_cluster_name
1126+
cluster_region = data.azurerm_kubernetes_cluster.aks[0].location
1127+
1128+
api_server_address = "https://${data.azurerm_kubernetes_cluster.aks[0].fqdn}"
1129+
pod_cidr = data.azurerm_kubernetes_cluster.aks[0].network_profile[0].pod_cidr
1130+
service_cidr = data.azurerm_kubernetes_cluster.aks[0].network_profile[0].service_cidr
1131+
}

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,3 +310,9 @@ variable "ai_optimizer_values" {
310310
type = list(string)
311311
default = []
312312
}
313+
314+
variable "install_omni" {
315+
description = "Optional flag for installing Omni capability"
316+
type = bool
317+
default = false
318+
}

0 commit comments

Comments
 (0)