@@ -25,6 +25,7 @@ This Terraform module enables CAST AI Omni functionality for a Kubernetes cluste
2525- Terraform >= 1.10
2626- CAST AI Terraform provider >= 8.4.0
2727- Helm provider >= 3.1.1
28+ - Kubernetes provider >= 2.35.0
2829- Null provider >= 3.2.4
2930- External provider >= 2.3.5
3031- Google provider >= 4.0 (for GKE clusters)
@@ -220,17 +221,11 @@ When `skip_helm = true`, the module creates a ConfigMap named `castai-omni-helm-
220221
221222You can then reference this ConfigMap in your GitOps tools (ArgoCD, Flux, etc.) to install the Helm chart with the correct values.
222223
223- ### Required Providers
224+ ### Provider Configuration
224225
225- ``` hcl
226- data "google_client_config" "default" {}
227-
228- data "google_container_cluster" "gke" {
229- project = var.gke_project_id
230- location = var.gke_cluster_location
231- name = var.gke_cluster_name
232- }
226+ #### GKE Provider Configuration
233227
228+ ``` hcl
234229terraform {
235230 required_version = ">= 1.10"
236231
@@ -245,15 +240,11 @@ terraform {
245240 }
246241 helm = {
247242 source = "hashicorp/helm"
248- version = ">= 3.1.1"
249- }
250- null = {
251- source = "hashicorp/null"
252- version = ">= 3.2.4"
243+ version = ">= 2.0"
253244 }
254- external = {
255- source = "hashicorp/external "
256- version = ">= 2.3.5 "
245+ kubernetes = {
246+ source = "hashicorp/kubernetes "
247+ version = ">= 2.35.0 "
257248 }
258249 }
259250}
@@ -270,6 +261,137 @@ provider "helm" {
270261 }
271262}
272263
264+ provider "kubernetes" {
265+ host = "https://${data.google_container_cluster.gke.endpoint}"
266+ token = data.google_client_config.default.access_token
267+ cluster_ca_certificate = base64decode(data.google_container_cluster.gke.master_auth.0.cluster_ca_certificate)
268+ }
269+
270+ provider "castai" {
271+ api_token = var.castai_api_token
272+ api_url = var.castai_api_url
273+ }
274+ ```
275+
276+ #### EKS Provider Configuration
277+
278+ ``` hcl
279+ terraform {
280+ required_version = ">= 1.10"
281+
282+ required_providers {
283+ castai = {
284+ source = "castai/castai"
285+ version = ">= 8.4.0"
286+ }
287+ aws = {
288+ source = "hashicorp/aws"
289+ version = ">= 6.23.0"
290+ }
291+ helm = {
292+ source = "hashicorp/helm"
293+ version = ">= 3.1.1"
294+ }
295+ kubernetes = {
296+ source = "hashicorp/kubernetes"
297+ version = ">= 2.35.0"
298+ }
299+ }
300+ }
301+
302+ provider "aws" {
303+ region = var.eks_cluster_region
304+ }
305+
306+ provider "helm" {
307+ kubernetes = {
308+ host = data.aws_eks_cluster.eks.endpoint
309+ cluster_ca_certificate = base64decode(data.aws_eks_cluster.eks.certificate_authority[0].data)
310+ exec = {
311+ api_version = "client.authentication.k8s.io/v1beta1"
312+ command = "aws"
313+ args = [
314+ "eks",
315+ "get-token",
316+ "--cluster-name",
317+ data.aws_eks_cluster.eks.name,
318+ "--region",
319+ var.eks_cluster_region
320+ ]
321+ }
322+ }
323+ }
324+
325+ provider "kubernetes" {
326+ host = data.aws_eks_cluster.eks.endpoint
327+ cluster_ca_certificate = base64decode(data.aws_eks_cluster.eks.certificate_authority[0].data)
328+ exec {
329+ api_version = "client.authentication.k8s.io/v1beta1"
330+ command = "aws"
331+ args = [
332+ "eks",
333+ "get-token",
334+ "--cluster-name",
335+ data.aws_eks_cluster.eks.name,
336+ "--region",
337+ var.eks_cluster_region
338+ ]
339+ }
340+ }
341+
342+ provider "castai" {
343+ api_token = var.castai_api_token
344+ api_url = var.castai_api_url
345+ }
346+ ```
347+
348+ #### AKS Provider Configuration
349+
350+ ``` hcl
351+ terraform {
352+ required_version = ">= 1.10"
353+
354+ required_providers {
355+ castai = {
356+ source = "castai/castai"
357+ version = ">= 8.4.0"
358+ }
359+ azurerm = {
360+ source = "hashicorp/azurerm"
361+ version = ">= 3.0"
362+ }
363+ helm = {
364+ source = "hashicorp/helm"
365+ version = ">= 2.0"
366+ }
367+ kubernetes = {
368+ source = "hashicorp/kubernetes"
369+ version = ">= 2.35.0"
370+ }
371+ }
372+ }
373+
374+ provider "azurerm" {
375+ subscription_id = var.azure_subscription_id
376+ features {}
377+ }
378+
379+ provider "helm" {
380+ kubernetes = {
381+ host = data.azurerm_kubernetes_cluster.aks.kube_config[0].host
382+ client_certificate = base64decode(data.azurerm_kubernetes_cluster.aks.kube_config[0].client_certificate)
383+ client_key = base64decode(data.azurerm_kubernetes_cluster.aks.kube_config[0].client_key)
384+ cluster_ca_certificate = base64decode(data.azurerm_kubernetes_cluster.aks.kube_config[0].cluster_ca_certificate)
385+ }
386+ }
387+
388+ provider "kubernetes" {
389+ host = data.azurerm_kubernetes_cluster.aks.kube_config[0].host
390+ client_certificate = base64decode(data.azurerm_kubernetes_cluster.aks.kube_config[0].client_certificate)
391+ client_key = base64decode(data.azurerm_kubernetes_cluster.aks.kube_config[0].client_key)
392+ cluster_ca_certificate = base64decode(data.azurerm_kubernetes_cluster.aks.kube_config[0].cluster_ca_certificate)
393+ }
394+
273395provider "castai" {
274396 api_token = var.castai_api_token
275397 api_url = var.castai_api_url
0 commit comments