From bc1858613240e57db72d51170fc0f950671dfb5c Mon Sep 17 00:00:00 2001 From: phaer Date: Mon, 7 Feb 2022 13:58:21 +0100 Subject: [PATCH] fix kubectl get nodes missing --kubeconfig the current implementation works co-incidentally for most setups, when terraform apply is run from the repos root, but not when kube-hetzner is used as a terraform module --- master.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/master.tf b/master.tf index bd5efba..c64fb92 100644 --- a/master.tf +++ b/master.tf @@ -92,7 +92,7 @@ resource "hcloud_server" "first_control_plane" { sleep 30 scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ${local.ssh_identity_file} root@${self.ipv4_address}:/etc/rancher/k3s/k3s.yaml ${path.module}/kubeconfig.yaml sed -i -e 's/127.0.0.1/${self.ipv4_address}/g' ${path.module}/kubeconfig.yaml - sleep 10 && until kubectl get node ${self.name}; do sleep 5; done + sleep 10 && until kubectl get node ${self.name} --kubeconfig ${path.module}/kubeconfig.yaml; do sleep 5; done EOT }