docs/static/v0.7/installation/kubernetes/minikube/index.html
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. You can also Visualize the resources in your cluster in Operator Mode, See Views in Visualizer.
There are two ways to create this connection:
Note: It is advisable to Install Meshery in your Minikube clusters
Prerequisites
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:
`$ minikube start`
Check the status of your minikube cluster by running:
`$ minikube status`
Verify that the current context is set to minikube by running:
`$ kubectl config current-context`
Ensure you are logged in and authenticated with Meshery by running the following command:
`$ mesheryctl system login`
mesheryctlTo install Meshery inside your minikube cluster, run the command:
`$ mesheryctl system start -p kubernetes`
This command deploys the Meshery Helm chart in the Meshery namespace.
To verify your deployment, run:
`$ helm list -A -n meshery`
After deployment, access the Meshery UI using port forwarding, with the command:
`$ 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:
`$ mesheryctl system config minikube `
The mesheryctl system config minikube command properly configures and uploads your kubeconfig file to the Meshery UI.
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:
`$ mesheryctl system start -p docker`
This will spin up meshery docker containers. To verify that Meshery is running, use
`$ 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:
`$ 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:
$ docker network connect bridge meshery-meshery-1
$ docker network connect minikube meshery-meshery-1
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.
`$ nano ~/.kube/config.yaml
## Change the server address
server: https://{minikubeIP}:{port}
`
Ctrl + X then enter Y to save and close the file.
Next run this command to configure Meshery to access your cluster.
`$ 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 mesheryctl system check.
After successfully deploying Meshery, you can access Meshery’s web-based user interface. Your default browser will be automatically opened and directed to Meshery UI (default location is http://localhost:9081).
You can use the following command to open Meshery UI in your default browser:
`$ mesheryctl system dashboard `
If you have installed Meshery on Kubernetes or a remote host, you can access Meshery UI by exposing it as a Kubernetes service or by port forwarding to Meshery UI.
`$ mesheryctl system dashboard --port-forward `
Depending upon how you have networking configured in Kubernetes, alternatively, you can use kubectl to port forward to Meshery UI.
`$ kubectl port-forward svc/meshery 9081:9081 --namespace meshery`
After installing Meshery, regardless of the installation type, it is important to verify that your kubeconfig file has been uploaded correctly via the UI.
Connected.#Customizing Your Meshery Provider Callback URL
Meshery Server supports customizing your Meshery Provider authentication flow callback URL. This is helpful when deploying Meshery behind multiple layers of networking infrastructure.
For production deployments, it is recommended to access the Meshery UI by setting up a reverse proxy or using a LoadBalancer. By specifying a custom redirect endpoint, you can ensure that authentication flows complete successfully, even when multiple routing layers are involved.
Note : For production deployments, it is important to preselect the choice of Remote Provider in order to control which identity providers authorized. Learn more about this in the Extensibility: Providers guide.
Define a custom callback URL by setting up the MESHERY_SERVER_CALLBACK_URL environment variable before installing Meshery.
To customize the authentication flow callback URL, use the following command:
$ MESHERY\_SERVER\_CALLBACK\_URL=https://custom-host mesheryctl system start
Meshery should now be running in your Kubernetes cluster and the Meshery UI should be accessible at the EXTERNAL IP of the meshery service.