Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a local-exec to backup a user's existing kube config #11

Open
mike-hosseini opened this issue Sep 3, 2018 · 0 comments
Open

Add a local-exec to backup a user's existing kube config #11

mike-hosseini opened this issue Sep 3, 2018 · 0 comments

Comments

@mike-hosseini
Copy link

mike-hosseini commented Sep 3, 2018

Please add a new local-exec to master droplet in k8s-cicd-webinars/webinar1/2-kubernetes/1-Terraform/cluster.tf to prevent it from replacing the user's existing kube config. I lost my kube config because the scp local-exec replaced it.

Proposed change:

...

  provisioner "local-exec" {
    command = "if [ ! -f '~/.kube/config' ]; then cp ~/.kube/config ~/.kube/config_backup; fi"
  }

  provisioner "local-exec" {
    command = "scp -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@${digitalocean_droplet.master.ipv4_address}:/root/.kube/config ~/.kube/."
  }

...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant