About the Author

Nuno do Carmo

During the day, I'm a Global Learning Management System Administrator and Trainer for a pharma company based in Switzerland. Outside work, I'm a Cloud Native passionate with a “twist” everything I do or test, is from Windows Subsystem for Linux (WSL). After years of blogging and helping the community, this year I've been nominated Docker Captain, CNCF Ambassador and dual Microsoft MVP.

Meshery

Meshery is the world's only collaborative cloud manager.

During KubeCon EU 2019, I had the chance to discover two new softwares that simply amazed me:

  1. Meshery, which is the multi-cluster Kubernetes management plane.
  2. k3d, which is used to create a dockerized k3s server.

And, what really appealed to me about both of them is that everything from the installation to the usage was just simple! And cream on the top, both softwares are used with or inside containers, making each ideal for a create/try/delete workflow.

Environment Setup

Before we start having real fun with Meshery, I will quickly list the different components I used for this blog post and ensure I define what could be optional for your own setup:

  1. Meshery
  2. Docker
    • Docker is of course mandatory and as Meshery is based on a Compose file, which means that docker-compose is also mandatory.
  3. k3d
    • k3d or any k3s/K8s cluster that you might have already configured.
  4. WSL2
    • For the (few) ones who know me, my "OS base" is WSL2, which means that without much/any change, it should run fine for any Linux/MacOS setup.
  5. Grafana (optional)
    • Grafana is not mandatory however is strongly recommend. We will setup a dockerized instance, but feel free to plug Meshery with your existing instance.

Nothing is taken for granted

For the sake of making the blog post around Meshery, I won't explain how to install each component and will focus only on getting k3d and Meshery working.

That said, I do not take anything for granted and as Scott Hanselman once taught me: there is no "just have to ..." or "by simply doing ...".

If you face any issue with your setup (hopefully WSL2), just let me know on Twitter or on the Layer5 Slack channel.

Meshery Installation

For the following steps, I will use the Ubuntu 18.04 WSL2 distro:

  • Start docker and confirm it's running:
1sudo service docker start
2docker version
  • Using Docker, install Meshery on your local machine by running the following:
1curl -L https://meshery.io/install | PLATFORM=kubernetes bash -
wsl-docker-start
  • Create a new k3d cluster with the WSL2 IP
1export mainIP=`hostname -I | awk '{ print $1 }'`
2k3d list
3k3d create --workers 3 --api-port ${mainIP}:6443
4export KUBECONFIG="$(k3d get-kubeconfig --name='k3s-default')"
5kubectl cluster-info
wslk3dstart
- Start Meshery on the newly created cluster
1mesheryctl system start
wslmesherystart- Once Meshery is fully started, login in your preferred browser using the WSL2 IP instead of localhost
1export BROWSER=/mnt/c/Firefox/firefox.exe
2$BROWSER $mainIP:9081 &
wslmesheryloginwslmesheryloginsuccess

[Optional] More analytics with Grafana

As stated above, Meshery can leverage the analytics provided by Grafana. For this blog post, as everything is built from scratch. Here is the setup for a new Grafana dockerized instance.

Start a new Grafana on docker instance

1docker run \
2-d \
3-p 3000:3000 \
4--name=grafana \
5-e "GF_SERVER_ROOT_URL=http://$mainIP" \
6-e "GF_SECURITY_ADMIN_PASSWORD=MesheryInstance" \
7grafana/grafana
wslgrafanastart
  • Access the new instance with the admin password that you set in the docker environment variable
1$BROWSER $mainIP:3000 &
wslgrafanalogin
wslgrafanaloginsuccess

An inside look

While everything should run fine, it's always good to have a look at what has been deployed.

In this case, we are almost exclusively working with Docker and the "inside look" should look something like this:

wslmesherycomplete

Conclusion

As Lee Calcote put it, this is a lot of buzz words: Meshery > k3s (deployed via k3d) > Docker > WSL2 > Windows 10. And he's totally right, still the "beauty" here, is that it "simply works".

Since the begin of the Docker era, new tooling has appeard for simplifying complex workflows. Even Kubernetes (K8s) as a much lighter version with k3s by Rancher.

And of course, Meshery which integrates and simplifies the installation and benchmarking of different Kubernetes configurations. Hope you had fun assembling all these pieces and stay tunned for the "Bonuses", more fun to come!

> > > Nunix out

Related Blogs

Layer5, the cloud native management company

An empowerer of engineers, Layer5 helps you extract more value from your infrastructure. Creator and maintainer of cloud native standards. Maker of Meshery, the cloud native manager.