Getting started with Linkerd Service Mesh on Private K8s Cloud

Szymon Seget
Tegess
Published in
3 min readApr 22, 2018

--

Recently I launched private Kubernetes cloud on few VMs launched by Vagrant on the bare-metal server. I described the whole process in the previous post. Now I’m trying to deploy Linkerd Service Mesh on this cloud and install sample hello world application to verify this installation.

Before I get started with Linkerd, there was a need to check if everything works properly. To do this, let’s deploy a simple application to k8s cluster and publish them externally. Hello World nginx is a very boring example, so I selected paas (PAAS is a simple http server which returns penis ASCII art when called, more info about traditional phallus paintings). I use Kubernetes Dashboard to create this deployment with external endpoint, so K8s needs to create paas service. Everything went slight, but this service (type LoadBalancer) was in pending state all the time. After few hours of research I notice that K8s cannot create LB properly, because my cluster does not have any (AWS or GCE has their own LBs, so K8s can use them). There is one alpha project which could fulfill my requirements — metallb (METALLB).

Authors of metallb provided simple instruction of installation, so:

This config:

contains two important changes. First is avoid-buggy-ips which ensures that addresses 10.244.244.0 and 10.244.244.255 will be reserved and no services will get them. The second is custom arp-network option, because my LAN is not /24. More info about that options can be found on Metallb website.

This step allows me to deploy paas properly and know after opening

http://localhost:8001/api/v1/namespaces/default/services/http:paas:8888/proxy/#!/service?namespace=default

I get

Phallus symbol ASCII ART

so it works!

The next step of my journey with K8s is deploying and testing Linkerd Service Mesh. I started with the easiest configuration (Linkerd basic daemonset) and hello-world example from Linkerd documentation. It should be trivial, but there are some flavours which complicate this process a little bit. First, we should deploy linkerd daemonset.

Then hello-world example like below

but there is an issue with this config. Unfortunately my cluster can’t resolver NODE_NAME to proper IP address, so if you get strange error :

Get http://hello: proxyconnect tcp: dial tcp: lookup worker7 on 10.96.0.10:53: no such host

during curl http_proxy=(Linkerd IP):4140 http://hello , you should check my corrected config:

Then on my base virtual machine I typed:

This gives me the possibility to connect to Kubernetes exposed services from my notebook with only singe port redirection, ex.

and when I type localhost:8888 to my web browser I get

In the same way I can connect to Linkerd Dashboard:

Linkerd Dashboard

When you deploy simple container with ubuntu

you can generate some traffic from it (kubectl exec -it ubuntu /bin/bash, ab -n 1000 -H “Host: hello” 10.244.244.1:4140/) and check on Linkerd Dashboard if it works properly.

To be continued…

Hava a nice day! :)

PS Bhutan penis art is very interesting topic, more info https://www.scoopwhoop.com/Penises-Are-Painted-On-Walls-In-Bhutan/#.2xfna05ly

--

--