To keep Minikube running all the time, you can follow the steps below:
- Start Minikube: Open a terminal and run the command minikube start. This will start the Minikube cluster and create a new virtual machine where Kubernetes will run.
- Keep the terminal open: Minikube runs in the terminal session, so you need to keep the terminal open. If you close the terminal, Minikube will stop running.
- Use a terminal multiplexer: Alternatively, you can use a terminal multiplexer like tmux or screen to keep Minikube running even when the terminal session is closed. Here's how to do it with tmux:
Install tmux if you don't have it already: sudo apt-get install tmux (for Ubuntu/Debian) or brew install tmux (for macOS/homebrew).
Start a new tmux session: Run the command tmux new -s minikube.
Start Minikube within the tmux session: Inside the tmux session, run minikube start.
Detach from the tmux session: Press Ctrl+b and then d to detach from the tmux session. This will allow Minikube to keep running in the background.
Reattach to the tmux session: Whenever you want to interact with Minikube, open a new terminal window and run tmux attach-session -t minikube to reattach to the tmux session.
With either method, Minikube will continue running until you explicitly stop it using
minikube stop or by closing the terminal session (if you did not use a terminal multiplexer).