-
DescriptionThe SSH identity files generated by
Kube.tf filelocals {
# You have the choice of setting your Hetzner API token here or define the TF_VAR_hcloud_token env
# within your shell, such as such: export TF_VAR_hcloud_token=xxxxxxxxxxx
# If you choose to define it in the shell, this can be left as is.
# Your Hetzner token can be found in your Project > Security > API Token (Read & Write is required).
# hcloud_token = "xxxxxxxxxxx"
}
module "kube-hetzner" {
providers = {
hcloud = hcloud
}
hcloud_token = var.hcloud_token != "" ? var.hcloud_token : local.hcloud_token
source = "kube-hetzner/kube-hetzner/hcloud"
ssh_public_key = file("~/.ssh/kube_hetzner.pub")
ssh_private_key = file("~/.ssh/kube_hetzner")
network_region = "eu-central"
control_plane_nodepools = [
{
name = "control-plane-fsn1",
server_type = "cax11",
location = "fsn1",
labels = [],
taints = [],
count = 1
},
{
name = "control-plane-nbg1",
server_type = "cax11",
location = "nbg1",
labels = [],
taints = [],
count = 1
},
{
name = "control-plane-hel1",
server_type = "cax11",
location = "hel1",
labels = [],
taints = [],
count = 1
}
]
agent_nodepools = [
{
name = "agent-fsn1",
server_type = "cax21",
location = "fsn1",
labels = [],
taints = [],
count = 1
},
]
load_balancer_type = "lb11"
load_balancer_location = "fsn1"
initial_k3s_channel = "v1.28"
cni_plugin = "cilium"
dns_servers = [
"1.1.1.1",
"8.8.8.8",
"2606:4700:4700::1111",
]
use_control_plane_lb = true
create_kubeconfig = false
}
provider "hcloud" {
token = var.hcloud_token != "" ? var.hcloud_token : local.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
default = ""
} ScreenshotsI noticed One of the used files is PlatformLinux (WSL) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
@DjVinnii Make sure you update WSL to the latest version and generate your key using the same method as described in our SSH doc here please. https://github.com/kube-hetzner/terraform-hcloud-kube-hetzner/blob/master/docs/ssh.md |
Beta Was this translation helpful? Give feedback.
-
I ran into the exact same issue on Windows with WSL2. find .terraform -type f -print0 | xargs -0 dos2unix Make sure |
Beta Was this translation helpful? Give feedback.
I ran into the exact same issue on Windows with WSL2.
What fixed it for me was to run this command in my project directory to convert the line endings to LF only:
find .terraform -type f -print0 | xargs -0 dos2unix
Make sure
dos2unix
is installed.