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]: Given value is not suitable for module.kube-hetzner.var.extra_kustomize_parameters #1679

Open
ToshY opened this issue Mar 30, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@ToshY
Copy link

ToshY commented Mar 30, 2025

Description

I want to pass additional parameters for kustomize to use.

  extra_kustomize_parameters = {
    domain = var.domain 
    letsencrypt = var.kustomize.letsencrypt
  }

Where var.domain is of type string and var.kustomize.letsencrypt is of type object. It gives an error when running terraform plan:

╷
│ Error: Invalid value for input variable
│
│   on kube.tf line 135, in module "kube-hetzner":
│  135:   extra_kustomize_parameters = {
│  136:     domain = var.domain
│  137:     letsencrypt = var.kustomize.letsencrypt
│  138:   }
│
│ The given value is not suitable for module.kube-hetzner.var.extra_kustomize_parameters declared at .terraform/modules/kube-hetzner/variables.tf:1024,1-38: all map elements must have the
│ same type.
╵

When changing the type from map(any) to any, it works again.

Kube.tf file

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

  source = "kube-hetzner/kube-hetzner/hcloud"
  # version = "2.17.0"

  cluster_name = var.server.name

  create_kubeconfig = true
  export_values     = true

  ssh_port           = var.ssh.port
  ssh_public_key = file(var.ssh.public_key)
  ssh_private_key = file(var.ssh.private_key)
  ssh_max_auth_tries = var.ssh.max_retries
  network_region     = var.network.network_zone

  # Adding extra firewall rules, like opening a port
  # More info on the format here https://registry.terraform.io/providers/hetznercloud/hcloud/latest/docs/resources/firewall
  extra_firewall_rules = [
    {
      description = "To Allow ArgoCD access to resources via SSH"
      direction   = "out"
      protocol    = "tcp"
      port        = var.ssh.port
      source_ips = []
      destination_ips = ["0.0.0.0/0", "::/0"]
    }
  ]

  # For HA, atleast 3 control planes and 2 agents
  control_plane_nodepools = local.control_plane_nodepools
  agent_nodepools = local.agent_nodepools

  # LB location and type, the latter will depend on how much load you want it to handle, see https://www.hetzner.com/cloud/load-balancer
  load_balancer_type                  = var.loadbalancer.type
  load_balancer_location              = var.loadbalancer.location
  load_balancer_algorithm_type        = var.loadbalancer.algorithm
  load_balancer_health_check_interval = "${var.loadbalancer.healtcheck.interval}s"
  load_balancer_health_check_timeout  = "${var.loadbalancer.healtcheck.timeout}s"
  load_balancer_health_check_retries = var.loadbalancer.healtcheck.retries

  k3s_token = var.k3s_token

  # Ingress
  ingress_controller             = var.ingress.controller
  traefik_image_tag              = var.ingress.tag
  # traefik_additional_trusted_ips = var.ingress.trusted_ips

  enable_cert_manager = true
  dns_servers = [
    "1.1.1.1",
    "8.8.8.8",
    "2606:4700:4700::1111",
  ]

  enable_metrics_server     = true
  automatically_upgrade_k3s = true
  system_upgrade_use_drain  = true
  automatically_upgrade_os  = true

  extra_kustomize_parameters = {
    domain = var.domain
    letsencrypt = var.kustomize.letsencrypt
  }
}

Screenshots

No response

Platform

Linux

@ToshY ToshY added the bug Something isn't working label Mar 30, 2025
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

No branches or pull requests

1 participant