Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add pod-pinner to CAST AI onboarding #73

Merged
merged 1 commit into from
Dec 8, 2023
Merged
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
55 changes: 55 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,61 @@ resource "helm_release" "castai_evictor" {
}
}

resource "helm_release" "castai_pod_pinner" {
name = "castai-pod-pinner"
repository = "https://castai.github.io/helm-charts"
chart = "castai-pod-pinner"
namespace = "castai-agent"
create_namespace = true
cleanup_on_fail = true
wait = true

set {
name = "castai.clusterID"
value = castai_eks_cluster.my_castai_cluster.id
}

dynamic "set" {
for_each = var.api_url != "" ? [var.api_url] : []
content {
name = "castai.apiURL"
value = var.api_url
}
}

set_sensitive {
name = "castai.apiKey"
value = castai_eks_cluster.my_castai_cluster.cluster_token
andrejatcastai marked this conversation as resolved.
Show resolved Hide resolved
}

dynamic "set" {
for_each = var.grpc_url != "" ? [var.grpc_url] : []
content {
name = "castai.grpcURL"
value = var.grpc_url
}
}

dynamic "set" {
for_each = var.castai_components_labels
content {
name = "podLabels.${set.key}"
value = set.value
}
}

set {
name = "replicaCount"
value = "0"
}

depends_on = [helm_release.castai_agent]

lifecycle {
ignore_changes = [set, version]
}
}

resource "helm_release" "castai_spot_handler" {
name = "castai-spot-handler"
repository = "https://castai.github.io/helm-charts"
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ variable "castai_api_token" {
default = ""
}

variable "grpc_url" {
type = string
description = "gRPC endpoint used by pod-pinner"
default = "grpc.cast.ai:443"
}

variable "autoscaler_policies_json" {
type = string
description = "Optional json object to override CAST AI cluster autoscaler policies"
Expand Down
Loading