Abdennour Toumi
Oct 29, 2018 · 1 min read

You can run kubectl from the host WITHOUT moving the kubeconfig from the vagrant guest machine to the host:

# vagrant ssh -- <your-command-line>
vargrant ssh -- kubectl version
vagrant ssh -- kubectl get nodes
vagrant ssh -- kubectl create -f /vagrant/some-app.yaml
# so on...

Do you like it? You will like the next tips more

alias k='vagrant ssh -- kubectl'

By now, the following command will run smoothly:

k get nodes

Forgot to mention that you need to add the following config to your Vagrantfile

config.vm.synced_folder ".", "/vagrant"

Abdennour Toumi

Written by

Software engineer, Cloud Architect, 5/5 AWS|GCP|PSM Certified, Owner of kubernetes.tn

More From Medium

Also tagged Vagrant

Also tagged K8s

Top on Medium

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade