Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Error when setting disable_hetzner_csi = true #1586

Closed
janfrederik opened this issue Dec 6, 2024 · 0 comments · Fixed by #1588
Closed

[Bug]: Error when setting disable_hetzner_csi = true #1586

janfrederik opened this issue Dec 6, 2024 · 0 comments · Fixed by #1588
Labels
bug Something isn't working

Comments

@janfrederik
Copy link
Contributor

janfrederik commented Dec 6, 2024

Description

When seting disable_hetzner_csi = true in kube.tf, I get error

module.k8s_cluster.module.kube-hetzner.null_resource.kustomization: Provisioning with 'file'...
╷
│ Error: Error in function call
│
│   on .terraform/modules/k8s_cluster.kube-hetzner/init.tf line 261, in resource "null_resource" "kustomization":
│  261:     content = templatefile(
│  262:       "${path.module}/templates/hcloud-csi.yaml.tpl",
│  263:       {
│  264:         version = local.csi_version
│  265:         values  = indent(4, trimspace(local.hetzner_csi_values))
│  266:     })
│     ├────────────────
│     │ while calling templatefile(path, vars)
│     │ local.csi_version is null
│     │ local.hetzner_csi_values is ""
│     │ path.module is ".terraform/modules/k8s_cluster.kube-hetzner"
│
│ Call to function "templatefile" failed: .terraform/modules/k8s_cluster.kube-hetzner/templates/hcloud-csi.yaml.tpl:10,15-22: Invalid template interpolation value; The expression result is null. Cannot
│ include a null value in a string template..

Kube.tf file

module "kube-hetzner" {
  providers = {
    hcloud = hcloud
  }
  hcloud_token = var.hcloud_token
  source = "kube-hetzner/kube-hetzner/hcloud"

  ssh_public_key = file("~/.ssh/id_ed25519.pub")
  ssh_private_key = file("~/.ssh/id_ed25519")

  control_plane_nodepools = [
    {
      name        = "control-plane-fsn1",
      server_type = "cax11",
      location    = "fsn1",
      labels      = [],
      taints      = [],
      count       = 1
    },
  ]

  agent_nodepools = [
    {
      name        = "agent-small",
      server_type = "cax11",
      location    = "fsn1",
      labels      = [],
      taints      = [],
      count       = 1
    },
  ]

  disable_hetzner_csi = true

  enable_klipper_metal_lb = true

  system_upgrade_use_drain = false
  automatically_upgrade_os = false
}

provider "hcloud" {
  token = var.hcloud_token
}

terraform {
  required_version = ">= 1.5.0"
  required_providers {
    hcloud = {
      source  = "hetznercloud/hcloud"
      version = ">= 1.43.0"
    }
  }
}

output "kubeconfig" {
  value     = module.kube-hetzner.kubeconfig
  sensitive = true
}

variable "hcloud_token" {
  sensitive = true
}

Screenshots

No response

Platform

linux

@janfrederik janfrederik added the bug Something isn't working label Dec 6, 2024
janfrederik added a commit to janfrederik/terraform-hcloud-kube-hetzner that referenced this issue Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant