Skip to content

Commit 212c21e

Browse files
committed
feat(iac): Fix for kubeconfig ssh
1 parent 85c1b9e commit 212c21e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

deployment/terraform/modules/openstack-kubernetes-infra/kubeconfig-extraction.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ resource "null_resource" "copy_kubeconfig" {
88
command = <<EOT
99
mkdir -p ${path.root}/.build/ && \
1010
ssh-keyscan -H ${openstack_compute_instance_v2.kubernetes_server.access_ip_v4} >> ${path.root}/.build/.known_hosts_cogstack && \
11-
scp -o UserKnownHostsFile=${path.root}/.build/.known_hosts_cogstack -o StrictHostKeyChecking=yes \
11+
ssh -o UserKnownHostsFile=${path.root}/.build/.known_hosts_cogstack -o StrictHostKeyChecking=yes \
1212
-i ${local.ssh_keys.private_key_file} \
13-
ubuntu@${openstack_compute_instance_v2.kubernetes_server.access_ip_v4}:/etc/rancher/k3s/k3s.yaml \
14-
${local.kubeconfig_file} && \
13+
ubuntu@${openstack_compute_instance_v2.kubernetes_server.access_ip_v4} \
14+
"sudo cat /etc/rancher/k3s/k3s.yaml" > ${local.kubeconfig_file} && \
1515
sed -i "s/127.0.0.1/${openstack_compute_instance_v2.kubernetes_server.access_ip_v4}/" ${local.kubeconfig_file}
1616
EOT
1717
}

0 commit comments

Comments
 (0)