The following Vagrantfile code(syntax is Ruby) is creating single node Kubernetes cluster with Minikube.
Copy above code and follow the following screenshots. Run the following commands in Terminal.
mkdir MinikubeVagrant
cd MinikubeVagrant
nano Vagrantfile
Paste the Vagrantfile content like below.
save Vagrantfile and run the following command to start virtual machine.
vagrant up
Creating Kubernetes Dashboard Proxy
After Vagrant is up, it means that Minikube is ready to use. So, connect with SSH to Vagrant machine and run the following code to start Kubernetes Dashboard Proxy.
kubectl proxy --address 0.0.0.0 --port=8001 --accept-hosts '.*'
Connecting to Kubernetes Dashboard from Host machine
Click one of the following link to connect the Dashboard. Ta taaa 🙂
or
Rest of the details are already mentioned in this blog link Kubernetes multi node cluster with Vagrant (included Kubernetes Dashboards, Grafana, Prometheus)
read the Kubernetes Dashboard Access Control paragraph.
I have a question, as soon as my vagrant is restarted I am unable to connect to Kubernetes dashboard by using following command:
kubectl proxy –address 0.0.0.0 –port=8001 –accept-hosts '.*'