Skip to content

Commit

Permalink
tf machine controller needs private key (#173)
Browse files Browse the repository at this point in the history
  • Loading branch information
karan authored and k8s-ci-robot committed May 16, 2018
1 parent ac9edb9 commit c0ffba9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cloud/terraform/machineactuator.go
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ func (tf *TerraformClient) updateMasterInPlace(goalMachine *clusterv1.Machine) e
// Control plane upgrade
if goalMachineControlPlaneVersion != currentControlPlaneVersion {
// Pull the kudeadm for target version K8s.
cmd := fmt.Sprintf("curl -sSL https://dl.k8s.io/release/%s/bin/linux/amd64/kubeadm | sudo tee /usr/bin/kubeadm > /dev/null; " +
cmd := fmt.Sprintf("curl -sSL https://dl.k8s.io/release/v%s/bin/linux/amd64/kubeadm | sudo tee /usr/bin/kubeadm > /dev/null; " +
"sudo chmod a+rx /usr/bin/kubeadm", goalMachineControlPlaneVersion)
_, err := tf.remoteSshCommand(goalMachine, cmd, "~/.ssh/id_rsa", "ubuntu")
if err != nil {
Expand Down
13 changes: 13 additions & 0 deletions tf-deployer/vsphere_named_machines.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,19 @@ items:
client_device = true
}
// Copy the private key over so the controller is able to ssh into the nodes.
provisioner "file" {
source = "~/.ssh/vsphere_tmp"
destination = "~/.ssh/id_rsa"
connection {
type = "ssh"
private_key = "${file("~/.ssh/vsphere_tmp")}"
user = "ubuntu"
agent = true
}
}
vapp {
properties {
hostname = "${var.vm_name}"
Expand Down

0 comments on commit c0ffba9

Please sign in to comment.