Skip to content

Commit

Permalink
feat: Introduced castai-evictor-ext chart
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrej Kislovskij committed May 13, 2024
1 parent e1152f8 commit b019cf6
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 46 deletions.
102 changes: 62 additions & 40 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand All @@ -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
Expand Down
30 changes: 24 additions & 6 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit b019cf6

Please sign in to comment.