cicdteam / terraform-hcloud-k3s

Kubernetes (k3s) Terraform installer for Hetzner Cloud
MIT License
76 stars 28 forks source link

Install specific CSI/CCM manifest via terraform #16

Open toabi opened 3 years ago

toabi commented 3 years ago

This would allow to define/update the version of the manifests without changing this module.

I once did this for CSI somewhere with the kubectl provider:

data "http" "csi_driver_manifest" {
  url = "https://raw.githubusercontent.com/hetznercloud/csi-driver/${var.csi_driver_version}/deploy/kubernetes/hcloud-csi.yml"
}

data "kubectl_file_documents" "csi_driver" {
  content = data.http.csi_driver_manifest.body
}

resource "kubectl_manifest" "csi_driver" {
  count      = length(data.kubectl_file_documents.csi_driver.documents)
  yaml_body  = element(data.kubectl_file_documents.csi_driver.documents, count.index)
}

For CMM this would then also make sense.

jceb commented 2 years ago

Thank you for the idea, fixed at https://github.com/identinet/terraform-hcloud-k3s/commit/56046406b37276818405b47a6474d0f9748f5079