Skip to content
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
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,7 @@ Usage examples are located in [terraform provider repo](https://github.com/casta
| [helm_release.castai_evictor_self_managed](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource |
| [helm_release.castai_kvisor](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource |
| [helm_release.castai_kvisor_self_managed](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource |
| [helm_release.castai_live](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource |
| [helm_release.castai_pod_mutator](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource |
| [helm_release.castai_pod_mutator_self_managed](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource |
| [helm_release.castai_pod_pinner](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource |
Expand Down Expand Up @@ -529,6 +530,7 @@ Usage examples are located in [terraform provider repo](https://github.com/casta
| <a name="input_http_proxy"></a> [http\_proxy](#input\_http\_proxy) | Address to use for proxying http requests from CAST AI components running directly on nodes. | `string` | `null` | no |
| <a name="input_https_proxy"></a> [https\_proxy](#input\_https\_proxy) | Address to use for proxying https requests from CAST AI components running directly on nodes. | `string` | `null` | no |
| <a name="input_install_ai_optimizer"></a> [install\_ai\_optimizer](#input\_install\_ai\_optimizer) | Optional flag for installation of AI Optimizer (https://docs.cast.ai/docs/getting-started-ai) | `bool` | `false` | no |
| <a name="input_install_live"></a> [install\_live](#input\_install\_live) | Optional flag for installation of CAST AI Live (https://docs.cast.ai/docs/clm-getting-started) | `bool` | `true` | no |
| <a name="input_install_omni"></a> [install\_omni](#input\_install\_omni) | Optional flag for installing Omni capability | `bool` | `false` | no |
| <a name="input_install_pod_mutator"></a> [install\_pod\_mutator](#input\_install\_pod\_mutator) | Optional flag for installation of pod mutator | `bool` | `false` | no |
| <a name="input_install_security_agent"></a> [install\_security\_agent](#input\_install\_security\_agent) | Optional flag for installation of security agent (Kvisor - https://docs.cast.ai/docs/kvisor) | `bool` | `false` | no |
Expand All @@ -539,6 +541,8 @@ Usage examples are located in [terraform provider repo](https://github.com/casta
| <a name="input_kvisor_values"></a> [kvisor\_values](#input\_kvisor\_values) | List of YAML formatted string values for kvisor helm chart, see example: https://github.com/castai/terraform-provider-castai/tree/master/examples/aks/aks_cluster_with_security/castai.tf | `list(string)` | `[]` | no |
| <a name="input_kvisor_version"></a> [kvisor\_version](#input\_kvisor\_version) | Version of kvisor chart. If not provided, latest version will be used. | `string` | `null` | no |
| <a name="input_kvisor_wait"></a> [kvisor\_wait](#input\_kvisor\_wait) | Wait for kvisor chart to finish release | `bool` | `true` | no |
| <a name="input_live_values"></a> [live\_values](#input\_live\_values) | List of YAML formatted string with castai-live values | `list(string)` | `[]` | no |
| <a name="input_live_version"></a> [live\_version](#input\_live\_version) | Version of castai-live helm chart. Default latest | `string` | `null` | no |
| <a name="input_no_proxy"></a> [no\_proxy](#input\_no\_proxy) | List of addresses to skip proxying requests from CAST AI components running directly on nodes. Used with http\_proxy and https\_proxy. | `list(string)` | `[]` | no |
| <a name="input_node_configurations"></a> [node\_configurations](#input\_node\_configurations) | Map of AKS node configurations to create | `any` | `{}` | no |
| <a name="input_node_resource_group"></a> [node\_resource\_group](#input\_node\_resource\_group) | n/a | `string` | n/a | yes |
Expand Down
26 changes: 26 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ resource "castai_node_template" "this" {
is_enabled = try(each.value.is_enabled, null)
configuration_id = try(each.value.configuration_name, null) != null ? castai_node_configuration.this[each.value.configuration_name].id : can(each.value.configuration_id) ? length(regexall(local.configuration_id_regex_pattern, each.value.configuration_id)) > 0 ? each.value.configuration_id : castai_node_configuration.this[each.value.configuration_id].id : null
should_taint = try(each.value.should_taint, true)
clm_enabled = try(each.value.clm_enabled, false)
rebalancing_config_min_nodes = try(each.value.rebalancing_config_min_nodes, 0)

custom_labels = try(each.value.custom_labels, {})
Expand Down Expand Up @@ -1120,6 +1121,31 @@ resource "helm_release" "castai_ai_optimizer_proxy_self_managed" {
depends_on = [helm_release.castai_agent, helm_release.castai_cluster_controller]
}

resource "helm_release" "castai_live" {
count = var.install_live ? 1 : 0

name = "castai-live"
repository = "https://castai.github.io/helm-charts"
chart = "castai-live"
namespace = "castai-agent"
create_namespace = true
cleanup_on_fail = true
wait = true

version = var.live_version
values = var.live_values

set = concat(
local.set_cluster_id,
local.set_apiurl,
local.set_components_sets,
)

set_sensitive = local.set_sensitive_apikey

depends_on = [helm_release.castai_agent]
}

data "azurerm_kubernetes_cluster" "aks" {
count = var.install_omni && !var.self_managed ? 1 : 0

Expand Down
18 changes: 18 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,24 @@ variable "ai_optimizer_values" {
default = []
}

variable "install_live" {
type = bool
default = true
description = "Optional flag for installation of CAST AI Live (https://docs.cast.ai/docs/clm-getting-started)"
}

variable "live_version" {
description = "Version of castai-live helm chart. Default latest"
type = string
default = null
}

variable "live_values" {
description = "List of YAML formatted string with castai-live values"
type = list(string)
default = []
}

variable "install_omni" {
description = "Optional flag for installing Omni capability"
type = bool
Expand Down
Loading