Skip to content

Commit 295694f

Browse files
Use array when setting VK extra arguments for EKS
1 parent db0a79c commit 295694f

File tree

5 files changed

+37
-1
lines changed

5 files changed

+37
-1
lines changed

examples/onboarding-with-existing-aks-cluster/main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,6 @@ module "castai_omni_edge_location_gcp" {
2727
cluster_id = module.castai_omni_cluster.cluster_id
2828
organization_id = module.castai_omni_cluster.organization_id
2929
region = "europe-west4"
30+
31+
depends_on = [module.castai_omni_cluster]
3032
}

examples/onboarding-with-existing-aks-cluster/providers.tf

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ terraform {
1818
source = "hashicorp/helm"
1919
version = ">= 2.0"
2020
}
21+
kubernetes = {
22+
source = "hashicorp/kubernetes"
23+
version = ">= 2.35.0"
24+
}
2125
}
2226
}
2327

@@ -39,6 +43,13 @@ provider "helm" {
3943
}
4044
}
4145

46+
provider "kubernetes" {
47+
host = data.azurerm_kubernetes_cluster.aks.kube_config[0].host
48+
client_certificate = base64decode(data.azurerm_kubernetes_cluster.aks.kube_config[0].client_certificate)
49+
client_key = base64decode(data.azurerm_kubernetes_cluster.aks.kube_config[0].client_key)
50+
cluster_ca_certificate = base64decode(data.azurerm_kubernetes_cluster.aks.kube_config[0].cluster_ca_certificate)
51+
}
52+
4253
provider "castai" {
4354
api_token = var.castai_api_token
4455
api_url = var.castai_api_url

examples/onboarding-with-existing-eks-cluster/providers.tf

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ terraform {
1414
source = "hashicorp/helm"
1515
version = ">= 3.1.1"
1616
}
17+
kubernetes = {
18+
source = "hashicorp/kubernetes"
19+
version = ">= 2.35.0"
20+
}
1721
null = {
1822
source = "hashicorp/null"
1923
version = ">= 3.2.4"
@@ -53,6 +57,23 @@ provider "helm" {
5357
}
5458
}
5559

60+
provider "kubernetes" {
61+
host = data.aws_eks_cluster.eks.endpoint
62+
cluster_ca_certificate = base64decode(data.aws_eks_cluster.eks.certificate_authority[0].data)
63+
exec {
64+
api_version = "client.authentication.k8s.io/v1beta1"
65+
command = "aws"
66+
args = [
67+
"eks",
68+
"get-token",
69+
"--cluster-name",
70+
data.aws_eks_cluster.eks.name,
71+
"--region",
72+
var.eks_cluster_region
73+
]
74+
}
75+
}
76+
5677
provider "castai" {
5778
api_token = var.castai_api_token
5879
api_url = var.castai_api_url

examples/onboarding-with-existing-gke-cluster/main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,6 @@ module "castai_omni_edge_location_gcp" {
5050
cluster_id = module.castai_omni_cluster.cluster_id
5151
organization_id = module.castai_omni_cluster.organization_id
5252
region = "europe-west4"
53+
54+
depends_on = [module.castai_omni_cluster]
5355
}

modules/eks/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ locals {
2828
}
2929
virtualKubelet = {
3030
extra = {
31-
args = "--certificate-type=aws"
31+
args = ["--certificate-type=aws"]
3232
}
3333
}
3434
networking = {

0 commit comments

Comments
 (0)