Quick Start with KinD

Prerequisites

1. Install the Meshery command line client, mesheryctl .

To set up and run Meshery on KinD

Installation

  • On Mac / Linux via Homebrew (Recommended):
brew install kind
  • On macOS / Linux via curl:
curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.8.1/kind-$(uname)-amd64 chmod +x ./kind mv ./kind /some-dir-in-your-PATH/kind

If you are running Ubuntu on WSL2, use Docker Ubuntu distro to install Docker.

Create cluster using KinD

In order to successfully build the Meshery server on your local server, follow the instructions specific to your Operating System to complete the creation of a KinD cluster.

1. KinD on WSL2

First, we will get the ip address of your WSL2 distro by:

ip addr | grep eth0

You will see the output like:

4: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000 inet 172.1.1.1/20 brd 172.1.1.255 scope global eth0

Copy the ip address, we will use that in the next step.

Then, create a file called kind_cluster.yaml and put the ip address under apiServerAddress:

kind: Cluster apiVersion: kind.x-k8s.io/v1alpha4 networking: apiServerAddress: "172.1.1.1"

Now create the KinD cluster with the config file kind_cluster.yaml:

kind create cluster --config kind_cluster.yaml --name kind --wait 300s

You will see

Creating cluster "kind" ...
 β€’ Ensuring node image (kindest/node:v1.17.0) πŸ–Ό  ...
 βœ“ Ensuring node image (kindest/node:v1.17.0) πŸ–Ό
 β€’ Preparing nodes πŸ“¦   ...
 βœ“ Preparing nodes πŸ“¦
 β€’ Writing configuration πŸ“œ  ...
 βœ“ Writing configuration πŸ“œ
 β€’ Starting control-plane πŸ•ΉοΈ  ...
 βœ“ Starting control-plane πŸ•ΉοΈ
 β€’ Installing CNI πŸ”Œ  ...
 βœ“ Installing CNI πŸ”Œ
 β€’ Installing StorageClass πŸ’Ύ  ...
 βœ“ Installing StorageClass πŸ’Ύ
 β€’ Waiting ≀ 5m0s for control-plane = Ready ⏳  ...
 βœ“ Waiting ≀ 5m0s for control-plane = Ready ⏳
 β€’ Ready after 59s πŸ’š
Set kubectl context to "kind-kind"
You can now use your cluster with:

kubectl cluster-info --context kind-kind

Not sure what to do next? πŸ˜… Check out https://kind.sigs.k8s.io/docs/user/quick-start/
2. KinD on other systems

Creating a Kubernetes cluster is as simple as kind create cluster.

For more configuration of installation, please refer to KinD official documentation.

Access the KinD cluster

By default, the cluster access configuration is stored in ${HOME}/.kube/config if $KUBECONFIG environment variable is not set. You can set the KUBECONFIG environment with the command below:

export KUBECONFIG=${HOME}/.kube/config

Use the command below check the connection of the cluster and make sure the cluster you connected what’s the cluster was created by KinD:

kubectl cluster-info --context kind-kind

To delete your cluster use:

kind delete cluster --name kind

Using Helm

Helm v3

We strongly recommend to use Helm v3, because of this version not including the Tiller(https://helm.sh/blog/helm-3-preview-pt2/#helm) component anymore. It’s lighter and safer.

Run the following:

$ helm repo add meshery https://meshery.io/charts/ $ helm install meshery meshery/meshery -n meshery --create-namespace
  • Meshery server supports customizing authentication flow callback URL, which can be configured in the following way
$ helm install meshery --namespace meshery --set env.MESHERY_SERVER_CALLBACK_URL=https://custom-host meshery/meshery
  • NodePort - If your cluster does not have an Ingress Controller or a load balancer, then use NodePort to expose Meshery and that can be modify under the chart values.yaml:
service: type: NodePort port: 9081 annotations: {}

Meshery should now be connected with your managed Kubernetes instance. Take a look at the Meshery guides for advanced usage tips.