Skip to content

Commit

Permalink
format tf
Browse files Browse the repository at this point in the history
  • Loading branch information
davex98 committed Nov 30, 2023
1 parent 576de74 commit 9050e4b
Show file tree
Hide file tree
Showing 63 changed files with 324 additions and 324 deletions.
6 changes: 3 additions & 3 deletions e2e/tests/gke_cluster_zonal/locals.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
locals {
ip_range_pods = "${var.cluster_name}-ip-range-pods"
ip_range_services = "${var.cluster_name}-ip-range-services"
ip_range_nodes = "${var.cluster_name}-ip-range-nodes"
ip_range_pods = "${var.cluster_name}-ip-range-pods"
ip_range_services = "${var.cluster_name}-ip-range-services"
ip_range_nodes = "${var.cluster_name}-ip-range-nodes"
}
16 changes: 8 additions & 8 deletions e2e/tests/gke_cluster_zonal/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ provider "helm" {

provider "castai" {
api_token = var.castai_api_token
api_url = var.castai_api_url
api_url = var.castai_api_url
}

provider "google" {
credentials = base64decode(var.gcp_credentials_base64)
region = var.network_region
region = var.network_region
}

provider "google-beta" {
credentials = base64decode(var.gcp_credentials_base64)
region = var.network_region
region = var.network_region
}

module "castai-gke-iam" {
Expand All @@ -35,10 +35,10 @@ module "castai-gke-iam" {
module "castai-gke-cluster" {
source = "castai/gke-cluster/castai"

project_id = var.project_id
gke_cluster_name = var.cluster_name
gke_cluster_location = var.cluster_location
api_url = var.castai_api_url
project_id = var.project_id
gke_cluster_name = var.cluster_name
gke_cluster_location = var.cluster_location
api_url = var.castai_api_url
gke_credentials = module.castai-gke-iam.private_key
delete_nodes_on_disconnect = true

Expand Down Expand Up @@ -85,7 +85,7 @@ module "castai-gke-cluster" {
use_spot_fallbacks = true
min_cpu = 4
max_cpu = 100
instance_families = {
instance_families = {
exclude = ["e2"]
}
compute_optimized = false
Expand Down
4 changes: 2 additions & 2 deletions e2e/tests/gke_cluster_zonal/output.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
output "castai_cluster_id" {
value = module.castai-gke-cluster.cluster_id
output "castai_cluster_id" {
value = module.castai-gke-cluster.cluster_id
sensitive = true
}
10 changes: 5 additions & 5 deletions e2e/tests/gke_cluster_zonal/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@ variable "cluster_name" {
type = string
}
variable "cluster_location" {
type = string
type = string
}

variable "network_region" {
type = string
}

variable "project_id" {
type = string
type = string
}
variable "castai_api_token" {
type = string
type = string
}

variable "castai_api_url" {
type = string
type = string
default = "https://api.cast.ai"
}

variable "cluster_zones" {
type = list(string)
type = list(string)
default = ["europe-west1-b", "europe-west1-c"]
}

Expand Down
2 changes: 1 addition & 1 deletion e2e/tests/gke_cluster_zonal/version.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ terraform {
organization = "CastAI"

workspaces {
name = "e2e-tf-gke-tf-e2e-gke"
name = "e2e-tf-gke-tf-e2e-gke"
}
}
}
4 changes: 2 additions & 2 deletions e2e/tests/gke_cluster_zonal/vpc.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ module "vpc" {
(local.ip_range_nodes) = [
{
range_name = local.ip_range_pods
ip_cidr_range = "10.1.0.0/20"
ip_cidr_range = "10.1.0.0/20"
},
{
range_name = local.ip_range_services
ip_cidr_range = "10.3.0.0/20"
ip_cidr_range = "10.3.0.0/20"
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion examples/aks/aks_cluster/aks.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ resource "azurerm_kubernetes_cluster" "this" {
node_resource_group = "${var.cluster_name}-ng"

default_node_pool {
name = "default"
name = "default"
# Node count has to be > 2 to successfully deploy CAST AI controller.
node_count = 2
vm_size = "Standard_D2_v2"
Expand Down
6 changes: 3 additions & 3 deletions examples/aks/aks_cluster/castai.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ provider "castai" {
provider "helm" {
kubernetes {
host = azurerm_kubernetes_cluster.this.kube_config.0.host
client_certificate = base64decode(azurerm_kubernetes_cluster.this.kube_config.0.client_certificate)
client_certificate = base64decode(azurerm_kubernetes_cluster.this.kube_config.0.client_certificate)
client_key = base64decode(azurerm_kubernetes_cluster.this.kube_config.0.client_key)
cluster_ca_certificate = base64decode(azurerm_kubernetes_cluster.this.kube_config.0.cluster_ca_certificate)
cluster_ca_certificate = base64decode(azurerm_kubernetes_cluster.this.kube_config.0.cluster_ca_certificate)
}
}

# Configure AKS cluster connection to CAST AI using CAST AI aks-cluster module.
module "castai-aks-cluster" {
source = "castai/aks/castai"

api_url = var.castai_api_url
api_url = var.castai_api_url
castai_api_token = var.castai_api_token
wait_for_cluster_ready = true

Expand Down
2 changes: 1 addition & 1 deletion examples/aks/aks_cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ variable "cluster_version" {
}

variable "castai_api_url" {
type = string
type = string
description = "URL of alternative CAST AI API to be used during development or testing"
default = "https://api.cast.ai"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/aks/aks_cluster/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ terraform {
source = "hashicorp/azuread"
}
castai = {
source = "castai/castai"
source = "castai/castai"
}
}
required_version = ">= 0.13"
Expand Down
2 changes: 1 addition & 1 deletion examples/aks/aks_cluster_arm_template/aks.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ resource "azurerm_kubernetes_cluster" "this" {
node_resource_group = "${var.cluster_name}-ng"

default_node_pool {
name = "default"
name = "default"
# Node count has to be > 2 to successfully deploy CAST AI controller.
node_count = 2
vm_size = "Standard_D2_v2"
Expand Down
46 changes: 23 additions & 23 deletions examples/aks/aks_cluster_arm_template/castai.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ provider "castai" {
provider "helm" {
kubernetes {
host = azurerm_kubernetes_cluster.this.kube_config.0.host
client_certificate = base64decode(azurerm_kubernetes_cluster.this.kube_config.0.client_certificate)
client_certificate = base64decode(azurerm_kubernetes_cluster.this.kube_config.0.client_certificate)
client_key = base64decode(azurerm_kubernetes_cluster.this.kube_config.0.client_key)
cluster_ca_certificate = base64decode(azurerm_kubernetes_cluster.this.kube_config.0.cluster_ca_certificate)
cluster_ca_certificate = base64decode(azurerm_kubernetes_cluster.this.kube_config.0.cluster_ca_certificate)
}
}

Expand All @@ -39,25 +39,25 @@ module "castai-aks-cluster" {

node_configurations = {
default = {
disk_cpu_ratio = 25
subnets = [azurerm_subnet.internal.id]
tags = var.tags
disk_cpu_ratio = 25
subnets = [azurerm_subnet.internal.id]
tags = var.tags
}

test_node_config = {
disk_cpu_ratio = 25
subnets = [azurerm_subnet.internal.id]
tags = var.tags
disk_cpu_ratio = 25
subnets = [azurerm_subnet.internal.id]
tags = var.tags
max_pods_per_node = 40
}
}

node_templates = {
default_by_castai = {
name = "default-by-castai"
name = "default-by-castai"
configuration_id = module.castai-aks-cluster.castai_node_configurations["default"]
is_default = true
should_taint = false
is_default = true
should_taint = false

constraints = {
on_demand = true
Expand All @@ -70,7 +70,7 @@ module "castai-aks-cluster" {
}
spot_tmpl = {
configuration_id = module.castai-aks-cluster.castai_node_configurations["default"]
should_taint = true
should_taint = true

custom_labels = {
custom-label-key-1 = "custom-label-value-1"
Expand All @@ -79,21 +79,21 @@ module "castai-aks-cluster" {

custom_taints = [
{
key = "custom-taint-key-1"
key = "custom-taint-key-1"
value = "custom-taint-value-1"
},
{
key = "custom-taint-key-2"
key = "custom-taint-key-2"
value = "custom-taint-value-2"
}
]

constraints = {
fallback_restore_rate_seconds = 1800
spot = true
use_spot_fallbacks = true
min_cpu = 4
max_cpu = 100
spot = true
use_spot_fallbacks = true
min_cpu = 4
max_cpu = 100
instance_families = {
exclude = ["standard_DPLSv5"]
}
Expand All @@ -107,7 +107,7 @@ module "castai-aks-cluster" {
// Here:
// - unschedulablePods - Unscheduled pods policy
// - nodeDownscaler - Node deletion policy
autoscaler_policies_json = <<-EOT
autoscaler_policies_json = <<-EOT
{
"enabled": true,
"unschedulablePods": {
Expand Down Expand Up @@ -143,10 +143,10 @@ resource "azurerm_resource_group_template_deployment" "castai_onboarding_arm" {
name = var.cluster_name
resource_group_name = azurerm_kubernetes_cluster.this.resource_group_name
deployment_mode = "Incremental"
template_content = file("castai_arm_template.json",)
template_content = file("castai_arm_template.json", )
parameters_content = jsonencode({
"apiKey" = {value = var.castai_api_token }
"clusterResourceName" = {value = var.cluster_name}
"location" = {value = var.cluster_region}
"apiKey" = { value = var.castai_api_token }
"clusterResourceName" = { value = var.cluster_name }
"location" = { value = var.cluster_region }
})
}
4 changes: 2 additions & 2 deletions examples/aks/aks_cluster_arm_template/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ variable "cluster_version" {
}

variable "castai_api_url" {
type = string
type = string
description = "URL of alternative CAST AI API to be used during development or testing"
default = "https://api.cast.ai"
}

# Variables required for connecting EKS cluster to CAST AI
variable "castai_api_token" {
type = string
type = string
description = "CAST AI API token created in console.cast.ai API Access keys section"
}

Expand Down
2 changes: 1 addition & 1 deletion examples/aks/aks_cluster_arm_template/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ terraform {
source = "hashicorp/azuread"
}
castai = {
source = "castai/castai"
source = "castai/castai"
}
}
required_version = ">= 0.13"
Expand Down
2 changes: 1 addition & 1 deletion examples/aks/aks_cluster_autoscaler_policies/aks.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ resource "azurerm_kubernetes_cluster" "this" {
node_resource_group = "${var.cluster_name}-ng"

default_node_pool {
name = "default"
name = "default"
# Node count has to be > 2 to successfully deploy CAST AI controller.
node_count = 2
vm_size = "Standard_D2_v2"
Expand Down
Loading

0 comments on commit 9050e4b

Please sign in to comment.