diff --git a/application.tf b/application.tf index 949ba2ba..29a66137 100644 --- a/application.tf +++ b/application.tf @@ -749,7 +749,8 @@ module "indico-common" { depends_on = [ module.cluster, time_sleep.wait_1_minutes_after_cluster, - module.secrets-operator-setup + module.secrets-operator-setup, + kubectl_manifest.gp2-storageclass ] source = "./modules/common/indico-common" argo_enabled = var.argo_enabled diff --git a/main.tf b/main.tf index 8316fc86..1923482e 100644 --- a/main.tf +++ b/main.tf @@ -447,8 +447,13 @@ provider "kubernetes" { provider "kubectl" { host = module.cluster.kubernetes_host cluster_ca_certificate = module.cluster.kubernetes_cluster_ca_certificate - token = data.aws_eks_cluster_auth.local.token - load_config_file = false + #token = data.aws_eks_cluster_auth.local.token + load_config_file = false + exec { + api_version = "client.authentication.k8s.io/v1beta1" + args = ["eks", "get-token", "--cluster-name", var.label] + command = "aws" + } } diff --git a/nodes.tf b/nodes.tf index 5e2cf000..1c4d1969 100644 --- a/nodes.tf +++ b/nodes.tf @@ -85,39 +85,39 @@ locals { insights_default_node_groups = { general = { - type = "cpu" - spot = false - instance_types = ["m5a.xlarge"] - min_size = 1 - max_size = 5 - desired_capacity = "3" + type = "cpu" + spot = false + instance_types = ["m5a.xlarge"] + min_size = 1 + max_size = 5 + desired_capacity = "3" }, pgo-workers = { - type = "cpu" - spot = false - instance_types = ["m5a.large"] - min_size = 1 - max_size = 2 - desired_capacity = "2" - taints = "--register-with-taints=indico.io/crunchy=true:NoSchedule" + type = "cpu" + spot = false + instance_types = ["m5a.large"] + min_size = 1 + max_size = 2 + desired_capacity = "2" + taints = "--register-with-taints=indico.io/crunchy=true:NoSchedule" }, celery-workers = { - type = "cpu" - spot = false - instance_types = ["m5a.xlarge"] - min_size = 1 - max_size = 3 - desired_capacity = "1" - taints = "--register-with-taints=indico.io/celery-workers=true:NoSchedule" + type = "cpu" + spot = false + instance_types = ["m5a.xlarge"] + min_size = 1 + max_size = 3 + desired_capacity = "1" + taints = "--register-with-taints=indico.io/celery-workers=true:NoSchedule" }, minio = { - type = "cpu" - spot = false - instance_types = ["t3a.xlarge"] - min_size = 1 - max_size = 4 - desired_capacity = "4" - taints = "--register-with-taints=indico.io/minio=true:NoSchedule" + type = "cpu" + spot = false + instance_types = ["t3a.xlarge"] + min_size = 1 + max_size = 4 + desired_capacity = "4" + taints = "--register-with-taints=indico.io/minio=true:NoSchedule" }, monitoring-workers = { min_size = 1 @@ -129,31 +129,33 @@ locals { taints = "--register-with-taints=indico.io/monitoring=true:NoSchedule" }, weaviate = { - type = "cpu" - spot = false - instance_types = ["r5a.xlarge"] - min_size = 1 - max_size = 3 - desired_capacity = "3" - taints = "--register-with-taints=indico.io/weaviate=true:NoSchedule" + type = "cpu" + spot = false + instance_types = ["r5a.xlarge"] + min_size = 1 + max_size = 3 + desired_capacity = "3" + taints = "--register-with-taints=indico.io/weaviate=true:NoSchedule" }, weaviate-workers = { - type = "cpu" - spot = false - instance_types = ["c6a.2xlarge"] - min_size = 1 - max_size = 4 - desired_capacity = "2" - taints = "--register-with-taints=indico.io/weaviate-workers=true:NoSchedule" + type = "cpu" + spot = false + instance_types = ["c6a.2xlarge"] + min_size = 1 + max_size = 4 + desired_capacity = "2" + taints = "--register-with-taints=indico.io/weaviate-workers=true:NoSchedule" } } - default_node_groups = merge((var.insights_enabled ? local.insights_default_node_groups : null), (var.ipa_enabled ? local.intake_default_node_groups : null)) + default_node_groups = merge((var.insights_enabled ? local.insights_default_node_groups : tomap(null)), (var.ipa_enabled ? local.intake_default_node_groups : tomap(null))) # This is to avoid terraform errors when the node groups variable is set, # as different keys make the objects incompatible for a ternary function. # To solve this, we set it to null which matches all types - default_node_groups_logic = var.node_groups == null ? local.default_node_groups : null + default_node_groups_logic = var.node_groups == null ? local.default_node_groups : tomap(null) + + variable_node_groups = var.node_groups != null ? var.node_groups : tomap(null) - node_groups = var.node_groups == null ? local.default_node_groups_logic : var.node_groups -} \ No newline at end of file + node_groups = merge(local.default_node_groups_logic, local.variable_node_groups) +}