Skip to content

Commit 35a3fba

Browse files
authored
fix(examples,eks,live): extend variables.tf, allow dev-master castai api url (#523)
1 parent 3fa96f2 commit 35a3fba

5 files changed

Lines changed: 29 additions & 2 deletions

File tree

examples/eks/eks_cluster_live_migration/castai.tf

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@ module "cluster" {
33
count = var.enable_castai ? 1 : 0
44

55
cluster_name = var.cluster_name
6-
castai_api_token = var.castai_api_token
76
cluster_region = var.cluster_region
8-
vpc_id = module.vpc.vpc_id
7+
castai_api_token = var.castai_api_token
8+
castai_api_url = var.castai_api_url
9+
castai_grpc_url = var.castai_grpc_url
10+
11+
vpc_id = module.vpc.vpc_id
912
security_groups = [
1013
module.eks.cluster_security_group_id,
1114
module.eks.node_security_group_id,
@@ -14,4 +17,8 @@ module "cluster" {
1417
subnets = module.vpc.private_subnets
1518
live_proxy_version = var.live_proxy_version
1619
live_helm_version = var.live_helm_version
20+
21+
install_helm_live = var.install_helm_live
22+
23+
delete_nodes_on_disconnect = var.delete_nodes_on_disconnect
1724
}

examples/eks/eks_cluster_live_migration/eks.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ module "eks" {
2020
}
2121
}
2222

23+
tags = var.tags
24+
2325
vpc_id = module.vpc.vpc_id
2426
subnet_ids = module.vpc.private_subnets
2527

examples/eks/eks_cluster_live_migration/module/castai/castai.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ module "castai-eks-cluster" {
148148

149149
resource "helm_release" "live-helm" {
150150
name = "castai-live"
151+
count = var.install_helm_live ? 1 : 0
151152

152153
repository = "https://castai.github.io/helm-charts"
153154
chart = "castai-live"
@@ -172,6 +173,11 @@ resource "helm_release" "live-helm" {
172173
value = var.castai_api_token
173174
}
174175

176+
set {
177+
name = "castai.apiURL"
178+
value = var.castai_api_url
179+
}
180+
175181
wait = false
176182

177183
depends_on = [module.castai-eks-cluster]

examples/eks/eks_cluster_live_migration/module/castai/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,9 @@ variable "delete_nodes_on_disconnect" {
5151
description = "Optional parameter, if set to true - CAST AI provisioned nodes will be deleted from cloud on cluster disconnection. For production use it is recommended to set it to false."
5252
default = true
5353
}
54+
55+
variable "install_helm_live" {
56+
type = bool
57+
description = "Optional parameter, if set to true - the 'castai-live' Helm chart will be installed on the cluster. This is required for live migration feature."
58+
default = true
59+
}

examples/eks/eks_cluster_live_migration/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ variable "enable_castai" {
4949
default = true
5050
}
5151

52+
variable "install_helm_live" {
53+
type = bool
54+
description = "Optional parameter, if set to true - the 'castai-live' Helm chart will be installed on the cluster. This is required for live migration feature."
55+
default = true
56+
}
57+
5258
variable "live_proxy_version" {
5359
type = string
5460
default = "0.30.0"

0 commit comments

Comments
 (0)