docs/content/en/installation/kubernetes/minikube.md
Meshery can manage your minikube clusters and is particularly useful for multi-cluster management and deployments.
For Meshery to manage your Minikube cluster, it has to be discovered and added as a Kubernetes connection in the Meshery server.
After your cluster has been added as a connection, you can use Meshery to make infrastructure deployments of your Meshery Designs to your cluster. To learn more about this, See Deploying Meshery Designs.
There are two ways to create this connection:
Note: It is advisable to install Meshery in your Minikube clusters
<div class="prereqs"><p><strong style="font-size: 20px;">Prerequisites</strong> </p> <ol> <li>Install the Meshery command-line client, <a href="/installation/mesheryctl" class="meshery-light">mesheryctl</a>.</li> <li>Install <a href="https://kubernetes.io/docs/tasks/tools/">kubectl</a> on your local machine.</li> <li>Install <a href="https://minikube.sigs.k8s.io/docs/start/?arch=%2Fmacos%2Fx86-64%2Fstable%2Fbinary+download"> Minikube</a> on your local machine.</li> <li>Install <a href="https://helm.sh/docs/intro/install/">Helm</a>.</li> </ol> </div>Also see: Install Meshery on Kubernetes
Before deploying Meshery on minikube, complete the following initial setup tasks to prepare your environment.
Start minikube using the following command if it is not already running:
{{< code code="minikube start" >}}
Check the status of your minikube cluster by running:
{{< code code="minikube status" >}}
Verify that the current context is set to minikube by running:
{{< code code="kubectl config current-context" >}}
Ensure you are logged in and authenticated with Meshery by running the following command:
{{< code code="mesheryctl system login" >}}
mesheryctlTo install Meshery inside your minikube cluster, run the command:
{{< code code="mesheryctl system start -p kubernetes" >}} This command deploys the Meshery Helm chart in the Meshery namespace.
To verify your deployment, run:
{{< code code="helm list -A -n meshery" >}} After deployment, access the Meshery UI using port forwarding, with the command:
{{< code code="mesheryctl system dashboard --port-forward" >}} For detailed instructions on port forwarding, refer to the port-forwarding guide.
By default, Meshery auto-detects your Minikube cluster and establishes a connection. However, if this doesn’t happen, you can connect by running the following command:
{{< code code="mesheryctl system config minikube" >}}
The mesheryctl system config minikube command properly configures and uploads your kubeconfig file to the Meshery UI.
<a href="/installation/kubernetes/images/minikube-upload.png"></a>
You can deploy Meshery directly using the Helm CLI. For detailed instructions on installing Meshery using Helm V3, please refer to the Helm Installation guide.
To install Meshery on Docker(out-of-cluster) and connect it to your Minikube cluster, follow these steps:
Run the following command to start Meshery in a Docker environment:
{{< code code="mesheryctl system start -p docker" >}} This will start Meshery in Docker containers. To verify that Meshery is running, use
{{< code code="docker ps" >}}
Meshery UI will be accessible on your local machine on port 9081. Open your browser and access Meshery at http://localhost:9081.
Configure Meshery to connect with your minikube cluster by running the command:
{{< code code="mesheryctl system config minikube" >}}
For users running minikube with the Docker driver, specific steps are needed to ensure that Meshery can connect properly to your minikube cluster.
If you set up your minikube cluster using the Docker driver, both minikube and Meshery will be running in Docker containers. So, you need to ensure that the Meshery and minikube containers can communicate with each other by placing them in the same Docker network.
To configure this, run the following commands:
<pre class="codeblock-pre"><div class="codeblock"> <div class="clipboardjs">docker network connect bridge meshery-meshery-1</div></div> </pre> <pre class="codeblock-pre"><div class="codeblock"> <div class="clipboardjs">docker network connect minikube meshery-meshery-1</div></div> </pre>Next, update the Kubernetes API server address in your kubeconfig file before running the mesheryctl system config minikube command. The steps to do this are outlined below.
To allow the Meshery container to access your Minikube cluster (since both are running in containers), you need to update the Kubernetes API server address in your kubeconfig file to the external minikube IP address. This is necessary because Docker typically forwards ports to a localhost address, which isn’t accessible between containers.
To retrieve the Minikube IP, run the command minikube ip. To check which port minikube is using, run docker ps to view the container's port, which is typically 8443.
Open the kubeconfig file and update the server address.
{{< code code=`nano ~/.kube/config.yaml
server: https://{minikubeIP}:{port}` >}}
Ctrl + X then enter Y to save and close the file.
Next, run the following command to configure Meshery to access your cluster.
{{< code code="mesheryctl system config minikube" >}}
Note: An alternative to running the mesheryctl system config minikube command for Meshery to discover your cluster is manually uploading your config file to the UI.
Note: Meshery can only connect to your cluster if it is running locally (Kubernetes or Docker). Direct connections are not possible when using the hosted Meshery Playground.
To manually upload your kubeconfig file after running Meshery locally:
Note: If you encounter a connections refused error while uploading your kubeconfig, try changing your cluster server URL to the external API address of minikube. To do this follow the steps listed in the Minikube Docker Driver Users Section.
If you experience any issues during installation, refer to the Troubleshooting Meshery Installations guide for help.
Verify the health of your Meshery deployment, using <a href='/reference/mesheryctl/system/check'>mesheryctl system check</a>.
{{< installation/accessing-meshery-ui >}}
{{< related-discussions tag="meshery" >}}