diff --git a/main.tf b/main.tf index e35f4b2..6b0db3e 100644 --- a/main.tf +++ b/main.tf @@ -178,46 +178,6 @@ resource "helm_release" "castai_agent" { } } -resource "helm_release" "castai_evictor" { - name = "castai-evictor" - repository = "https://castai.github.io/helm-charts" - chart = "castai-evictor" - namespace = "castai-agent" - create_namespace = true - cleanup_on_fail = true - wait = true - - version = var.evictor_version - values = var.evictor_values - - set { - name = "replicaCount" - value = "0" - } - - dynamic "set" { - for_each = var.castai_components_labels - content { - name = "podLabels.${set.key}" - value = set.value - } - } - - dynamic "set" { - for_each = var.castai_components_sets - content { - name = set.key - value = set.value - } - } - - depends_on = [helm_release.castai_agent] - - lifecycle { - ignore_changes = [set, version] - } -} - resource "helm_release" "castai_cluster_controller" { name = "cluster-controller" repository = "https://castai.github.io/helm-charts" @@ -301,6 +261,66 @@ resource "null_resource" "wait_for_cluster" { } } +resource "helm_release" "castai_evictor" { + name = "castai-evictor" + repository = "https://castai.github.io/helm-charts" + chart = "castai-evictor" + namespace = "castai-agent" + create_namespace = true + cleanup_on_fail = true + wait = true + + version = var.evictor_version + values = var.evictor_values + + set { + name = "replicaCount" + value = "0" + } + + set { + name = "castai-evictor-ext.enabled" + value = "false" + } + + dynamic "set" { + for_each = var.castai_components_labels + content { + name = "podLabels.${set.key}" + value = set.value + } + } + + dynamic "set" { + for_each = var.castai_components_sets + content { + name = set.key + value = set.value + } + } + + depends_on = [helm_release.castai_agent] + + lifecycle { + ignore_changes = [set, version] + } +} + +resource "helm_release" "castai_evictor_ext" { + name = "castai-evictor-ext" + repository = "https://castai.github.io/helm-charts" + chart = "castai-evictor-ext" + namespace = "castai-agent" + create_namespace = false + cleanup_on_fail = true + wait = true + + version = var.evictor_ext_version + values = var.evictor_ext_values + + depends_on = [helm_release.castai_evictor] +} + resource "helm_release" "castai_pod_pinner" { name = "castai-pod-pinner" repository = "https://castai.github.io/helm-charts" @@ -310,6 +330,8 @@ resource "helm_release" "castai_pod_pinner" { cleanup_on_fail = true wait = true + version = var.pod_pinner_version + set { name = "castai.clusterID" value = castai_aks_cluster.castai_cluster.id diff --git a/variables.tf b/variables.tf index c51feea..ab2ab92 100644 --- a/variables.tf +++ b/variables.tf @@ -126,6 +126,12 @@ variable "evictor_values" { default = [] } +variable "evictor_ext_values" { + description = "List of YAML formatted string with evictor-ext values" + type = list(string) + default = [] +} + variable "kvisor_values" { description = "List of YAML formatted string values for kvisor helm chart" type = list(string) @@ -138,12 +144,6 @@ variable "agent_version" { default = null } -variable "spot_handler_version" { - description = "Version of castai-spot-handler helm chart. If not provided, latest version will be used." - type = string - default = null -} - variable "cluster_controller_version" { description = "Version of castai-cluster-controller helm chart. If not provided, latest version will be used." type = string @@ -156,6 +156,24 @@ variable "evictor_version" { default = null } +variable "evictor_ext_version" { + description = "Version of castai-evictor-ext chart. Default latest" + type = string + default = null +} + +variable "pod_pinner_version" { + description = "Version of pod-pinner helm chart. Default latest" + type = string + default = null +} + +variable "spot_handler_version" { + description = "Version of castai-spot-handler helm chart. If not provided, latest version will be used." + type = string + default = null +} + variable "kvisor_version" { description = "Version of kvisor chart. If not provided, latest version will be used." type = string