I am new in kubernetes world and would like to try it out. So I've installed the minikube according to intallation instructions https://kubernetes.io/docs/tasks/tools/install-minikube/. My environment looks as follows:
The installation was successful and I have access to minikube. With the statement for example, kubectl get services
I've got some output on the terminal console. Everthing works as expected on baremetal installation.
Now, I've installed Xubuntu in a virtual machine and would like to access minikube via the terminal from Xubuntu.
In addition, I've installed https://kubernetes.io/docs/tasks/tools/install-kubectl/ on Xubuntu and when I try to start it, it says localhost:8080 not found
?
How to setup the virtual machine to get the communication between Xubuntu and minikube working?
Hint, I use virtual box.
If I understood the setup, both the Xubuntu and minikube VMs are VirtualBox VMs on the same (baremetal) host?
For one, the two VMs need to be able to "talk" to each other with proper networking. Here is a related question: https://superuser.com/a/119741
This will make it possible for kubectl
to connect to the Kubernetes API server in the minikube VM. You'd have to edit kubectl's configuration in the Xubuntu VM to specify the IP of the minikube's VM and security.
The Kubernetes Service(s) should be published to be accessible from outside the Kubernetes cluster/minikube, say, as NodePort or via Ingress. That should make a Service on minikube accessible by the minikube VMs IP and NodePort's port or Ingress' port.
By setting up port forwarding/NAT in VirtualBox, the Kubernetes API and other Services on minikube will be accessible over localhost
from the baremetal host.
tl;dr; You don't
minikube is used for local prototyping and experimentation and isn't designed for simple access from other machines (i.e. other virtual machines, even on the same computer). In order to allow your Xubuntu VM to access your minikube instance you will need to understand the underlying networking principles to allow traffic between your two VM's via your bare-metal host.
Likely you should set up a proper Kubernetes cluster using tooling such as kubeadm
in order to simplify the arrangement you are trying to achieve