I have a strange issue. I was using your awesome little hcloud kubernetes implementation the last years. But now I got a new Mac and had to setup everything freshly and took the chance to update to "JWDobken/kubernetes/hcloud" 0.4.0.
So far so good. My configurations looks like in your example:
# providers
terraform {
required_providers {
kubernetes = {
source = "hashicorp/kubernetes"
version = ">= 2.0.0"
}
hcloud = {
source = "hetznercloud/hcloud"
}
}
}
variable "hcloud_token" {
type = string
}
resource "hcloud_ssh_key" "geeksven_cluster" {
name = "geeksven-cluster"
public_key = file("~/.ssh/id_rsa.pub")
}
module "hcloud_kubernetes_cluster" {
source = "JWDobken/kubernetes/hcloud"
version = "0.4.0"
cluster_name = "geeksven-cluster"
hcloud_token = var.hcloud_token
hcloud_ssh_keys = [hcloud_ssh_key.geeksven_cluster.id]
private_key = file("~/.ssh/id_rsa")
control_plane_type = "cx11" # optional
worker_type = "cx11" # optional
worker_count = 1
}
resource "hcloud_load_balancer" "load_balancer" {
name = "geeksven-lb"
load_balancer_type = "lb11"
location = "nbg1"
}
resource "hcloud_load_balancer_network" "cluster_network" {
load_balancer_id = hcloud_load_balancer.load_balancer.id
network_id = module.hcloud_kubernetes_cluster.network_id
}
output "kubeconfig" {
value = module.hcloud_kubernetes_cluster.kubeconfig
}
But somehow it is not installing the nodes correctly. It feels like the modules/kubernetes/scripts/install.sh is not executed at all. Did you have this issue too?
the error output also states kubectl is missing and that's why I actually checked the nodes. I ssh to them and yes nothing is installed.
Error: Provider produced inconsistent final plan
โ
โ When expanding the plan for module.hcloud_kubernetes_cluster.module.kubernetes.module.endpoint.null_resource.contents to include new values learned so far during
โ apply, provider "registry.terraform.io/hashicorp/null" produced an invalid new value for .triggers["stderr"]: was cty.StringVal("https://5.75.169.22:6443"), but
โ now cty.StringVal("Warning: Permanently added '5.75.169.24' (ED25519) to the list of known hosts.\r\nbash: kubectl: command not found").
โ
โ This is a bug in the provider, which should be reported in the provider's own issue tracker.
I can also provide you with the trace logs from kubernetes if you like to.