How to create more than one cluster in minikube?

by caesar_kertzmann , in category: General Help , 3 months ago

How to create more than one cluster in minikube?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer


by samara , 3 months ago


To create more than one cluster in Minikube, you can follow these steps:

  1. Install and set up Minikube on your machine. Make sure it is properly configured and running.
  2. Open a terminal or command prompt and start a new Minikube cluster with a unique name using the minikube start command. For example, to create a cluster named "cluster1" with 2 nodes, you can use the following command: minikube start --nodes 2 -p cluster1 This will create a new cluster named "cluster1" with 2 nodes.
  3. You can then switch to the newly created cluster using the minikube profile command, like this: minikube profile cluster1 This will set the active cluster context to "cluster1", effectively switching to the new cluster.
  4. Verify that you are using the correct cluster context by running the kubectl get nodes command. It should display the nodes of the active cluster.

Repeat the above steps for creating additional clusters as needed, using different names for each cluster. You can switch between clusters by setting the active context using minikube profile cluster_name command and verify the nodes using the kubectl get nodes command.

Note: Make sure to stop and delete the desired cluster before creating a new one, otherwise Minikube will reuse the existing cluster with the same name. You can stop and delete a cluster using the minikube delete -p cluster_name command, where "cluster_name" is the name of the cluster.